(id)
| 631 | // - any other string value is a valid id |
| 632 | // Returns the specific error object for each case |
| 633 | function 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 |
no test coverage detected
searching dependent graphs…