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