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

Function invalidIdError

lib/index.es.js:633–645  ·  view source on GitHub ↗
(id)

Source from the content-addressed store, hash-verified

631// - any other string value is a valid id
632// Returns the specific error object for each case
633function invalidIdError(id) {
634 var err;
635 if (!id) {
636 err = createError(MISSING_ID);
637 } else if (typeof id !== 'string') {
638 err = createError(INVALID_ID);
639 } else if (/^_/.test(id) && !(/^_(design|local)/).test(id)) {
640 err = createError(RESERVED_ID);
641 }
642 if (err) {
643 throw err;
644 }
645}
646
647// Checks if a PouchDB object is "remote" or not. This is
648

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…