You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
it('$== should work with substitutions',()=>{constarray=['a','b','C','hi','ho','xi','big','pig','ball','cake','path/to/a.m4a','path/to/b.jpg']letresources=JSPath.apply('.{. $== $ext}',array,{ext: ['.m4a','.jpg']})expect(resources).toEqual(['path/to/a.m4a','path/to/b.jpg'])// Received:// resources: ["big", "pig", "path/to/a.m4a", "path/to/b.jpg"]resources=JSPath.apply('.{. $== $ext}',array,{ext: ['.m4a','jpg']})expect(resources).toEqual(['path/to/a.m4a','path/to/b.jpg'])// Received:// resources: ["hi", "ho", "xi", "big", "pig", "path/to/a.m4a", "path/to/b.jpg"]})
Depends on the string length in ext, all items with length - 1 in array will returned.
When ext is ['.m4a', '.jpg'] the length are all 4, so all items in array have length 3 will also returned that is "big", "pig"
When ext is ['.m4a', 'jpg'] the length are 4 and 3, so all items in array have length 3 and 2 will also returned that is "hi", "ho", "xi", "big", "pig"
Tested with jspath 0.3.3.
The text was updated successfully, but these errors were encountered:
xpol
added a commit
to xpol/jspath
that referenced
this issue
Mar 10, 2017
Depends on the string length in
ext
, all items with length - 1 inarray
will returned.['.m4a', '.jpg']
the length are all 4, so all items inarray
have length 3 will also returned that is"big", "pig"
['.m4a', 'jpg']
the length are 4 and 3, so all items inarray
have length 3 and 2 will also returned that is"hi", "ho", "xi", "big", "pig"
Tested with jspath 0.3.3.
The text was updated successfully, but these errors were encountered: