some progress

This commit is contained in:
Jonas_Jones 2023-03-30 20:40:42 +02:00
parent aea93a5527
commit e3c15bd288
1388 changed files with 306946 additions and 68323 deletions

4
node_modules/mpath/test/.eslintrc.yml generated vendored Normal file
View file

@ -0,0 +1,4 @@
env:
mocha: true
rules:
no-unused-vars: off

1879
node_modules/mpath/test/index.js generated vendored Normal file

File diff suppressed because it is too large Load diff

30
node_modules/mpath/test/stringToParts.js generated vendored Normal file
View file

@ -0,0 +1,30 @@
'use strict';
const assert = require('assert');
const stringToParts = require('../lib/stringToParts');
describe('stringToParts', function() {
it('handles brackets for numbers', function() {
assert.deepEqual(stringToParts('list[0].name'), ['list', '0', 'name']);
assert.deepEqual(stringToParts('list[0][1].name'), ['list', '0', '1', 'name']);
});
it('handles dot notation', function() {
assert.deepEqual(stringToParts('a.b.c'), ['a', 'b', 'c']);
assert.deepEqual(stringToParts('a..b.d'), ['a', '', 'b', 'd']);
});
it('ignores invalid numbers in square brackets', function() {
assert.deepEqual(stringToParts('foo[1mystring]'), ['foo[1mystring]']);
assert.deepEqual(stringToParts('foo[1mystring].bar[1]'), ['foo[1mystring]', 'bar', '1']);
assert.deepEqual(stringToParts('foo[1mystring][2]'), ['foo[1mystring]', '2']);
});
it('handles empty string', function() {
assert.deepEqual(stringToParts(''), ['']);
});
it('handles trailing dot', function() {
assert.deepEqual(stringToParts('a.b.'), ['a', 'b', '']);
});
});