Last commit july 5th

This commit is contained in:
2024-07-05 13:46:23 +02:00
parent dad0d86e8c
commit b0e4dfbb76
24982 changed files with 2621219 additions and 413 deletions

24
spa/node_modules/plist/.github/workflows/ci.yml generated vendored Normal file
View File

@@ -0,0 +1,24 @@
name: ci
on:
push:
pull_request:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [ '14', '16', '18' ]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- run: npm test

4
spa/node_modules/plist/.jshintrc generated vendored Normal file
View File

@@ -0,0 +1,4 @@
{
"laxbreak": true,
"laxcomma": true
}

196
spa/node_modules/plist/History.md generated vendored Normal file
View File

@@ -0,0 +1,196 @@
3.1.0 / 2023-07-06
==================
* replace inlined xmldom with @xmldom/xmldom
3.0.5 / 2022-03-23
==================
* [[`96e2303d05`]](https://github.com/TooTallNate/plist.js/commit/96e2303d059e6be0c9e0c4773226d14b4758de52) Prototype Pollution using .parse() #114 (mario-canva)
* update browserify from 16 to 17
3.0.4 / 2021-08-27
==================
* inline xmldom@0.6.0 to eliminate security warning false positive (Mike Reinstein)
3.0.3 / 2021-08-04
==================
* update xmldom to 0.6.0 to patch critical vulnerability (Mike Reinstein)
* remove flaky saucelabs teseting badge (Mike Reinstein)
3.0.2 / 2021-03-25
==================
* update xmldom to 0.5.0 to patch critical vulnerability (Mike Reinstein)
* update saucelab credentials to point at mreinstein's saucelabs account (Mike Reinstein)
* remove a bunch of test versions from the matrix because they weren't working in zuul + sauce (Mike Reinstein)
3.0.1 / 2018-03-21
==================
* avoid using Buffer constructor nodejs/node#19079
3.0.0 / 2018-03-18
==================
* [[`cb0d8f1bc6`]](https://github.com/TooTallNate/plist.js/commit/cb0d8f1bc60dee423f8fc2cfcac427452dfaddb0) update Makefile, rebuild dist/ (Mike Reinstein)
* [[`9dfeffe73f`]](https://github.com/TooTallNate/plist.js/commit/9dfeffe73fdb447ac5a87ee364a1472975f12adf) remove unsupported browser versions from travis (Mike Reinstein)
* [[`c962bfe1ea`]](https://github.com/TooTallNate/plist.js/commit/c962bfe1ea04dd87966250253d33738bceecab61) update module deps, remove support for node < 6 (Mike Reinstein)
2.1.0 / 2017-05-04
==================
* [[`e4f06669bb`]](https://github.com/TooTallNate/plist.js/commit/e4f06669bb51d2e65654df7c39aab52bc3bf4e8a) - update license (extend copyright term) (Mike Reinstein)
* [[`edc6e41035`]](https://github.com/TooTallNate/plist.js/commit/edc6e4103546b1d7518a577e7c202c305a8abec0) - update module deps (Mike Reinstein)
* [[`85d11c48ef`](https://github.com/TooTallNate/plist.js/commit/85d11c48eff02312cbdd67f46fd8e74b0d372ca1)] - Harden test-cases and implementation to align with other implementations (Björn Brauer)
* [[`7619537eaa`]](https://github.com/TooTallNate/plist.js/commit/7619537eaa9e3e5a80829e759c004d2e017a07d2) review feedback: early returns and constants for nodeTypes (Björn Brauer)
2.0.1 / 2016-08-16
==================
* [[`de136c8388`](https://github.com/TooTallNate/plist/commit/de136c8388)] - bad npm release (Nathan Rajlich)
2.0.0 / 2016-08-16
==================
* [[`90deef5d43`](https://github.com/TooTallNate/plist/commit/90deef5d43)] - remove deprecated functions (Nathan Rajlich)
* [[`d475cd8ce9`](https://github.com/TooTallNate/plist/commit/d475cd8ce9)] - Added travis ci support for node 6 (Amila Welihinda)
* [[`04c8ee7646`](https://github.com/TooTallNate/plist/commit/04c8ee7646)] - update dependencies (Mitchell Hentges)
* [[`97c02b3f05`](https://github.com/TooTallNate/plist/commit/97c02b3f05)] - **travis**: add `sudo: false` and test more node versions (Nathan Rajlich)
* [[`54c821ec29`](https://github.com/TooTallNate/plist/commit/54c821ec29)] - #71 - fixed and added test (Andrew Goldis)
* [[`4afb7c5079`](https://github.com/TooTallNate/plist/commit/4afb7c5079)] - fix `Cannot read property 'nodeValue' of undefined exception` that is thrown when a `<key></key>` construct appears in plist (Chris Kinsman)
* [[`f360d7d685`](https://github.com/TooTallNate/plist/commit/f360d7d685)] - #66 - fixed empty keys and added tests (Andrew Goldis)
* [[`421c7f26e9`](https://github.com/TooTallNate/plist/commit/421c7f26e9)] - #66 - fixed empty key (Andrew Goldis)
* [[`a88aa4dca7`](https://github.com/TooTallNate/plist/commit/a88aa4dca7)] - add verbose examples (mrzmyr)
1.2.0 / 2015-11-10
==================
* package: update "browserify" to v12.0.1
* package: update "zuul" to v3.7.2
* package: update "xmlbuilder" to v4.0.0
* package: update "util-deprecate" to v1.0.2
* package: update "mocha" to v2.3.3
* package: update "base64-js" to v0.0.8
* build: omit undefined values
* travis: add node 4.0 and 4.1 to test matrix
1.1.0 / 2014-08-27
==================
* package: update "browserify" to v5.10.1
* package: update "zuul" to v1.10.2
* README: add "Sauce Test Status" build badge
* travis: use new "plistjs" sauce credentials
* travis: set up zuul saucelabs automated testing
1.0.1 / 2014-06-25
==================
* add .zuul.yml file for browser testing
* remove Testling stuff
* build: fix global variable `val` leak
* package: use --check-leaks when running mocha tests
* README: update examples to use preferred API
* package: add "browser" keyword
1.0.0 / 2014-05-20
==================
* package: remove "android-browser"
* test: add <dict> build() test
* test: re-add the empty string build() test
* test: remove "fixtures" and legacy "tests" dir
* test: add some more build() tests
* test: add a parse() CDATA test
* test: starting on build() tests
* test: more parse() tests
* package: attempt to fix "android-browser" testling
* parse: better <data> with newline handling
* README: add Testling badge
* test: add <data> node tests
* test: add a <date> parse() test
* travis: don't test node v0.6 or v0.8
* test: some more parse() tests
* test: add simple <string> parsing test
* build: add support for an optional "opts" object
* package: test mobile devices
* test: use multiline to inline the XML
* package: beautify
* package: fix "mocha" harness
* package: more testling browsers
* build: add the "version=1.0" attribute
* beginnings of "mocha" tests
* build: more JSDocs
* tests: add test that ensures that empty string conversion works
* build: update "xmlbuilder" to v2.2.1
* parse: ignore comment and cdata nodes
* tests: make the "Newlines" test actually contain a newline
* parse: lint
* test travis
* README: add Travis CI badge
* add .travis.yml file
* build: updated DTD to reflect name change
* parse: return falsey values in an Array plist
* build: fix encoding a typed array in the browser
* build: add support for Typed Arrays and ArrayBuffers
* build: more lint
* build: slight cleanup and optimizations
* build: use .txt() for the "date" value
* parse: always return a Buffer for <data> nodes
* build: don't interpret Strings as base64
* dist: commit prebuilt plist*.js files
* parse: fix typo in deprecate message
* parse: fix parse() return value
* parse: add jsdoc comments for the deprecated APIs
* parse: add `parse()` function
* node, parse: use `util-deprecate` module
* re-implemented parseFile to be asynchronous
* node: fix jsdoc comment
* Makefile: fix "node" require stubbing
* examples: add "browser" example
* package: tweak "main"
* package: remove "engines" field
* Makefile: fix --exclude command for browserify
* package: update "description"
* lib: more styling
* Makefile: add -build.js and -parse.js dist files
* lib: separate out the parse and build logic into their own files
* Makefile: add makefile with browserify build rules
* package: add "browserify" as a dev dependency
* plist: tabs to spaces (again)
* add a .jshintrc file
* LICENSE: update
* node-webkit support
* Ignore tests/ in .npmignore file
* Remove duplicate devDependencies key
* Remove trailing whitespace
* adding recent contributors. Bumping npm package number (patch release)
* Fixed node.js string handling
* bumping version number
* Fixed global variable plist leak
* patch release 0.4.1
* removed temporary debug output file
* flipping the cases for writing data and string elements in build(). removed the 125 length check. Added validation of base64 encoding for data fields when parsing. added unit tests.
* fixed syntax errors in README examples (issue #20)
* added Sync versions of calls. added deprecation warnings for old method calls. updated documentation. If the resulting object from parseStringSync is an array with 1 element, return just the element. If a plist string or file doesnt have a <plist> tag as the document root element, fail noisily (issue #15)
* incrementing package version
* added cross platform base64 encode/decode for data elements (issue #17.) Comments and hygiene.
* refactored the code to use a DOM parser instead of SAX. closes issues #5 and #16
* rolling up package version
* updated base64 detection regexp. updated README. hygiene.
* refactored the build function. Fixes issue #14
* refactored tests. Modified tests from issue #9. thanks @sylvinus
* upgrade xmlbuilder package version. this is why .end() was needed in last commit; breaking change to xmlbuilder lib. :/
* bug fix in build function, forgot to call .end() Refactored tests to use nodeunit
* Implemented support for real, identity tests
* Refactored base64 detection - still sloppy, fixed date building. Passing tests OK.
* Implemented basic plist builder that turns an existing JS object into plist XML. date, real and data types still need to be implemented.

24
spa/node_modules/plist/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,24 @@
(The MIT License)
Copyright (c) 2010-2017 Nathan Rajlich <nathan@tootallnate.net>
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.

75
spa/node_modules/plist/Makefile generated vendored Normal file
View File

@@ -0,0 +1,75 @@
# get Makefile directory name: http://stackoverflow.com/a/5982798/376773
THIS_MAKEFILE_PATH:=$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))
THIS_DIR:=$(shell cd $(dir $(THIS_MAKEFILE_PATH));pwd)
# BIN directory
BIN := $(THIS_DIR)/node_modules/.bin
# applications
NODE ?= node
NPM ?= $(NODE) $(shell which npm)
BROWSERIFY ?= $(NODE) $(BIN)/browserify
MOCHA ?= $(NODE) $(BIN)/mocha
ZUUL ?= $(NODE) $(BIN)/zuul
REPORTER ?= spec
all: dist/plist.js dist/plist-build.js dist/plist-parse.js
install: node_modules
clean:
@rm -rf node_modules dist
dist:
@mkdir -p $@
dist/plist-build.js: node_modules lib/build.js dist
@$(BROWSERIFY) \
--standalone plist \
lib/build.js > $@
dist/plist-parse.js: node_modules lib/parse.js dist
@$(BROWSERIFY) \
--standalone plist \
lib/parse.js > $@
dist/plist.js: node_modules lib/*.js dist
@$(BROWSERIFY) \
--standalone plist \
index.js > $@
node_modules: package.json
@NODE_ENV= $(NPM) install
@touch node_modules
test:
@if [ "x$(BROWSER_NAME)" = "x" ]; then \
$(MAKE) test-node; \
else \
$(MAKE) test-zuul; \
fi
test-node:
@$(MOCHA) \
--reporter $(REPORTER) \
test/*.js
test-zuul:
@if [ "x$(BROWSER_PLATFORM)" = "x" ]; then \
$(ZUUL) \
--ui mocha-bdd \
--browser-name $(BROWSER_NAME) \
--browser-version $(BROWSER_VERSION) \
test/*.js; \
else \
$(ZUUL) \
--ui mocha-bdd \
--browser-name $(BROWSER_NAME) \
--browser-version $(BROWSER_VERSION) \
--browser-platform "$(BROWSER_PLATFORM)" \
test/*.js; \
fi
.PHONY: all install clean test test-node test-zuul

146
spa/node_modules/plist/README.md generated vendored Normal file
View File

@@ -0,0 +1,146 @@
plist.js
========
### Apple's Property list parser/builder for Node.js and browsers
[![ci](https://github.com/TooTallNate/plist.js/actions/workflows/ci.yml/badge.svg)](https://github.com/TooTallNate/plist.js/actions/workflows/ci.yml)
Provides facilities for reading and writing Plist (property list) files.
These are often used in programming OS X and iOS applications, as well
as the iTunes configuration XML file.
Plist files represent stored programming "object"s. They are very similar
to JSON. A valid Plist file is representable as a native JavaScript Object
and vice-versa.
## Usage
### Node.js
Install using `npm`:
``` bash
$ npm install --save plist
```
Then `require()` the _plist_ module in your file:
``` js
var plist = require('plist');
// now use the `parse()` and `build()` functions
var val = plist.parse('<plist><string>Hello World!</string></plist>');
console.log(val); // "Hello World!"
```
### Browser
Include the `dist/plist.js` in a `<script>` tag in your HTML file:
``` html
<script src="plist.js"></script>
<script>
// now use the `parse()` and `build()` functions
var val = plist.parse('<plist><string>Hello World!</string></plist>');
console.log(val); // "Hello World!"
</script>
```
## API
### Parsing
Parsing a plist from filename:
``` javascript
var fs = require('fs');
var plist = require('plist');
var obj = plist.parse(fs.readFileSync('myPlist.plist', 'utf8'));
console.log(JSON.stringify(obj));
```
Parsing a plist from string payload:
``` javascript
var plist = require('plist');
var xml =
'<?xml version="1.0" encoding="UTF-8"?>' +
'<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">' +
'<plist version="1.0">' +
'<key>metadata</key>' +
'<dict>' +
'<key>bundle-identifier</key>' +
'<string>com.company.app</string>' +
'<key>bundle-version</key>' +
'<string>0.1.1</string>' +
'<key>kind</key>' +
'<string>software</string>' +
'<key>title</key>' +
'<string>AppName</string>' +
'</dict>' +
'</plist>';
console.log(plist.parse(xml));
// [
// "metadata",
// {
// "bundle-identifier": "com.company.app",
// "bundle-version": "0.1.1",
// "kind": "software",
// "title": "AppName"
// }
// ]
```
### Building
Given an existing JavaScript Object, you can turn it into an XML document
that complies with the plist DTD:
``` javascript
var plist = require('plist');
var json = [
"metadata",
{
"bundle-identifier": "com.company.app",
"bundle-version": "0.1.1",
"kind": "software",
"title": "AppName"
}
];
console.log(plist.build(json));
// <?xml version="1.0" encoding="UTF-8"?>
// <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
// <plist version="1.0">
// <key>metadata</key>
// <dict>
// <key>bundle-identifier</key>
// <string>com.company.app</string>
// <key>bundle-version</key>
// <string>0.1.1</string>
// <key>kind</key>
// <string>software</string>
// <key>title</key>
// <string>AppName</string>
// </dict>
// </plist>
```
## Cross Platform Testing Credits
Much thanks to Sauce Labs for providing free resources that enable cross-browser testing on this project!
[![Testing Powered By SauceLabs](https://opensource.saucelabs.com/images/opensauce/powered-by-saucelabs-badge-red.png?sanitize=true "Testing Powered By SauceLabs")](https://saucelabs.com)
## License
[(The MIT License)](LICENSE)

5348
spa/node_modules/plist/dist/plist-build.js generated vendored Normal file

File diff suppressed because it is too large Load Diff

7456
spa/node_modules/plist/dist/plist-parse.js generated vendored Normal file

File diff suppressed because it is too large Load Diff

9888
spa/node_modules/plist/dist/plist.js generated vendored Normal file

File diff suppressed because it is too large Load Diff

14
spa/node_modules/plist/examples/browser/index.html generated vendored Normal file
View File

@@ -0,0 +1,14 @@
<!DOCTYPE html>
<html>
<head>
<title>plist.js browser example</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<script src="../../dist/plist.js"></script>
<script>
// TODO: add <input type=file> drag and drop example
console.log(plist);
</script>
</body>
</html>

13
spa/node_modules/plist/index.js generated vendored Normal file
View File

@@ -0,0 +1,13 @@
/**
* Parser functions.
*/
var parserFunctions = require('./lib/parse');
Object.keys(parserFunctions).forEach(function (k) { exports[k] = parserFunctions[k]; });
/**
* Builder functions.
*/
var builderFunctions = require('./lib/build');
Object.keys(builderFunctions).forEach(function (k) { exports[k] = builderFunctions[k]; });

143
spa/node_modules/plist/lib/build.js generated vendored Normal file
View File

@@ -0,0 +1,143 @@
/**
* Module dependencies.
*/
var base64 = require('base64-js');
var xmlbuilder = require('xmlbuilder');
/**
* Module exports.
*/
exports.build = build;
/**
* Accepts a `Date` instance and returns an ISO date string.
*
* @param {Date} d - Date instance to serialize
* @returns {String} ISO date string representation of `d`
* @api private
*/
function ISODateString(d){
function pad(n){
return n < 10 ? '0' + n : n;
}
return d.getUTCFullYear()+'-'
+ pad(d.getUTCMonth()+1)+'-'
+ pad(d.getUTCDate())+'T'
+ pad(d.getUTCHours())+':'
+ pad(d.getUTCMinutes())+':'
+ pad(d.getUTCSeconds())+'Z';
}
/**
* Returns the internal "type" of `obj` via the
* `Object.prototype.toString()` trick.
*
* @param {Mixed} obj - any value
* @returns {String} the internal "type" name
* @api private
*/
var toString = Object.prototype.toString;
function type (obj) {
var m = toString.call(obj).match(/\[object (.*)\]/);
return m ? m[1] : m;
}
/**
* Generate an XML plist string from the input object `obj`.
*
* @param {Object} obj - the object to convert
* @param {Object} [opts] - optional options object
* @returns {String} converted plist XML string
* @api public
*/
function build (obj, opts) {
var XMLHDR = {
version: '1.0',
encoding: 'UTF-8'
};
var XMLDTD = {
pubid: '-//Apple//DTD PLIST 1.0//EN',
sysid: 'http://www.apple.com/DTDs/PropertyList-1.0.dtd'
};
var doc = xmlbuilder.create('plist');
doc.dec(XMLHDR.version, XMLHDR.encoding, XMLHDR.standalone);
doc.dtd(XMLDTD.pubid, XMLDTD.sysid);
doc.att('version', '1.0');
walk_obj(obj, doc);
if (!opts) opts = {};
// default `pretty` to `true`
opts.pretty = opts.pretty !== false;
return doc.end(opts);
}
/**
* depth first, recursive traversal of a javascript object. when complete,
* next_child contains a reference to the build XML object.
*
* @api private
*/
function walk_obj(next, next_child) {
var tag_type, i, prop;
var name = type(next);
if ('Undefined' == name) {
return;
} else if (Array.isArray(next)) {
next_child = next_child.ele('array');
for (i = 0; i < next.length; i++) {
walk_obj(next[i], next_child);
}
} else if (Buffer.isBuffer(next)) {
next_child.ele('data').raw(next.toString('base64'));
} else if ('Object' == name) {
next_child = next_child.ele('dict');
for (prop in next) {
if (next.hasOwnProperty(prop)) {
next_child.ele('key').txt(prop);
walk_obj(next[prop], next_child);
}
}
} else if ('Number' == name) {
// detect if this is an integer or real
// TODO: add an ability to force one way or another via a "cast"
tag_type = (next % 1 === 0) ? 'integer' : 'real';
next_child.ele(tag_type).txt(next.toString());
} else if ('BigInt' == name) {
next_child.ele('integer').txt(next);
} else if ('Date' == name) {
next_child.ele('date').txt(ISODateString(new Date(next)));
} else if ('Boolean' == name) {
next_child.ele(next ? 'true' : 'false');
} else if ('String' == name) {
next_child.ele('string').txt(next);
} else if ('ArrayBuffer' == name) {
next_child.ele('data').raw(base64.fromByteArray(next));
} else if (next && next.buffer && 'ArrayBuffer' == type(next.buffer)) {
// a typed array
next_child.ele('data').raw(base64.fromByteArray(new Uint8Array(next.buffer), next_child));
} else if ('Null' === name) {
next_child.ele('null').txt('');
}
}

227
spa/node_modules/plist/lib/parse.js generated vendored Normal file
View File

@@ -0,0 +1,227 @@
/**
* Module dependencies.
*/
const { DOMParser } = require('@xmldom/xmldom');
/**
* Module exports.
*/
exports.parse = parse;
var TEXT_NODE = 3;
var CDATA_NODE = 4;
var COMMENT_NODE = 8;
/**
* We ignore raw text (usually whitespace), <!-- xml comments -->,
* and raw CDATA nodes.
*
* @param {Element} node
* @returns {Boolean}
* @api private
*/
function shouldIgnoreNode (node) {
return node.nodeType === TEXT_NODE
|| node.nodeType === COMMENT_NODE
|| node.nodeType === CDATA_NODE;
}
/**
* Check if the node is empty. Some plist file has such node:
* <key />
* this node shoud be ignored.
*
* @see https://github.com/TooTallNate/plist.js/issues/66
* @param {Element} node
* @returns {Boolean}
* @api private
*/
function isEmptyNode(node){
if(!node.childNodes || node.childNodes.length === 0) {
return true;
} else {
return false;
}
}
function invariant(test, message) {
if (!test) {
throw new Error(message);
}
}
/**
* Parses a Plist XML string. Returns an Object.
*
* @param {String} xml - the XML String to decode
* @returns {Mixed} the decoded value from the Plist XML
* @api public
*/
function parse (xml) {
var doc = new DOMParser().parseFromString(xml);
invariant(
doc.documentElement.nodeName === 'plist',
'malformed document. First element should be <plist>'
);
var plist = parsePlistXML(doc.documentElement);
// the root <plist> node gets interpreted as an Array,
// so pull out the inner data first
if (plist.length == 1) plist = plist[0];
return plist;
}
/**
* Convert an XML based plist document into a JSON representation.
*
* @param {Object} xml_node - current XML node in the plist
* @returns {Mixed} built up JSON object
* @api private
*/
function parsePlistXML (node) {
var i, new_obj, key, val, new_arr, res, counter, type;
if (!node)
return null;
if (node.nodeName === 'plist') {
new_arr = [];
if (isEmptyNode(node)) {
return new_arr;
}
for (i=0; i < node.childNodes.length; i++) {
if (!shouldIgnoreNode(node.childNodes[i])) {
new_arr.push( parsePlistXML(node.childNodes[i]));
}
}
return new_arr;
} else if (node.nodeName === 'dict') {
new_obj = {};
key = null;
counter = 0;
if (isEmptyNode(node)) {
return new_obj;
}
for (i=0; i < node.childNodes.length; i++) {
if (shouldIgnoreNode(node.childNodes[i])) continue;
if (counter % 2 === 0) {
invariant(
node.childNodes[i].nodeName === 'key',
'Missing key while parsing <dict/>.'
);
key = parsePlistXML(node.childNodes[i]);
} else {
invariant(
node.childNodes[i].nodeName !== 'key',
'Unexpected key "'
+ parsePlistXML(node.childNodes[i])
+ '" while parsing <dict/>.'
);
new_obj[key] = parsePlistXML(node.childNodes[i]);
}
counter += 1;
}
if (counter % 2 === 1) {
new_obj[key] = '';
}
return new_obj;
} else if (node.nodeName === 'array') {
new_arr = [];
if (isEmptyNode(node)) {
return new_arr;
}
for (i=0; i < node.childNodes.length; i++) {
if (!shouldIgnoreNode(node.childNodes[i])) {
res = parsePlistXML(node.childNodes[i]);
if (null != res) new_arr.push(res);
}
}
return new_arr;
} else if (node.nodeName === '#text') {
// TODO: what should we do with text types? (CDATA sections)
} else if (node.nodeName === 'key') {
if (isEmptyNode(node)) {
return '';
}
invariant(
node.childNodes[0].nodeValue !== '__proto__',
'__proto__ keys can lead to prototype pollution. More details on CVE-2022-22912'
);
return node.childNodes[0].nodeValue;
} else if (node.nodeName === 'string') {
res = '';
if (isEmptyNode(node)) {
return res;
}
for (i=0; i < node.childNodes.length; i++) {
var type = node.childNodes[i].nodeType;
if (type === TEXT_NODE || type === CDATA_NODE) {
res += node.childNodes[i].nodeValue;
}
}
return res;
} else if (node.nodeName === 'integer') {
invariant(
!isEmptyNode(node),
'Cannot parse "" as integer.'
);
return parseInt(node.childNodes[0].nodeValue, 10);
} else if (node.nodeName === 'real') {
invariant(
!isEmptyNode(node),
'Cannot parse "" as real.'
);
res = '';
for (i=0; i < node.childNodes.length; i++) {
if (node.childNodes[i].nodeType === TEXT_NODE) {
res += node.childNodes[i].nodeValue;
}
}
return parseFloat(res);
} else if (node.nodeName === 'data') {
res = '';
if (isEmptyNode(node)) {
return Buffer.from(res, 'base64');
}
for (i=0; i < node.childNodes.length; i++) {
if (node.childNodes[i].nodeType === TEXT_NODE) {
res += node.childNodes[i].nodeValue.replace(/\s+/g, '');
}
}
return Buffer.from(res, 'base64');
} else if (node.nodeName === 'date') {
invariant(
!isEmptyNode(node),
'Cannot parse "" as Date.'
)
return new Date(node.childNodes[0].nodeValue);
} else if (node.nodeName === 'null') {
return null;
} else if (node.nodeName === 'true') {
return true;
} else if (node.nodeName === 'false') {
return false;
} else {
throw new Error('Invalid PLIST tag ' + node.nodeName);
}
}

44
spa/node_modules/plist/package.json generated vendored Normal file
View File

@@ -0,0 +1,44 @@
{
"name": "plist",
"description": "Apple's property list parser/builder for Node.js and browsers",
"version": "3.1.0",
"author": "Nathan Rajlich <nathan@tootallnate.net>",
"contributors": [
"Hans Huebner <hans.huebner@gmail.com>",
"Pierre Metrailler",
"Mike Reinstein <reinstein.mike@gmail.com>",
"Vladimir Tsvang",
"Mathieu D'Amours"
],
"repository": {
"type": "git",
"url": "git://github.com/TooTallNate/node-plist.git"
},
"license": "MIT",
"keywords": [
"apple",
"browser",
"mac",
"plist",
"parser",
"xml"
],
"main": "index.js",
"dependencies": {
"@xmldom/xmldom": "^0.8.8",
"base64-js": "^1.5.1",
"xmlbuilder": "^15.1.1"
},
"devDependencies": {
"browserify": "^17.0.0",
"mocha": "^9.2.2",
"multiline": "^2.0.0",
"zuul": "3.12.0"
},
"scripts": {
"test": "make test"
},
"engines": {
"node": ">=10.4.0"
}
}