Initial
This commit is contained in:
26
resources/app/node_modules/fast-json-stable-stringify/.eslintrc.yml
generated
vendored
Normal file
26
resources/app/node_modules/fast-json-stable-stringify/.eslintrc.yml
generated
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
extends: eslint:recommended
|
||||
env:
|
||||
node: true
|
||||
browser: true
|
||||
rules:
|
||||
block-scoped-var: 2
|
||||
callback-return: 2
|
||||
dot-notation: 2
|
||||
indent: 2
|
||||
linebreak-style: [2, unix]
|
||||
new-cap: 2
|
||||
no-console: [2, allow: [warn, error]]
|
||||
no-else-return: 2
|
||||
no-eq-null: 2
|
||||
no-fallthrough: 2
|
||||
no-invalid-this: 2
|
||||
no-return-assign: 2
|
||||
no-shadow: 1
|
||||
no-trailing-spaces: 2
|
||||
no-use-before-define: [2, nofunc]
|
||||
quotes: [2, single, avoid-escape]
|
||||
semi: [2, always]
|
||||
strict: [2, global]
|
||||
valid-jsdoc: [2, requireReturn: false]
|
||||
no-control-regex: 0
|
||||
no-useless-escape: 2
|
||||
21
resources/app/node_modules/fast-json-stable-stringify/LICENSE
generated
vendored
Normal file
21
resources/app/node_modules/fast-json-stable-stringify/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
This software is released under the MIT license:
|
||||
|
||||
Copyright (c) 2017 Evgeny Poberezkin
|
||||
Copyright (c) 2013 James Halliday
|
||||
|
||||
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.
|
||||
31
resources/app/node_modules/fast-json-stable-stringify/benchmark/index.js
generated
vendored
Normal file
31
resources/app/node_modules/fast-json-stable-stringify/benchmark/index.js
generated
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
'use strict';
|
||||
|
||||
const Benchmark = require('benchmark');
|
||||
const suite = new Benchmark.Suite;
|
||||
const testData = require('./test.json');
|
||||
|
||||
|
||||
const stringifyPackages = {
|
||||
// 'JSON.stringify': JSON.stringify,
|
||||
'fast-json-stable-stringify': require('../index'),
|
||||
'json-stable-stringify': true,
|
||||
'fast-stable-stringify': true,
|
||||
'faster-stable-stringify': true
|
||||
};
|
||||
|
||||
|
||||
for (const name in stringifyPackages) {
|
||||
let func = stringifyPackages[name];
|
||||
if (func === true) func = require(name);
|
||||
|
||||
suite.add(name, function() {
|
||||
func(testData);
|
||||
});
|
||||
}
|
||||
|
||||
suite
|
||||
.on('cycle', (event) => console.log(String(event.target)))
|
||||
.on('complete', function () {
|
||||
console.log('The fastest is ' + this.filter('fastest').map('name'));
|
||||
})
|
||||
.run({async: true});
|
||||
137
resources/app/node_modules/fast-json-stable-stringify/benchmark/test.json
generated
vendored
Normal file
137
resources/app/node_modules/fast-json-stable-stringify/benchmark/test.json
generated
vendored
Normal file
@@ -0,0 +1,137 @@
|
||||
[
|
||||
{
|
||||
"_id": "59ef4a83ee8364808d761beb",
|
||||
"index": 0,
|
||||
"guid": "e50ffae9-7128-4148-9ee5-40c3fc523c5d",
|
||||
"isActive": false,
|
||||
"balance": "$2,341.81",
|
||||
"picture": "http://placehold.it/32x32",
|
||||
"age": 28,
|
||||
"eyeColor": "brown",
|
||||
"name": "Carey Savage",
|
||||
"gender": "female",
|
||||
"company": "VERAQ",
|
||||
"email": "careysavage@veraq.com",
|
||||
"phone": "+1 (897) 574-3014",
|
||||
"address": "458 Willow Street, Henrietta, California, 7234",
|
||||
"about": "Nisi reprehenderit nulla ad officia pariatur non dolore laboris irure cupidatat laborum. Minim eu ex Lorem adipisicing exercitation irure minim sunt est enim mollit incididunt voluptate nulla. Ut mollit anim reprehenderit et aliqua ex esse aliquip. Aute sit duis deserunt do incididunt consequat minim qui dolor commodo deserunt et voluptate.\r\n",
|
||||
"registered": "2014-05-21T01:56:51 -01:00",
|
||||
"latitude": 63.89502,
|
||||
"longitude": 62.369807,
|
||||
"tags": [
|
||||
"nostrud",
|
||||
"nisi",
|
||||
"consectetur",
|
||||
"ullamco",
|
||||
"cupidatat",
|
||||
"culpa",
|
||||
"commodo"
|
||||
],
|
||||
"friends": [
|
||||
{
|
||||
"id": 0,
|
||||
"name": "Henry Walls"
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"name": "Janice Baker"
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"name": "Russell Bush"
|
||||
}
|
||||
],
|
||||
"greeting": "Hello, Carey Savage! You have 4 unread messages.",
|
||||
"favoriteFruit": "banana"
|
||||
},
|
||||
{
|
||||
"_id": "59ef4a83ff5774a691454e89",
|
||||
"index": 1,
|
||||
"guid": "2bee9efc-4095-4c2e-87ef-d08c8054c89d",
|
||||
"isActive": true,
|
||||
"balance": "$1,618.15",
|
||||
"picture": "http://placehold.it/32x32",
|
||||
"age": 35,
|
||||
"eyeColor": "blue",
|
||||
"name": "Elinor Pearson",
|
||||
"gender": "female",
|
||||
"company": "FLEXIGEN",
|
||||
"email": "elinorpearson@flexigen.com",
|
||||
"phone": "+1 (923) 548-3751",
|
||||
"address": "600 Bayview Avenue, Draper, Montana, 3088",
|
||||
"about": "Mollit commodo ea sit Lorem velit. Irure anim esse Lorem sint quis officia ut. Aliqua nisi dolore in aute deserunt mollit ex ea in mollit.\r\n",
|
||||
"registered": "2017-04-22T07:58:41 -01:00",
|
||||
"latitude": -87.824919,
|
||||
"longitude": 69.538927,
|
||||
"tags": [
|
||||
"fugiat",
|
||||
"labore",
|
||||
"proident",
|
||||
"quis",
|
||||
"eiusmod",
|
||||
"qui",
|
||||
"est"
|
||||
],
|
||||
"friends": [
|
||||
{
|
||||
"id": 0,
|
||||
"name": "Massey Wagner"
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"name": "Marcella Ferrell"
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"name": "Evans Mckee"
|
||||
}
|
||||
],
|
||||
"greeting": "Hello, Elinor Pearson! You have 3 unread messages.",
|
||||
"favoriteFruit": "strawberry"
|
||||
},
|
||||
{
|
||||
"_id": "59ef4a839ec8a4be4430b36b",
|
||||
"index": 2,
|
||||
"guid": "ddd6e8c0-95bd-416d-8b46-a768d6363809",
|
||||
"isActive": false,
|
||||
"balance": "$2,046.95",
|
||||
"picture": "http://placehold.it/32x32",
|
||||
"age": 40,
|
||||
"eyeColor": "green",
|
||||
"name": "Irwin Davidson",
|
||||
"gender": "male",
|
||||
"company": "DANJA",
|
||||
"email": "irwindavidson@danja.com",
|
||||
"phone": "+1 (883) 537-2041",
|
||||
"address": "439 Cook Street, Chapin, Kentucky, 7398",
|
||||
"about": "Irure velit non commodo aliqua exercitation ut nostrud minim magna. Dolor ad ad ut irure eu. Non pariatur dolor eiusmod ipsum do et exercitation cillum. Et amet laboris minim eiusmod ullamco magna ea reprehenderit proident sunt.\r\n",
|
||||
"registered": "2016-09-01T07:49:08 -01:00",
|
||||
"latitude": -49.803812,
|
||||
"longitude": 104.93279,
|
||||
"tags": [
|
||||
"consequat",
|
||||
"enim",
|
||||
"quis",
|
||||
"magna",
|
||||
"est",
|
||||
"culpa",
|
||||
"tempor"
|
||||
],
|
||||
"friends": [
|
||||
{
|
||||
"id": 0,
|
||||
"name": "Ruth Hansen"
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"name": "Kathrine Austin"
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"name": "Rivera Munoz"
|
||||
}
|
||||
],
|
||||
"greeting": "Hello, Irwin Davidson! You have 2 unread messages.",
|
||||
"favoriteFruit": "banana"
|
||||
}
|
||||
]
|
||||
59
resources/app/node_modules/fast-json-stable-stringify/index.js
generated
vendored
Normal file
59
resources/app/node_modules/fast-json-stable-stringify/index.js
generated
vendored
Normal file
@@ -0,0 +1,59 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = function (data, opts) {
|
||||
if (!opts) opts = {};
|
||||
if (typeof opts === 'function') opts = { cmp: opts };
|
||||
var cycles = (typeof opts.cycles === 'boolean') ? opts.cycles : false;
|
||||
|
||||
var cmp = opts.cmp && (function (f) {
|
||||
return function (node) {
|
||||
return function (a, b) {
|
||||
var aobj = { key: a, value: node[a] };
|
||||
var bobj = { key: b, value: node[b] };
|
||||
return f(aobj, bobj);
|
||||
};
|
||||
};
|
||||
})(opts.cmp);
|
||||
|
||||
var seen = [];
|
||||
return (function stringify (node) {
|
||||
if (node && node.toJSON && typeof node.toJSON === 'function') {
|
||||
node = node.toJSON();
|
||||
}
|
||||
|
||||
if (node === undefined) return;
|
||||
if (typeof node == 'number') return isFinite(node) ? '' + node : 'null';
|
||||
if (typeof node !== 'object') return JSON.stringify(node);
|
||||
|
||||
var i, out;
|
||||
if (Array.isArray(node)) {
|
||||
out = '[';
|
||||
for (i = 0; i < node.length; i++) {
|
||||
if (i) out += ',';
|
||||
out += stringify(node[i]) || 'null';
|
||||
}
|
||||
return out + ']';
|
||||
}
|
||||
|
||||
if (node === null) return 'null';
|
||||
|
||||
if (seen.indexOf(node) !== -1) {
|
||||
if (cycles) return JSON.stringify('__cycle__');
|
||||
throw new TypeError('Converting circular structure to JSON');
|
||||
}
|
||||
|
||||
var seenIndex = seen.push(node) - 1;
|
||||
var keys = Object.keys(node).sort(cmp && cmp(node));
|
||||
out = '';
|
||||
for (i = 0; i < keys.length; i++) {
|
||||
var key = keys[i];
|
||||
var value = stringify(node[key]);
|
||||
|
||||
if (!value) continue;
|
||||
if (out) out += ',';
|
||||
out += JSON.stringify(key) + ':' + value;
|
||||
}
|
||||
seen.splice(seenIndex, 1);
|
||||
return '{' + out + '}';
|
||||
})(data);
|
||||
};
|
||||
30
resources/app/node_modules/fast-json-stable-stringify/package.json
generated
vendored
Normal file
30
resources/app/node_modules/fast-json-stable-stringify/package.json
generated
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
{
|
||||
"name": "fast-json-stable-stringify",
|
||||
"version": "2.1.0",
|
||||
"description": "deterministic `JSON.stringify()` - a faster version of substack's json-stable-strigify without jsonify",
|
||||
"main": "index.js",
|
||||
"types": "index.d.ts",
|
||||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"benchmark": "^2.1.4",
|
||||
"coveralls": "^3.0.0",
|
||||
"eslint": "^6.7.0",
|
||||
"fast-stable-stringify": "latest",
|
||||
"faster-stable-stringify": "latest",
|
||||
"json-stable-stringify": "latest",
|
||||
"nyc": "^14.1.0",
|
||||
"pre-commit": "^1.2.2",
|
||||
"tape": "^4.11.0"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/epoberezkin/fast-json-stable-stringify.git"
|
||||
},
|
||||
"homepage": "https://github.com/epoberezkin/fast-json-stable-stringify",
|
||||
"author": {
|
||||
"name": "James Halliday",
|
||||
"email": "mail@substack.net",
|
||||
"url": "http://substack.net"
|
||||
},
|
||||
"license": "MIT"
|
||||
}
|
||||
Reference in New Issue
Block a user