MCPcopy
hub / github.com/apache/pouchdb / invalidIdError

Function invalidIdError

lib/index-browser.js:618–630  ·  view source on GitHub ↗
(id)

Source from the content-addressed store, hash-verified

616// - any other string value is a valid id
617// Returns the specific error object for each case
618function invalidIdError(id) {
619 var err;
620 if (!id) {
621 err = createError(MISSING_ID);
622 } else if (typeof id !== 'string') {
623 err = createError(INVALID_ID);
624 } else if (/^_/.test(id) && !(/^_(design|local)/).test(id)) {
625 err = createError(RESERVED_ID);
626 }
627 if (err) {
628 throw err;
629 }
630}
631
632// Checks if a PouchDB object is "remote" or not. This is
633

Callers 2

_setupMethod · 0.70
parseDocFunction · 0.70

Calls 1

createErrorFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…