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