v1.0 with SW PWA enabled
This commit is contained in:
21
frontend/node_modules/jsonpointer/LICENSE.md
generated
vendored
Normal file
21
frontend/node_modules/jsonpointer/LICENSE.md
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2011-2015 Jan Lehnardt <jan@apache.org> & Marc Bachmann <https://github.com/marcbachmann>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
45
frontend/node_modules/jsonpointer/README.md
generated
vendored
Normal file
45
frontend/node_modules/jsonpointer/README.md
generated
vendored
Normal file
@ -0,0 +1,45 @@
|
||||
# JSON Pointer for Node.js
|
||||
|
||||
This is an implementation of [JSON Pointer](https://tools.ietf.org/html/rfc6901).
|
||||
|
||||
## CLI
|
||||
|
||||
Looking to filter JSON from the command line? Check out [jsonpointer-cli](https://github.com/joeyespo/jsonpointer-cli).
|
||||
|
||||
## Usage
|
||||
```javascript
|
||||
var jsonpointer = require('jsonpointer');
|
||||
var obj = { foo: 1, bar: { baz: 2}, qux: [3, 4, 5]};
|
||||
|
||||
jsonpointer.get(obj, '/foo'); // returns 1
|
||||
jsonpointer.get(obj, '/bar/baz'); // returns 2
|
||||
jsonpointer.get(obj, '/qux/0'); // returns 3
|
||||
jsonpointer.get(obj, '/qux/1'); // returns 4
|
||||
jsonpointer.get(obj, '/qux/2'); // returns 5
|
||||
jsonpointer.get(obj, '/quo'); // returns undefined
|
||||
|
||||
jsonpointer.set(obj, '/foo', 6); // sets obj.foo = 6;
|
||||
jsonpointer.set(obj, '/qux/-', 6) // sets obj.qux = [3, 4, 5, 6]
|
||||
|
||||
var pointer = jsonpointer.compile('/foo')
|
||||
pointer.get(obj) // returns 1
|
||||
pointer.set(obj, 1) // sets obj.foo = 1
|
||||
```
|
||||
|
||||
## Testing
|
||||
|
||||
$ npm test
|
||||
All tests pass.
|
||||
$
|
||||
|
||||
[](https://github.com/janl/node-jsonpointer/actions/workflows/node.js.yml)
|
||||
|
||||
## Author
|
||||
|
||||
(c) 2011-2021 Jan Lehnardt <jan@apache.org> & Marc Bachmann <https://github.com/marcbachmann>
|
||||
|
||||
Thanks to all contributors.
|
||||
|
||||
## License
|
||||
|
||||
MIT License.
|
||||
35
frontend/node_modules/jsonpointer/jsonpointer.d.ts
generated
vendored
Normal file
35
frontend/node_modules/jsonpointer/jsonpointer.d.ts
generated
vendored
Normal file
@ -0,0 +1,35 @@
|
||||
interface JSONPointer {
|
||||
/**
|
||||
* Looks up a JSON pointer in an object
|
||||
*/
|
||||
get(object: Object): any;
|
||||
|
||||
|
||||
/**
|
||||
* Set a value for a JSON pointer on object
|
||||
*/
|
||||
set(object: Object, value: any): void;
|
||||
}
|
||||
|
||||
|
||||
declare namespace JSONPointer {
|
||||
/**
|
||||
* Looks up a JSON pointer in an object
|
||||
*/
|
||||
function get(object: Object, pointer: string): any;
|
||||
|
||||
|
||||
/**
|
||||
* Set a value for a JSON pointer on object
|
||||
*/
|
||||
function set(object: Object, pointer: string, value: any): void;
|
||||
|
||||
|
||||
/**
|
||||
* Builds a JSONPointer instance from a pointer value.
|
||||
*/
|
||||
function compile(pointer: string): JSONPointer;
|
||||
}
|
||||
|
||||
|
||||
export = JSONPointer;
|
||||
100
frontend/node_modules/jsonpointer/jsonpointer.js
generated
vendored
Normal file
100
frontend/node_modules/jsonpointer/jsonpointer.js
generated
vendored
Normal file
@ -0,0 +1,100 @@
|
||||
var hasExcape = /~/
|
||||
var escapeMatcher = /~[01]/g
|
||||
function escapeReplacer (m) {
|
||||
switch (m) {
|
||||
case '~1': return '/'
|
||||
case '~0': return '~'
|
||||
}
|
||||
throw new Error('Invalid tilde escape: ' + m)
|
||||
}
|
||||
|
||||
function untilde (str) {
|
||||
if (!hasExcape.test(str)) return str
|
||||
return str.replace(escapeMatcher, escapeReplacer)
|
||||
}
|
||||
|
||||
function setter (obj, pointer, value) {
|
||||
var part
|
||||
var hasNextPart
|
||||
|
||||
for (var p = 1, len = pointer.length; p < len;) {
|
||||
if (pointer[p] === 'constructor' || pointer[p] === 'prototype' || pointer[p] === '__proto__') return obj
|
||||
|
||||
part = untilde(pointer[p++])
|
||||
hasNextPart = len > p
|
||||
|
||||
if (typeof obj[part] === 'undefined') {
|
||||
// support setting of /-
|
||||
if (Array.isArray(obj) && part === '-') {
|
||||
part = obj.length
|
||||
}
|
||||
|
||||
// support nested objects/array when setting values
|
||||
if (hasNextPart) {
|
||||
if ((pointer[p] !== '' && pointer[p] < Infinity) || pointer[p] === '-') obj[part] = []
|
||||
else obj[part] = {}
|
||||
}
|
||||
}
|
||||
|
||||
if (!hasNextPart) break
|
||||
obj = obj[part]
|
||||
}
|
||||
|
||||
var oldValue = obj[part]
|
||||
if (value === undefined) delete obj[part]
|
||||
else obj[part] = value
|
||||
return oldValue
|
||||
}
|
||||
|
||||
function compilePointer (pointer) {
|
||||
if (typeof pointer === 'string') {
|
||||
pointer = pointer.split('/')
|
||||
if (pointer[0] === '') return pointer
|
||||
throw new Error('Invalid JSON pointer.')
|
||||
} else if (Array.isArray(pointer)) {
|
||||
for (const part of pointer) {
|
||||
if (typeof part !== 'string' && typeof part !== 'number') {
|
||||
throw new Error('Invalid JSON pointer. Must be of type string or number.')
|
||||
}
|
||||
}
|
||||
return pointer
|
||||
}
|
||||
|
||||
throw new Error('Invalid JSON pointer.')
|
||||
}
|
||||
|
||||
function get (obj, pointer) {
|
||||
if (typeof obj !== 'object') throw new Error('Invalid input object.')
|
||||
pointer = compilePointer(pointer)
|
||||
var len = pointer.length
|
||||
if (len === 1) return obj
|
||||
|
||||
for (var p = 1; p < len;) {
|
||||
obj = obj[untilde(pointer[p++])]
|
||||
if (len === p) return obj
|
||||
if (typeof obj !== 'object' || obj === null) return undefined
|
||||
}
|
||||
}
|
||||
|
||||
function set (obj, pointer, value) {
|
||||
if (typeof obj !== 'object') throw new Error('Invalid input object.')
|
||||
pointer = compilePointer(pointer)
|
||||
if (pointer.length === 0) throw new Error('Invalid JSON pointer for set.')
|
||||
return setter(obj, pointer, value)
|
||||
}
|
||||
|
||||
function compile (pointer) {
|
||||
var compiled = compilePointer(pointer)
|
||||
return {
|
||||
get: function (object) {
|
||||
return get(object, compiled)
|
||||
},
|
||||
set: function (object, value) {
|
||||
return set(object, compiled, value)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
exports.get = get
|
||||
exports.set = set
|
||||
exports.compile = compile
|
||||
48
frontend/node_modules/jsonpointer/package.json
generated
vendored
Normal file
48
frontend/node_modules/jsonpointer/package.json
generated
vendored
Normal file
@ -0,0 +1,48 @@
|
||||
{
|
||||
"name": "jsonpointer",
|
||||
"description": "Simple JSON Addressing.",
|
||||
"tags": [
|
||||
"util",
|
||||
"simple",
|
||||
"util",
|
||||
"utility"
|
||||
],
|
||||
"version": "5.0.1",
|
||||
"author": "Jan Lehnardt <jan@apache.org>",
|
||||
"contributors": [
|
||||
"Joe Hildebrand <joe-github@cursive.net>",
|
||||
"Marc Bachmann <marc.brookman@gmail.com>"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/janl/node-jsonpointer.git"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "http://github.com/janl/node-jsonpointer/issues"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
},
|
||||
"main": "./jsonpointer",
|
||||
"typings": "jsonpointer.d.ts",
|
||||
"files": [
|
||||
"jsonpointer.js",
|
||||
"jsonpointer.d.ts"
|
||||
],
|
||||
"scripts": {
|
||||
"test": "npm run test:standard && npm run test:all",
|
||||
"test:standard": "standard",
|
||||
"test:all": "node test.js",
|
||||
"semantic-release": "semantic-release pre && npm publish && semantic-release post"
|
||||
},
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"semantic-release": "^18.0.0",
|
||||
"standard": "^16.0.4"
|
||||
},
|
||||
"standard": {
|
||||
"ignore": [
|
||||
"test.js"
|
||||
]
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user