MCPcopy Index your code
hub / github.com/FThompson/FormPersistence.js / getStorageKey

Function getStorageKey

form-persistence.js:347–352  ·  view source on GitHub ↗

* Creates a local storage key for the given form. * * @param {HTMLFormElement} form The form to create a storage key for. * * @return {String} The unique form storage key. * @throws {Error} If given a form without an id or uuid.

(form, uuid)

Source from the content-addressed store, hash-verified

345 * @throws {Error} If given a form without an id or uuid.
346 */
347 function getStorageKey(form, uuid) {
348 if (!uuid && !form.id) {
349 throw Error('form persistence requires a form id or uuid')
350 }
351 return 'form#' + (uuid ? uuid : form.id)
352 }
353
354 /**
355 * Return the public interface of FormPersistence.

Callers 3

saveFunction · 0.85
loadFunction · 0.85
clearStorageFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected