Closed hazelmeow closed 6 years ago
Changed it to:
A negative lookahead won't work. The node version is wrong in package.json, it should be 8.6 I think.
And it hasn't errored yet. I don't know if my fix will break anything though.
Are you saying all of the unit tests passed?
@jonschlinkert haven't run unit tests, but it worked to temporarily fix my project.
Before change:
store
create
✓ should create an instance of Store
1) should create a store with the given `name`
✓ should initialize a store with the given defaults
set
2) should `.set()` a value
✓ should `.set()` an object
3) should `.set()` a nested value
4) should save data that is added directly to `storedata`
union
5) should add and arrayify a new value
6) should uniquify duplicate values
7) should union an existing value
has
8) should return true if a key has a value
9) should return true if a nested key has a value
hasOwn
10) should return true if a key exists
11) should work with escaped keys
12) should return true if a nested key exists
get
13) should `.get()` a stored value
14) should `.get()` a nested value
union
15) should `.del()` a stored value
del
16) should delete stored values
17) should delete a nested stored value
18) should ignore nested properties that do not exist
19) should delete multiple stored values
json
20) should use the indent value defined on ctor options
3 passing (22ms)
20 failing
...all the fails are because
SyntaxError: Invalid regular expression: /(?<!\\)\./: Invalid group
at split (index.js:392:26)
at set (index.js:438:10)
at Store.set (index.js:73:7)
at Context.<anonymous> (test/test.js:167:13)
after:
store
create
✓ should create an instance of Store
✓ should create a store with the given `name`
✓ should initialize a store with the given defaults
set
✓ should `.set()` a value
✓ should `.set()` an object
✓ should `.set()` a nested value
✓ should save data that is added directly to `storedata`
union
✓ should add and arrayify a new value
✓ should uniquify duplicate values
✓ should union an existing value
has
✓ should return true if a key has a value
✓ should return true if a nested key has a value
hasOwn
✓ should return true if a key exists
1) should work with escaped keys
✓ should return true if a nested key exists
get
✓ should `.get()` a stored value
✓ should `.get()` a nested value
union
✓ should `.del()` a stored value
del
✓ should delete stored values
✓ should delete a nested stored value
✓ should ignore nested properties that do not exist
✓ should delete multiple stored values
json
✓ should use the indent value defined on ctor options
22 passing (24ms)
1 failing
1) store hasOwn should work with escaped keys:
AssertionError [ERR_ASSERTION]: false == true
+ expected - actual
-false
+true
at Context.<anonymous> (test/test.js:158:7)
I eliminated the regex negative lookbehind that caused the error. Thanks for creating the issue
https://github.com/jonschlinkert/data-store/blob/master/index.js#L392
This line:
Throws an error:
Changed it to:
And it hasn't errored yet. I don't know if my fix will break anything though.