MCPcopy Index your code
hub / github.com/apache/pouchdb / invalidIdError

Function invalidIdError

lib/index.js:638–650  ·  view source on GitHub ↗
(id)

Source from the content-addressed store, hash-verified

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

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…