Skip to content

Commit 228f682

Browse files
committed
fix(collate): avoid using \u0000 for indexing
Use \u0003 instead
1 parent 1d50550 commit 228f682

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

packages/node_modules/pouchdb-collate/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"name": "pouchdb-collate",
3-
"version": "7.0.0-prerelease",
2+
"name": "@craftzdog/pouchdb-collate-react-native",
3+
"version": "7.3.0",
44
"description": "Collation functions for PouchDB map/reduce",
55
"main": "lib/index.js",
66
"keywords": [

packages/node_modules/pouchdb-collate/src/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ function indexify(key) {
114114
// for lexical sorting, e.g. within a database, where the
115115
// sorting is the same given by the collate() function.
116116
function toIndexableString(key) {
117-
var zero = '\u0000';
117+
var zero = '\u0003';
118118
key = normalizeKey(key);
119119
return collationIndex(key) + SEP + indexify(key) + zero;
120120
}
@@ -139,7 +139,7 @@ function parseNumber(str, i) {
139139
i += MAGNITUDE_DIGITS;
140140
while (true) {
141141
var ch = str[i];
142-
if (ch === '\u0000') {
142+
if (ch === '\u0003') {
143143
break;
144144
} else {
145145
numAsString += ch;
@@ -201,7 +201,7 @@ function parseIndexableString(str) {
201201
/*eslint no-constant-condition: ["error", { "checkLoops": false }]*/
202202
while (true) {
203203
var collationIndex = str[i++];
204-
if (collationIndex === '\u0000') {
204+
if (collationIndex === '\u0003') {
205205
if (stack.length === 1) {
206206
return stack.pop();
207207
} else {
@@ -227,7 +227,7 @@ function parseIndexableString(str) {
227227
/*eslint no-constant-condition: ["error", { "checkLoops": false }]*/
228228
while (true) {
229229
var ch = str[i];
230-
if (ch === '\u0000') {
230+
if (ch === '\u0003') {
231231
break;
232232
}
233233
parsedStr += ch;

0 commit comments

Comments
 (0)