new license file version [CI SKIP]

This commit is contained in:
2023-03-15 12:34:41 +00:00
parent 0a6d92a1f3
commit 61328d20ed
13115 changed files with 1892314 additions and 1 deletions

View File

@@ -0,0 +1 @@
{"name":"statuses","version":"2.0.1","files":{"LICENSE":{"checkedAt":1678883672342,"integrity":"sha512-XMak2Jpdyxqd52W8dLdmy4u4BxinqJrtvcP3uYH9wv+rc4Lus/HKFa+Ira0yMsecQwlK0Vsh3b6HJDwWQ64GQQ==","mode":438,"size":1172},"index.js":{"checkedAt":1678883672342,"integrity":"sha512-aI6zDw0o8WVBWhiIKDtHPEA9I7oJqtHE/vlIDXAJozUmSMTCt6oqrab6CEI84YHpgVeqx4JaKQ90Q06oRI8fWw==","mode":438,"size":2610},"codes.json":{"checkedAt":1678883672342,"integrity":"sha512-s2xuaVImLfWFVXsIoBKSrtOsR0Y0yUnahFfPmdcLIQYEx14RrsW++FCyDweD5sEo1fRRP0+SxxeRdSxgEcSi0g==","mode":438,"size":1789},"package.json":{"checkedAt":1678883672342,"integrity":"sha512-i69KB3WG78Vxs7MsZN/eiioK607OqR4Bb/luQAUcDeTmwJzbjAcRonMadxINms6sC/IHfQ4U4ohT/vkNUSq2IA==","mode":438,"size":1440},"HISTORY.md":{"checkedAt":1678883672342,"integrity":"sha512-evOAvtlhUSD2nvWxt37Dsv0oe6JL0u509kyl9xWDXG9pMWVXDadVKf+rgnUNcRXfm4ThDX/ZWQY6l0tt2Rk9DQ==","mode":438,"size":1546},"README.md":{"checkedAt":1678883672368,"integrity":"sha512-6htWAGbWYEc84F2qlLpm84Mp2B1EPyOh2Y+2NmrA8Rs1H6CPhIsasqZ468NDItL/zJGORKyGF1XiQ3te41cNbw==","mode":438,"size":3559}}}

View File

@@ -0,0 +1,3 @@
'use strict';
module.exports = require('./async').mapValuesLimit;

View File

@@ -0,0 +1 @@
{"version":3,"file":"CanonicalizeLocaleList.d.ts","sourceRoot":"","sources":["../../../../../../../packages/intl-localematcher/abstract/CanonicalizeLocaleList.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,MAAM,EAAE,CAG5E"}

View File

@@ -0,0 +1,29 @@
{
"name": "inherits",
"description": "Browser-friendly inheritance fully compatible with standard node.js inherits()",
"version": "2.0.4",
"keywords": [
"inheritance",
"class",
"klass",
"oop",
"object-oriented",
"inherits",
"browser",
"browserify"
],
"main": "./inherits.js",
"browser": "./inherits_browser.js",
"repository": "git://github.com/isaacs/inherits",
"license": "ISC",
"scripts": {
"test": "tap"
},
"devDependencies": {
"tap": "^14.2.4"
},
"files": [
"inherits.js",
"inherits_browser.js"
]
}

View File

@@ -0,0 +1,6 @@
export type ResponseUserGroup = {
name: string;
description?: string;
permissions?: Array<any>;
id: number;
};

View File

@@ -0,0 +1,8 @@
import parser from 'postcss-selector-parser'
import escapeCommas from './escapeCommas'
export default function escapeClassName(className) {
let node = parser.className()
node.value = className
return escapeCommas(node?.raws?.value ?? node.value)
}

View File

@@ -0,0 +1,78 @@
'use strict';
var test = require('tape');
var getSideChannel = require('../');
test('export', function (t) {
t.equal(typeof getSideChannel, 'function', 'is a function');
t.equal(getSideChannel.length, 0, 'takes no arguments');
var channel = getSideChannel();
t.ok(channel, 'is truthy');
t.equal(typeof channel, 'object', 'is an object');
t.end();
});
test('assert', function (t) {
var channel = getSideChannel();
t['throws'](
function () { channel.assert({}); },
TypeError,
'nonexistent value throws'
);
var o = {};
channel.set(o, 'data');
t.doesNotThrow(function () { channel.assert(o); }, 'existent value noops');
t.end();
});
test('has', function (t) {
var channel = getSideChannel();
var o = [];
t.equal(channel.has(o), false, 'nonexistent value yields false');
channel.set(o, 'foo');
t.equal(channel.has(o), true, 'existent value yields true');
t.end();
});
test('get', function (t) {
var channel = getSideChannel();
var o = {};
t.equal(channel.get(o), undefined, 'nonexistent value yields undefined');
var data = {};
channel.set(o, data);
t.equal(channel.get(o), data, '"get" yields data set by "set"');
t.end();
});
test('set', function (t) {
var channel = getSideChannel();
var o = function () {};
t.equal(channel.get(o), undefined, 'value not set');
channel.set(o, 42);
t.equal(channel.get(o), 42, 'value was set');
channel.set(o, Infinity);
t.equal(channel.get(o), Infinity, 'value was set again');
var o2 = {};
channel.set(o2, 17);
t.equal(channel.get(o), Infinity, 'o is not modified');
t.equal(channel.get(o2), 17, 'o2 is set');
channel.set(o, 14);
t.equal(channel.get(o), 14, 'o is modified');
t.equal(channel.get(o2), 17, 'o2 is not modified');
t.end();
});

View File

@@ -0,0 +1,153 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for csv2json/src/ProcessorLocal.test.ts</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="../../prettify.css" />
<link rel="stylesheet" href="../../base.css" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(../../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1>
<a href="../../index.html">All files</a> / <a href="index.html">csv2json/src</a> ProcessorLocal.test.ts
</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Statements</span>
<span class='fraction'>23/23</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Branches</span>
<span class='fraction'>0/0</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Functions</span>
<span class='fraction'>3/3</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Lines</span>
<span class='fraction'>21/21</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
</div>
<div class='status-line high'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
<a name='L2'></a><a href='#L2'>2</a>
<a name='L3'></a><a href='#L3'>3</a>
<a name='L4'></a><a href='#L4'>4</a>
<a name='L5'></a><a href='#L5'>5</a>
<a name='L6'></a><a href='#L6'>6</a>
<a name='L7'></a><a href='#L7'>7</a>
<a name='L8'></a><a href='#L8'>8</a>
<a name='L9'></a><a href='#L9'>9</a>
<a name='L10'></a><a href='#L10'>10</a>
<a name='L11'></a><a href='#L11'>11</a>
<a name='L12'></a><a href='#L12'>12</a>
<a name='L13'></a><a href='#L13'>13</a>
<a name='L14'></a><a href='#L14'>14</a>
<a name='L15'></a><a href='#L15'>15</a>
<a name='L16'></a><a href='#L16'>16</a>
<a name='L17'></a><a href='#L17'>17</a>
<a name='L18'></a><a href='#L18'>18</a>
<a name='L19'></a><a href='#L19'>19</a>
<a name='L20'></a><a href='#L20'>20</a>
<a name='L21'></a><a href='#L21'>21</a>
<a name='L22'></a><a href='#L22'>22</a>
<a name='L23'></a><a href='#L23'>23</a>
<a name='L24'></a><a href='#L24'>24</a>
<a name='L25'></a><a href='#L25'>25</a>
<a name='L26'></a><a href='#L26'>26</a>
<a name='L27'></a><a href='#L27'>27</a>
<a name='L28'></a><a href='#L28'>28</a>
<a name='L29'></a><a href='#L29'>29</a></td><td class="line-coverage quiet"><span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">import {ProcessorLocal} from "./ProcessorLocal";
import { Converter } from "./Converter";
import P from "bluebird";
import {readFileSync} from "fs";
import path from "path";
import assert from "assert";
import { JSONResult } from "./lineToJson";
const dataDir=path.join(__dirname,"../test/data/");
describe("ProcessLocal",()=&gt;{
it ("should process csv chunks and output json",async function (){
const processor=new ProcessorLocal(new Converter());
const data=readFileSync(dataDir+"/complexJSONCSV");
const lines=await processor.process(data);
assert(lines.length === 2);
const line0=lines[0] as JSONResult;
assert.equal(line0.fieldA.title,"Food Factory");
assert.equal(line0.fieldA.children.length,2);
assert.equal(line0.fieldA.children[1].employee[0].name,"Tim");
})
it ("should process csv chunks and output csv rows",async function (){
const processor=new ProcessorLocal(new Converter({output:"line"}));
const data=readFileSync(dataDir+"/complexJSONCSV");
const lines=await processor.process(data);
assert(lines.length === 2);
})
})
&nbsp;
&nbsp;</pre></td></tr>
</table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at Fri May 11 2018 21:20:20 GMT+0100 (IST)
</div>
</div>
<script src="../../prettify.js"></script>
<script>
window.onload = function () {
if (typeof prettyPrint === 'function') {
prettyPrint();
}
};
</script>
<script src="../../sorter.js"></script>
<script src="../../block-navigation.js"></script>
</body>
</html>

View File

@@ -0,0 +1,3 @@
export declare function is_void(name: string): boolean;
export declare function is_html(name: string): boolean;
export declare function is_svg(name: string): boolean;

View File

@@ -0,0 +1,4 @@
export type RunnerOrganizationHasTeamsError = {
name: string;
message: string;
};

View File

@@ -0,0 +1,18 @@
'use strict';
var GetIntrinsic = require('get-intrinsic');
var $String = GetIntrinsic('%String%');
var $TypeError = GetIntrinsic('%TypeError%');
var Type = require('../Type');
// https://262.ecma-international.org/11.0/#sec-numeric-types-number-tostring
module.exports = function NumberToString(x) {
if (Type(x) !== 'Number') {
throw new $TypeError('Assertion failed: `x` must be a Number');
}
return $String(x);
};

View File

@@ -0,0 +1,28 @@
'use strict';
var $TypeError = TypeError;
// eslint-disable-next-line consistent-return
module.exports = function iterateIterator(iterator) {
if (!iterator || typeof iterator.next !== 'function') {
throw new $TypeError('iterator must be an object with a `next` method');
}
if (arguments.length > 1) {
var callback = arguments[1];
if (typeof callback !== 'function') {
throw new $TypeError('`callback`, if provided, must be a function');
}
}
var values = callback || [];
var result;
while ((result = iterator.next()) && !result.done) {
if (callback) {
callback(result.value); // eslint-disable-line callback-return
} else {
values.push(result.value);
}
}
if (!callback) {
return values;
}
};

View File

@@ -0,0 +1,30 @@
{
"name": "globrex",
"version": "0.1.2",
"description": "Glob to regular expression with support for extended globs",
"main": "index.js",
"author": "Terkel Gjervig",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/terkelg/globrex"
},
"files": [
"index.js"
],
"keywords": [
"glob",
"regex",
"regexp",
"parser",
"glob2regx",
"compiler"
],
"scripts": {
"test": "tape test/*.js | tap-spec"
},
"devDependencies": {
"tap-spec": "^4.1.1",
"tape": "^4.8.0"
}
}

View File

@@ -0,0 +1 @@
{"name":"source-map-js","version":"1.0.2","files":{"LICENSE":{"checkedAt":1678883669496,"integrity":"sha512-a4quda6qIVBUjYbx8AJc7J3bx9+jwfUeh96Hch7GTvMbYNorBIcYOMqVHOobuDrw3FGKsW0I5TNBGdEq703iew==","mode":420,"size":1526},"lib/array-set.js":{"checkedAt":1678883669579,"integrity":"sha512-/Ou0vVc0wZWT/wWuMPXJbSv3GHGF6gsYKDtzs/ej89xwTeuExiZakM8lbyeM9qXo4Vw+j3nyjQOLbVoTqBKr6g==","mode":420,"size":3197},"lib/base64-vlq.js":{"checkedAt":1678883669579,"integrity":"sha512-4iW04DK4voFlS0PnPjjRYsxEn4D16ha5f4d1mAgxfAIsm2DNwMEZ7WvX5p23u4NZt0K/APdoGXtbiMRhnowm4g==","mode":420,"size":4714},"lib/base64.js":{"checkedAt":1678883669579,"integrity":"sha512-+JZQPKYAvOuuLKlL9dQZPekes34WSJ3fPddKQ6ljF2muTTs8W5UvvmkgSOk/hHSAlD7C0wDum6T5OCh+uDoBIQ==","mode":420,"size":1540},"lib/binary-search.js":{"checkedAt":1678883669581,"integrity":"sha512-rJG62wV+zBLl+zcBJBTbBRyNnDU4npBQeZEfibzxIokkn241CAyLp7MjCGXFG9YhB8ggUROfm7xcsN8FkjtuDA==","mode":420,"size":4249},"lib/mapping-list.js":{"checkedAt":1678883669581,"integrity":"sha512-IGMtpwSL9QukmC3s3uaNHg7NHaUql5+bXdCJHPutUrs0tLyS30Zsbbf6WMnAEbnner0g5oA+LuG4TPuP0JnHew==","mode":420,"size":2339},"lib/quick-sort.js":{"checkedAt":1678883669581,"integrity":"sha512-VPX0GnsfQa+dnKFeUs7k/bqt/uWAJdZSQmKMHZPzXdK6ml5hUZQVWxY8R/lj0GHguK9e55X1eQorLpWo/tWFIg==","mode":420,"size":4068},"lib/source-map-consumer.js":{"checkedAt":1678883669586,"integrity":"sha512-XpzgLBaQfhlH4bCrj09TxHHHLfwvpHHdHNz0z0DxcBh4MHoNLUcEWOucCYKwqxaSGrLhzB1M20w4T50CHkd03g==","mode":420,"size":41482},"lib/source-map-generator.js":{"checkedAt":1678883669588,"integrity":"sha512-cGHpiluhtBGOcYpA3Z2Xc/2KzfeDtCKnwiRlEnPm1QUOK5frhPFa9VigNlvrF83AZC/TGVb+Yetv12GI6KvWbA==","mode":420,"size":14356},"source-map.js":{"checkedAt":1678883669588,"integrity":"sha512-C+oUuncUn7WIh8JI4Kvc24krlT3unZRwf7QZT7rsPmr6E7qcWEblKXbDRE/dEqJqepjNjH+r3BZv+MmOKUw6TQ==","mode":420,"size":405},"lib/source-node.js":{"checkedAt":1678883669589,"integrity":"sha512-p+PQSP1b8COp/v3bAS9K1KLCSWu0vnfaV+So4LF9LkRyzuaO7hk0x1Mbg1uS+kKVU7WAbrl5A4MNCxyqyoQjng==","mode":420,"size":13808},"package.json":{"checkedAt":1678883669589,"integrity":"sha512-V5tNXX1af6/93FSyi0YyC7mVV6fGavaT++zsThuPuFFiT4dKAxjW6incXiYXl2ShJfx15TcI0lukfvpXa/Otfw==","mode":420,"size":2548},"lib/util.js":{"checkedAt":1678883669589,"integrity":"sha512-mB1bNboxZcSn2/ps1LPlJKW0OpxZrUnh7IYkAyIo+OartEFKKMu4YohEDJGqxnQpMqOCi7+HaTOGy4C9KwIP2w==","mode":420,"size":15403},"CHANGELOG.md":{"checkedAt":1678883669589,"integrity":"sha512-vuwT/gQrcG4rmP0tSdud1eymLkl20r9q2G5xICC4ACRCVdcOSdOsCSBRBnM1oZwgLBleOsV/M12lOfKV+aNb/g==","mode":420,"size":8606},"source-map.d.ts":{"checkedAt":1678883669591,"integrity":"sha512-fr4R6uzjiF+pGFBY7NgBW4jArgJEtUH8Q4snmCbpwrBJNqH8HLOOHJM5p2f/dKkAZ5C4oCvE9YbVO8T2ggQgJQ==","mode":420,"size":3854},"README.md":{"checkedAt":1678883669591,"integrity":"sha512-atwIgPyoPWq8Vh2q7r2/9moPUFgNXzNjPKofkU/ppPXAnyg9rt5T5fvSUgF5VQgq6oKRRV3zAnsm45ZlmRHU0w==","mode":420,"size":25736}}}

View File

@@ -0,0 +1 @@
module.exports={A:{A:{"2":"J D E F A B CC"},B:{"1":"K L G M N O P Q R S T U V W X Y Z a b c d e i j k l m n o p q r s t u f H","2":"C"},C:{"1":"2 3 4 5 6 7 8 9 AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB h lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d e i j k l m n o p q r s t u f H xB yB","2":"0 1 DC tB I v J D E F A B C K L G M N O w g x y z EC FC"},D:{"1":"FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB h lB mB nB oB pB P Q R S T U V W X Y Z a b c d e i j k l m n o p q r s t u f H xB yB GC","2":"0 1 2 3 4 5 6 7 8 9 I v J D E F A B C K L G M N O w g x y z AB BB CB DB EB"},E:{"1":"A B C K L G 0B qB rB 1B MC NC 2B 3B 4B 5B sB 6B 7B 8B 9B OC","2":"I v J D E F HC zB IC JC KC LC"},F:{"1":"2 3 4 5 6 7 8 9 AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB h lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d e","2":"0 1 F B C G M N O w g x y z PC QC RC SC qB AC TC rB"},G:{"1":"bC cC dC eC fC gC hC iC jC kC lC mC nC 2B 3B 4B 5B sB 6B 7B 8B 9B","2":"E zB UC BC VC WC XC YC ZC aC"},H:{"2":"oC"},I:{"1":"f","2":"tB I pC qC rC sC BC tC uC"},J:{"2":"D A"},K:{"1":"h","2":"A B C qB AC rB"},L:{"1":"H"},M:{"1":"H"},N:{"2":"A B"},O:{"1":"vC"},P:{"1":"I g wC xC yC zC 0C 0B 1C 2C 3C 4C 5C sB 6C 7C 8C"},Q:{"1":"1B"},R:{"1":"9C"},S:{"1":"AD BD"}},B:6,C:"ES6 Generators"};

View File

@@ -0,0 +1,59 @@
import { Deprecation } from 'deprecation';
import once from 'once';
const logOnceCode = once((deprecation) => console.warn(deprecation));
const logOnceHeaders = once((deprecation) => console.warn(deprecation));
/**
* Error with extra properties to help with debugging
*/
class RequestError extends Error {
constructor(message, statusCode, options) {
super(message);
// Maintains proper stack trace (only available on V8)
/* istanbul ignore next */
if (Error.captureStackTrace) {
Error.captureStackTrace(this, this.constructor);
}
this.name = "HttpError";
this.status = statusCode;
let headers;
if ("headers" in options && typeof options.headers !== "undefined") {
headers = options.headers;
}
if ("response" in options) {
this.response = options.response;
headers = options.response.headers;
}
// redact request credentials without mutating original request options
const requestCopy = Object.assign({}, options.request);
if (options.request.headers.authorization) {
requestCopy.headers = Object.assign({}, options.request.headers, {
authorization: options.request.headers.authorization.replace(/ .*$/, " [REDACTED]"),
});
}
requestCopy.url = requestCopy.url
// client_id & client_secret can be passed as URL query parameters to increase rate limit
// see https://developer.github.com/v3/#increasing-the-unauthenticated-rate-limit-for-oauth-applications
.replace(/\bclient_secret=\w+/g, "client_secret=[REDACTED]")
// OAuth tokens can be passed as URL query parameters, although it is not recommended
// see https://developer.github.com/v3/#oauth2-token-sent-in-a-header
.replace(/\baccess_token=\w+/g, "access_token=[REDACTED]");
this.request = requestCopy;
// deprecations
Object.defineProperty(this, "code", {
get() {
logOnceCode(new Deprecation("[@octokit/request-error] `error.code` is deprecated, use `error.status`."));
return statusCode;
},
});
Object.defineProperty(this, "headers", {
get() {
logOnceHeaders(new Deprecation("[@octokit/request-error] `error.headers` is deprecated, use `error.response.headers`."));
return headers || {};
},
});
}
}
export { RequestError };
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1,62 @@
import { Action } from './scheduler/Action';
import { Subscription } from './Subscription';
import { SchedulerLike, SchedulerAction } from './types';
import { dateTimestampProvider } from './scheduler/dateTimestampProvider';
/**
* An execution context and a data structure to order tasks and schedule their
* execution. Provides a notion of (potentially virtual) time, through the
* `now()` getter method.
*
* Each unit of work in a Scheduler is called an `Action`.
*
* ```ts
* class Scheduler {
* now(): number;
* schedule(work, delay?, state?): Subscription;
* }
* ```
*
* @class Scheduler
* @deprecated Scheduler is an internal implementation detail of RxJS, and
* should not be used directly. Rather, create your own class and implement
* {@link SchedulerLike}. Will be made internal in v8.
*/
export class Scheduler implements SchedulerLike {
public static now: () => number = dateTimestampProvider.now;
constructor(private schedulerActionCtor: typeof Action, now: () => number = Scheduler.now) {
this.now = now;
}
/**
* A getter method that returns a number representing the current time
* (at the time this function was called) according to the scheduler's own
* internal clock.
* @return {number} A number that represents the current time. May or may not
* have a relation to wall-clock time. May or may not refer to a time unit
* (e.g. milliseconds).
*/
public now: () => number;
/**
* Schedules a function, `work`, for execution. May happen at some point in
* the future, according to the `delay` parameter, if specified. May be passed
* some context object, `state`, which will be passed to the `work` function.
*
* The given arguments will be processed an stored as an Action object in a
* queue of actions.
*
* @param {function(state: ?T): ?Subscription} work A function representing a
* task, or some unit of work to be executed by the Scheduler.
* @param {number} [delay] Time to wait before executing the work, where the
* time unit is implicit and defined by the Scheduler itself.
* @param {T} [state] Some contextual data that the `work` function uses when
* called by the Scheduler.
* @return {Subscription} A subscription in order to be able to unsubscribe
* the scheduled work.
*/
public schedule<T>(work: (this: SchedulerAction<T>, state?: T) => void, delay: number = 0, state?: T): Subscription {
return new this.schedulerActionCtor<T>(this, work).schedule(state, delay);
}
}

View File

@@ -0,0 +1,49 @@
export function number(n: number) {
if (!Number.isSafeInteger(n) || n < 0) throw new Error(`Wrong positive integer: ${n}`);
}
export function bool(b: boolean) {
if (typeof b !== 'boolean') throw new Error(`Expected boolean, not ${b}`);
}
export function bytes(b: Uint8Array | undefined, ...lengths: number[]) {
if (!(b instanceof Uint8Array)) throw new TypeError('Expected Uint8Array');
if (lengths.length > 0 && !lengths.includes(b.length))
throw new TypeError(`Expected Uint8Array of length ${lengths}, not of length=${b.length}`);
}
type Hash = {
(data: Uint8Array): Uint8Array;
blockLen: number;
outputLen: number;
create: any;
};
export function hash(hash: Hash) {
if (typeof hash !== 'function' || typeof hash.create !== 'function')
throw new Error('Hash should be wrapped by utils.wrapConstructor');
number(hash.outputLen);
number(hash.blockLen);
}
export function exists(instance: any, checkFinished = true) {
if (instance.destroyed) throw new Error('Hash instance has been destroyed');
if (checkFinished && instance.finished) throw new Error('Hash#digest() has already been called');
}
export function output(out: any, instance: any) {
bytes(out);
const min = instance.outputLen;
if (out.length < min) {
throw new Error(`digestInto() expects output buffer of length at least ${min}`);
}
}
const assert = {
number,
bool,
bytes,
hash,
exists,
output,
};
export default assert;

View File

@@ -0,0 +1,13 @@
"use strict";
var resolveException = require("../lib/resolve-exception")
, coerce = require("./coerce");
module.exports = function (value /*, options*/) {
var coerced = coerce(value);
if (coerced !== null) return coerced;
var options = arguments[1];
var errorMessage =
options && options.name ? "Expected bigint for %n, received %v" : "%v is not a bigint";
return resolveException(value, errorMessage, options);
};

View File

@@ -0,0 +1,5 @@
import { Parser } from './postcss.js'
declare const parse: Parser
export default parse

View File

@@ -0,0 +1,23 @@
declare module 'emoji-regex' {
function emojiRegex(): RegExp;
export default emojiRegex;
}
declare module 'emoji-regex/text' {
function emojiRegex(): RegExp;
export default emojiRegex;
}
declare module 'emoji-regex/es2015' {
function emojiRegex(): RegExp;
export default emojiRegex;
}
declare module 'emoji-regex/es2015/text' {
function emojiRegex(): RegExp;
export default emojiRegex;
}

View File

@@ -0,0 +1,17 @@
/// <reference types="node" />
import { Options } from 'ftp';
import { Readable } from 'stream';
import { UrlWithStringQuery } from 'url';
import { GetUriOptions } from '.';
interface FTPReadable extends Readable {
lastModified?: Date;
}
interface FTPOptions extends GetUriOptions, Options {
cache?: FTPReadable;
debug?: (s: string) => void;
}
/**
* Returns a Readable stream from an "ftp:" URI.
*/
export default function get(parsed: UrlWithStringQuery, opts: FTPOptions): Promise<Readable>;
export {};

View File

@@ -0,0 +1,57 @@
{
"name": "pac-resolver",
"version": "5.0.1",
"description": "Generates an asynchronous resolver function from a PAC file",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"files": [
"dist"
],
"dependencies": {
"degenerator": "^3.0.2",
"ip": "^1.1.5",
"netmask": "^2.0.2"
},
"devDependencies": {
"@types/debug": "4",
"@types/ip": "^1.1.0",
"@types/netmask": "^1.0.30",
"@types/node": "^17.0.19",
"@typescript-eslint/eslint-plugin": "5.12.0",
"@typescript-eslint/parser": "5.12.0",
"eslint": "^8.9.0",
"eslint-config-airbnb": "19.0.4",
"eslint-config-prettier": "8.4.0",
"eslint-import-resolver-typescript": "2.5.0",
"eslint-plugin-import": "2.25.4",
"mocha": "^9.2.1",
"rimraf": "^3.0.2",
"typescript": "^4.5.5"
},
"scripts": {
"prebuild": "rimraf dist",
"build": "tsc",
"test": "mocha --reporter spec",
"test-lint": "eslint src --ext .js,.ts",
"prepublishOnly": "npm run build"
},
"repository": {
"type": "git",
"url": "git://github.com/TooTallNate/node-pac-resolver.git"
},
"engines": {
"node": ">= 8"
},
"keywords": [
"pac",
"file",
"proxy",
"resolve",
"dns"
],
"author": "Nathan Rajlich <nathan@tootallnate.net> (http://n8.io/)",
"license": "MIT",
"bugs": {
"url": "https://github.com/TooTallNate/node-pac-resolver/issues"
}
}

View File

@@ -0,0 +1,20 @@
'use strict';
var GetIntrinsic = require('get-intrinsic');
var $TypeError = GetIntrinsic('%TypeError%');
var GetPrototypeFromConstructor = require('./GetPrototypeFromConstructor');
var IsArray = require('./IsArray');
var ObjectCreate = require('./ObjectCreate');
// https://262.ecma-international.org/6.0/#sec-ordinarycreatefromconstructor
module.exports = function OrdinaryCreateFromConstructor(constructor, intrinsicDefaultProto) {
GetIntrinsic(intrinsicDefaultProto); // throws if not a valid intrinsic
var proto = GetPrototypeFromConstructor(constructor, intrinsicDefaultProto);
var slots = arguments.length < 3 ? [] : arguments[2];
if (!IsArray(slots)) {
throw new $TypeError('Assertion failed: if provided, `internalSlotsList` must be a List');
}
return ObjectCreate(proto, slots);
};

View File

@@ -0,0 +1,88 @@
import {UpperCaseCharacters, WordSeparators} from '../source/utilities';
/**
Unlike a simpler split, this one includes the delimiter splitted on in the resulting array literal. This is to enable splitting on, for example, upper-case characters.
@category Template Literals
*/
export type SplitIncludingDelimiters<Source extends string, Delimiter extends string> =
Source extends '' ? [] :
Source extends `${infer FirstPart}${Delimiter}${infer SecondPart}` ?
(
Source extends `${FirstPart}${infer UsedDelimiter}${SecondPart}`
? UsedDelimiter extends Delimiter
? Source extends `${infer FirstPart}${UsedDelimiter}${infer SecondPart}`
? [...SplitIncludingDelimiters<FirstPart, Delimiter>, UsedDelimiter, ...SplitIncludingDelimiters<SecondPart, Delimiter>]
: never
: never
: never
) :
[Source];
/**
Format a specific part of the splitted string literal that `StringArrayToDelimiterCase<>` fuses together, ensuring desired casing.
@see StringArrayToDelimiterCase
*/
type StringPartToDelimiterCase<StringPart extends string, UsedWordSeparators extends string, UsedUpperCaseCharacters extends string, Delimiter extends string> =
StringPart extends UsedWordSeparators ? Delimiter :
StringPart extends UsedUpperCaseCharacters ? `${Delimiter}${Lowercase<StringPart>}` :
StringPart;
/**
Takes the result of a splitted string literal and recursively concatenates it together into the desired casing.
It receives `UsedWordSeparators` and `UsedUpperCaseCharacters` as input to ensure it's fully encapsulated.
@see SplitIncludingDelimiters
*/
type StringArrayToDelimiterCase<Parts extends any[], UsedWordSeparators extends string, UsedUpperCaseCharacters extends string, Delimiter extends string> =
Parts extends [`${infer FirstPart}`, ...infer RemainingParts]
? `${StringPartToDelimiterCase<FirstPart, UsedWordSeparators, UsedUpperCaseCharacters, Delimiter>}${StringArrayToDelimiterCase<RemainingParts, UsedWordSeparators, UsedUpperCaseCharacters, Delimiter>}`
: '';
/**
Convert a string literal to a custom string delimiter casing.
This can be useful when, for example, converting a camel-cased object property to an oddly cased one.
@see KebabCase
@see SnakeCase
@example
```
import {DelimiterCase} from 'type-fest';
// Simple
const someVariable: DelimiterCase<'fooBar', '#'> = 'foo#bar';
// Advanced
type OddlyCasedProperties<T> = {
[K in keyof T as DelimiterCase<K, '#'>]: T[K]
};
interface SomeOptions {
dryRun: boolean;
includeFile: string;
foo: number;
}
const rawCliOptions: OddlyCasedProperties<SomeOptions> = {
'dry#run': true,
'include#file': 'bar.js',
foo: 123
};
```
@category Template Literals
*/
export type DelimiterCase<Value, Delimiter extends string> = Value extends string
? StringArrayToDelimiterCase<
SplitIncludingDelimiters<Value, WordSeparators | UpperCaseCharacters>,
WordSeparators,
UpperCaseCharacters,
Delimiter
>
: Value;

View File

@@ -0,0 +1,12 @@
# The BSD 2-Clause License
Copyright (c) 2014, Domenic Denicola
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View File

@@ -0,0 +1,7 @@
import type { FilterFunction } from '../settings';
import type Settings from '../settings';
import type { Errno } from '../types';
export declare function isFatalError(settings: Settings, error: Errno): boolean;
export declare function isAppliedFilter<T>(filter: FilterFunction<T> | null, value: T): boolean;
export declare function replacePathSegmentSeparator(filepath: string, separator: string): string;
export declare function joinPathSegments(a: string, b: string, separator: string): string;

View File

@@ -0,0 +1,5 @@
var convert = require('./convert'),
func = convert('isError', require('../isError'), require('./_falseOptions'));
func.placeholder = require('./placeholder');
module.exports = func;

View File

@@ -0,0 +1,3 @@
export default function getBufferResponse(response) {
return response.arrayBuffer();
}

View File

@@ -0,0 +1,32 @@
let Declaration = require('../declaration')
let utils = require('./grid-utils')
class PlaceSelf extends Declaration {
/**
* Translate place-self to separate -ms- prefixed properties
*/
insert(decl, prefix, prefixes) {
if (prefix !== '-ms-') return super.insert(decl, prefix, prefixes)
// prevent doubling of prefixes
if (decl.parent.some(i => i.prop === '-ms-grid-row-align')) {
return undefined
}
let [[first, second]] = utils.parse(decl)
if (second) {
utils.insertDecl(decl, 'grid-row-align', first)
utils.insertDecl(decl, 'grid-column-align', second)
} else {
utils.insertDecl(decl, 'grid-row-align', first)
utils.insertDecl(decl, 'grid-column-align', first)
}
return undefined
}
}
PlaceSelf.names = ['place-self']
module.exports = PlaceSelf

View File

@@ -0,0 +1,332 @@
// If IndexedDB isn't available, we'll fall back to localStorage.
// Note that this will have considerable performance and storage
// side-effects (all data will be serialized on save and only data that
// can be converted to a string via `JSON.stringify()` will be saved).
import isLocalStorageValid from '../utils/isLocalStorageValid';
import serializer from '../utils/serializer';
import Promise from '../utils/promise';
import executeCallback from '../utils/executeCallback';
import normalizeKey from '../utils/normalizeKey';
import getCallback from '../utils/getCallback';
function _getKeyPrefix(options, defaultConfig) {
var keyPrefix = options.name + '/';
if (options.storeName !== defaultConfig.storeName) {
keyPrefix += options.storeName + '/';
}
return keyPrefix;
}
// Check if localStorage throws when saving an item
function checkIfLocalStorageThrows() {
var localStorageTestKey = '_localforage_support_test';
try {
localStorage.setItem(localStorageTestKey, true);
localStorage.removeItem(localStorageTestKey);
return false;
} catch (e) {
return true;
}
}
// Check if localStorage is usable and allows to save an item
// This method checks if localStorage is usable in Safari Private Browsing
// mode, or in any other case where the available quota for localStorage
// is 0 and there wasn't any saved items yet.
function _isLocalStorageUsable() {
return !checkIfLocalStorageThrows() || localStorage.length > 0;
}
// Config the localStorage backend, using options set in the config.
function _initStorage(options) {
var self = this;
var dbInfo = {};
if (options) {
for (var i in options) {
dbInfo[i] = options[i];
}
}
dbInfo.keyPrefix = _getKeyPrefix(options, self._defaultConfig);
if (!_isLocalStorageUsable()) {
return Promise.reject();
}
self._dbInfo = dbInfo;
dbInfo.serializer = serializer;
return Promise.resolve();
}
// Remove all keys from the datastore, effectively destroying all data in
// the app's key/value store!
function clear(callback) {
var self = this;
var promise = self.ready().then(function() {
var keyPrefix = self._dbInfo.keyPrefix;
for (var i = localStorage.length - 1; i >= 0; i--) {
var key = localStorage.key(i);
if (key.indexOf(keyPrefix) === 0) {
localStorage.removeItem(key);
}
}
});
executeCallback(promise, callback);
return promise;
}
// Retrieve an item from the store. Unlike the original async_storage
// library in Gaia, we don't modify return values at all. If a key's value
// is `undefined`, we pass that value to the callback function.
function getItem(key, callback) {
var self = this;
key = normalizeKey(key);
var promise = self.ready().then(function() {
var dbInfo = self._dbInfo;
var result = localStorage.getItem(dbInfo.keyPrefix + key);
// If a result was found, parse it from the serialized
// string into a JS object. If result isn't truthy, the key
// is likely undefined and we'll pass it straight to the
// callback.
if (result) {
result = dbInfo.serializer.deserialize(result);
}
return result;
});
executeCallback(promise, callback);
return promise;
}
// Iterate over all items in the store.
function iterate(iterator, callback) {
var self = this;
var promise = self.ready().then(function() {
var dbInfo = self._dbInfo;
var keyPrefix = dbInfo.keyPrefix;
var keyPrefixLength = keyPrefix.length;
var length = localStorage.length;
// We use a dedicated iterator instead of the `i` variable below
// so other keys we fetch in localStorage aren't counted in
// the `iterationNumber` argument passed to the `iterate()`
// callback.
//
// See: github.com/mozilla/localForage/pull/435#discussion_r38061530
var iterationNumber = 1;
for (var i = 0; i < length; i++) {
var key = localStorage.key(i);
if (key.indexOf(keyPrefix) !== 0) {
continue;
}
var value = localStorage.getItem(key);
// If a result was found, parse it from the serialized
// string into a JS object. If result isn't truthy, the
// key is likely undefined and we'll pass it straight
// to the iterator.
if (value) {
value = dbInfo.serializer.deserialize(value);
}
value = iterator(
value,
key.substring(keyPrefixLength),
iterationNumber++
);
if (value !== void 0) {
return value;
}
}
});
executeCallback(promise, callback);
return promise;
}
// Same as localStorage's key() method, except takes a callback.
function key(n, callback) {
var self = this;
var promise = self.ready().then(function() {
var dbInfo = self._dbInfo;
var result;
try {
result = localStorage.key(n);
} catch (error) {
result = null;
}
// Remove the prefix from the key, if a key is found.
if (result) {
result = result.substring(dbInfo.keyPrefix.length);
}
return result;
});
executeCallback(promise, callback);
return promise;
}
function keys(callback) {
var self = this;
var promise = self.ready().then(function() {
var dbInfo = self._dbInfo;
var length = localStorage.length;
var keys = [];
for (var i = 0; i < length; i++) {
var itemKey = localStorage.key(i);
if (itemKey.indexOf(dbInfo.keyPrefix) === 0) {
keys.push(itemKey.substring(dbInfo.keyPrefix.length));
}
}
return keys;
});
executeCallback(promise, callback);
return promise;
}
// Supply the number of keys in the datastore to the callback function.
function length(callback) {
var self = this;
var promise = self.keys().then(function(keys) {
return keys.length;
});
executeCallback(promise, callback);
return promise;
}
// Remove an item from the store, nice and simple.
function removeItem(key, callback) {
var self = this;
key = normalizeKey(key);
var promise = self.ready().then(function() {
var dbInfo = self._dbInfo;
localStorage.removeItem(dbInfo.keyPrefix + key);
});
executeCallback(promise, callback);
return promise;
}
// Set a key's value and run an optional callback once the value is set.
// Unlike Gaia's implementation, the callback function is passed the value,
// in case you want to operate on that value only after you're sure it
// saved, or something like that.
function setItem(key, value, callback) {
var self = this;
key = normalizeKey(key);
var promise = self.ready().then(function() {
// Convert undefined values to null.
// https://github.com/mozilla/localForage/pull/42
if (value === undefined) {
value = null;
}
// Save the original value to pass to the callback.
var originalValue = value;
return new Promise(function(resolve, reject) {
var dbInfo = self._dbInfo;
dbInfo.serializer.serialize(value, function(value, error) {
if (error) {
reject(error);
} else {
try {
localStorage.setItem(dbInfo.keyPrefix + key, value);
resolve(originalValue);
} catch (e) {
// localStorage capacity exceeded.
// TODO: Make this a specific error/event.
if (
e.name === 'QuotaExceededError' ||
e.name === 'NS_ERROR_DOM_QUOTA_REACHED'
) {
reject(e);
}
reject(e);
}
}
});
});
});
executeCallback(promise, callback);
return promise;
}
function dropInstance(options, callback) {
callback = getCallback.apply(this, arguments);
options = (typeof options !== 'function' && options) || {};
if (!options.name) {
var currentConfig = this.config();
options.name = options.name || currentConfig.name;
options.storeName = options.storeName || currentConfig.storeName;
}
var self = this;
var promise;
if (!options.name) {
promise = Promise.reject('Invalid arguments');
} else {
promise = new Promise(function(resolve) {
if (!options.storeName) {
resolve(`${options.name}/`);
} else {
resolve(_getKeyPrefix(options, self._defaultConfig));
}
}).then(function(keyPrefix) {
for (var i = localStorage.length - 1; i >= 0; i--) {
var key = localStorage.key(i);
if (key.indexOf(keyPrefix) === 0) {
localStorage.removeItem(key);
}
}
});
}
executeCallback(promise, callback);
return promise;
}
var localStorageWrapper = {
_driver: 'localStorageWrapper',
_initStorage: _initStorage,
_support: isLocalStorageValid(),
iterate: iterate,
getItem: getItem,
setItem: setItem,
removeItem: removeItem,
clear: clear,
length: length,
key: key,
keys: keys,
dropInstance: dropInstance
};
export default localStorageWrapper;

View File

@@ -0,0 +1 @@
module.exports={A:{A:{"2":"CC","8":"J D E F A B"},B:{"1":"P Q R S T U V W X Y Z a b c d e i j k l m n o p q r s t u f H","8":"C K L G M N O"},C:{"1":"1 2 3 4 5 6 7 8 9 AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB h lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d e i j k l m n o p q r s t u f H xB yB","2":"DC","8":"0 tB I v J D E F A B C K L G M N O w g x y z EC FC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 g x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB h lB mB nB oB pB P Q R S T U V W X Y Z a b c d e i j k l m n o p q r s t u f H xB yB GC","2":"I v J D E F A B C K","8":"L G M N O w"},E:{"1":"J D E F A B C K L G JC KC LC 0B qB rB 1B MC NC 2B 3B 4B 5B sB 6B 7B 8B 9B OC","2":"HC zB","8":"I v IC"},F:{"1":"0 1 2 3 4 5 6 7 8 9 G M N O w g x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB h lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d e","2":"F B PC QC RC SC","8":"C qB AC TC rB"},G:{"1":"E WC XC YC ZC aC bC cC dC eC fC gC hC iC jC kC lC mC nC 2B 3B 4B 5B sB 6B 7B 8B 9B","2":"zB","8":"UC BC VC"},H:{"2":"oC"},I:{"1":"f tC uC","8":"tB I pC qC rC sC BC"},J:{"1":"A","8":"D"},K:{"1":"h","2":"A B","8":"C qB AC rB"},L:{"1":"H"},M:{"1":"H"},N:{"8":"A B"},O:{"1":"vC"},P:{"1":"I g wC xC yC zC 0C 0B 1C 2C 3C 4C 5C sB 6C 7C 8C"},Q:{"1":"1B"},R:{"1":"9C"},S:{"1":"AD BD"}},B:1,C:"srcdoc attribute for iframes"};

View File

@@ -0,0 +1 @@
module.exports={A:{A:{"2":"J D E F A B CC"},B:{"2":"C K L G M N","260":"P Q R S T U V W X Y Z a b c d e i j k l m n o p q r s t u f H","3138":"O"},C:{"1":"UB VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB h lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d e i j k l m n o p q r s t u f H xB yB","2":"DC tB","132":"0 1 2 3 4 5 6 7 8 9 I v J D E F A B C K L G M N O w g x y z AB BB CB DB EB FB GB HB IB JB KB LB MB EC FC","644":"NB OB PB QB RB SB TB"},D:{"2":"I v J D E F A B C K L G M N O w g x y z","260":"VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB h lB mB nB oB pB P Q R S T U V W X Y Z a b c d e i j k l m n o p q r s t u f H xB yB GC","292":"0 1 2 3 4 5 6 7 8 9 AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB"},E:{"2":"I v J HC zB IC JC","260":"L G 1B MC NC 2B 3B 4B 5B sB 6B 7B 8B 9B OC","292":"D E F A B C K KC LC 0B qB rB"},F:{"2":"F B C PC QC RC SC qB AC TC rB","260":"IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB h lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d e","292":"0 1 2 3 4 5 6 7 8 9 G M N O w g x y z AB BB CB DB EB FB GB HB"},G:{"2":"zB UC BC VC WC","260":"hC iC jC kC lC mC nC 2B 3B 4B 5B sB 6B 7B 8B 9B","292":"E XC YC ZC aC bC cC dC eC fC gC"},H:{"2":"oC"},I:{"2":"tB I pC qC rC sC BC","260":"f","292":"tC uC"},J:{"2":"D A"},K:{"2":"A B C qB AC rB","260":"h"},L:{"260":"H"},M:{"1":"H"},N:{"2":"A B"},O:{"260":"vC"},P:{"292":"I g wC xC yC zC 0C 0B 1C 2C 3C 4C 5C sB 6C 7C 8C"},Q:{"260":"1B"},R:{"260":"9C"},S:{"1":"BD","644":"AD"}},B:4,C:"CSS clip-path property (for HTML)"};

View File

@@ -0,0 +1,22 @@
"use strict";
// Update this array if you add/rename/remove files in this directory.
// We support Browserify by skipping automatic module discovery and requiring modules directly.
var modules = [
require("./internal"),
require("./utf16"),
require("./utf7"),
require("./sbcs-codec"),
require("./sbcs-data"),
require("./sbcs-data-generated"),
require("./dbcs-codec"),
require("./dbcs-data"),
];
// Put all encoding/alias/codec definitions to single object and export it.
for (var i = 0; i < modules.length; i++) {
var module = modules[i];
for (var enc in module)
if (Object.prototype.hasOwnProperty.call(module, enc))
exports[enc] = module[enc];
}

View File

@@ -0,0 +1,30 @@
import { EmptyError } from '../util/EmptyError';
import { SequenceError } from '../util/SequenceError';
import { NotFoundError } from '../util/NotFoundError';
import { operate } from '../util/lift';
import { createOperatorSubscriber } from './OperatorSubscriber';
export function single(predicate) {
return operate(function (source, subscriber) {
var hasValue = false;
var singleValue;
var seenValue = false;
var index = 0;
source.subscribe(createOperatorSubscriber(subscriber, function (value) {
seenValue = true;
if (!predicate || predicate(value, index++, source)) {
hasValue && subscriber.error(new SequenceError('Too many matching values'));
hasValue = true;
singleValue = value;
}
}, function () {
if (hasValue) {
subscriber.next(singleValue);
subscriber.complete();
}
else {
subscriber.error(seenValue ? new NotFoundError('No matching values') : new EmptyError());
}
}));
});
}
//# sourceMappingURL=single.js.map

View File

@@ -0,0 +1,248 @@
'use strict'
const test = require('tape')
const buildQueue = require('../').promise
const { promisify } = require('util')
const sleep = promisify(setTimeout)
const immediate = promisify(setImmediate)
test('concurrency', function (t) {
t.plan(2)
t.throws(buildQueue.bind(null, worker, 0))
t.doesNotThrow(buildQueue.bind(null, worker, 1))
async function worker (arg) {
return true
}
})
test('worker execution', async function (t) {
const queue = buildQueue(worker, 1)
const result = await queue.push(42)
t.equal(result, true, 'result matches')
async function worker (arg) {
t.equal(arg, 42)
return true
}
})
test('limit', async function (t) {
const queue = buildQueue(worker, 1)
const [res1, res2] = await Promise.all([queue.push(10), queue.push(0)])
t.equal(res1, 10, 'the result matches')
t.equal(res2, 0, 'the result matches')
async function worker (arg) {
await sleep(arg)
return arg
}
})
test('multiple executions', async function (t) {
const queue = buildQueue(worker, 1)
const toExec = [1, 2, 3, 4, 5]
const expected = ['a', 'b', 'c', 'd', 'e']
let count = 0
await Promise.all(toExec.map(async function (task, i) {
const result = await queue.push(task)
t.equal(result, expected[i], 'the result matches')
}))
async function worker (arg) {
t.equal(arg, toExec[count], 'arg matches')
return expected[count++]
}
})
test('drained', async function (t) {
const queue = buildQueue(worker, 2)
const toExec = new Array(10).fill(10)
let count = 0
async function worker (arg) {
await sleep(arg)
count++
}
toExec.forEach(function (i) {
queue.push(i)
})
await queue.drained()
t.equal(count, toExec.length)
toExec.forEach(function (i) {
queue.push(i)
})
await queue.drained()
t.equal(count, toExec.length * 2)
})
test('drained with exception should not throw', async function (t) {
const queue = buildQueue(worker, 2)
const toExec = new Array(10).fill(10)
async function worker () {
throw new Error('foo')
}
toExec.forEach(function (i) {
queue.push(i)
})
await queue.drained()
})
test('drained with drain function', async function (t) {
let drainCalled = false
const queue = buildQueue(worker, 2)
queue.drain = function () {
drainCalled = true
}
const toExec = new Array(10).fill(10)
let count = 0
async function worker (arg) {
await sleep(arg)
count++
}
toExec.forEach(function () {
queue.push()
})
await queue.drained()
t.equal(count, toExec.length)
t.equal(drainCalled, true)
})
test('drained while idle should resolve', async function (t) {
const queue = buildQueue(worker, 2)
async function worker (arg) {
await sleep(arg)
}
await queue.drained()
})
test('drained while idle should not call the drain function', async function (t) {
let drainCalled = false
const queue = buildQueue(worker, 2)
queue.drain = function () {
drainCalled = true
}
async function worker (arg) {
await sleep(arg)
}
await queue.drained()
t.equal(drainCalled, false)
})
test('set this', async function (t) {
t.plan(1)
const that = {}
const queue = buildQueue(that, worker, 1)
await queue.push(42)
async function worker (arg) {
t.equal(this, that, 'this matches')
}
})
test('unshift', async function (t) {
const queue = buildQueue(worker, 1)
const expected = [1, 2, 3, 4]
await Promise.all([
queue.push(1),
queue.push(4),
queue.unshift(3),
queue.unshift(2)
])
t.is(expected.length, 0)
async function worker (arg) {
t.equal(expected.shift(), arg, 'tasks come in order')
}
})
test('push with worker throwing error', async function (t) {
t.plan(5)
const q = buildQueue(async function (task, cb) {
throw new Error('test error')
}, 1)
q.error(function (err, task) {
t.ok(err instanceof Error, 'global error handler should catch the error')
t.match(err.message, /test error/, 'error message should be "test error"')
t.equal(task, 42, 'The task executed should be passed')
})
try {
await q.push(42)
} catch (err) {
t.ok(err instanceof Error, 'push callback should catch the error')
t.match(err.message, /test error/, 'error message should be "test error"')
}
})
test('unshift with worker throwing error', async function (t) {
t.plan(2)
const q = buildQueue(async function (task, cb) {
throw new Error('test error')
}, 1)
try {
await q.unshift(42)
} catch (err) {
t.ok(err instanceof Error, 'push callback should catch the error')
t.match(err.message, /test error/, 'error message should be "test error"')
}
})
test('no unhandledRejection (push)', async function (t) {
function handleRejection () {
t.fail('unhandledRejection')
}
process.once('unhandledRejection', handleRejection)
const q = buildQueue(async function (task, cb) {
throw new Error('test error')
}, 1)
q.push(42)
await immediate()
process.removeListener('unhandledRejection', handleRejection)
})
test('no unhandledRejection (unshift)', async function (t) {
function handleRejection () {
t.fail('unhandledRejection')
}
process.once('unhandledRejection', handleRejection)
const q = buildQueue(async function (task, cb) {
throw new Error('test error')
}, 1)
q.unshift(42)
await immediate()
process.removeListener('unhandledRejection', handleRejection)
})

View File

@@ -0,0 +1,24 @@
var baseInvoke = require('./_baseInvoke'),
baseRest = require('./_baseRest');
/**
* Invokes the method at `path` of `object`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Object
* @param {Object} object The object to query.
* @param {Array|string} path The path of the method to invoke.
* @param {...*} [args] The arguments to invoke the method with.
* @returns {*} Returns the result of the invoked method.
* @example
*
* var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };
*
* _.invoke(object, 'a[0].b.c.slice', 1, 3);
* // => [2, 3]
*/
var invoke = baseRest(baseInvoke);
module.exports = invoke;

View File

@@ -0,0 +1,64 @@
# strip-json-comments [![Build Status](https://travis-ci.org/sindresorhus/strip-json-comments.svg?branch=master)](https://travis-ci.org/sindresorhus/strip-json-comments)
> Strip comments from JSON. Lets you use comments in your JSON files!
This is now possible:
```js
{
// rainbows
"unicorn": /* ❤ */ "cake"
}
```
It will replace single-line comments `//` and multi-line comments `/**/` with whitespace. This allows JSON error positions to remain as close as possible to the original source.
Also available as a [gulp](https://github.com/sindresorhus/gulp-strip-json-comments)/[grunt](https://github.com/sindresorhus/grunt-strip-json-comments)/[broccoli](https://github.com/sindresorhus/broccoli-strip-json-comments) plugin.
## Install
```
$ npm install --save strip-json-comments
```
## Usage
```js
const json = '{/*rainbows*/"unicorn":"cake"}';
JSON.parse(stripJsonComments(json));
//=> {unicorn: 'cake'}
```
## API
### stripJsonComments(input, [options])
#### input
Type: `string`
Accepts a string with JSON and returns a string without comments.
#### options
##### whitespace
Type: `boolean`
Default: `true`
Replace comments with whitespace instead of stripping them entirely.
## Related
- [strip-json-comments-cli](https://github.com/sindresorhus/strip-json-comments-cli) - CLI for this module
- [strip-css-comments](https://github.com/sindresorhus/strip-css-comments) - Strip comments from CSS
## License
MIT © [Sindre Sorhus](http://sindresorhus.com)

View File

@@ -0,0 +1,5 @@
var convert = require('./convert'),
func = convert('delay', require('../delay'));
func.placeholder = require('./placeholder');
module.exports = func;

View File

@@ -0,0 +1,10 @@
exports = module.exports = require('./lib/_stream_readable.js');
exports.Stream = require('stream');
exports.Readable = exports;
exports.Writable = require('./lib/_stream_writable.js');
exports.Duplex = require('./lib/_stream_duplex.js');
exports.Transform = require('./lib/_stream_transform.js');
exports.PassThrough = require('./lib/_stream_passthrough.js');
if (!process.browser && process.env.READABLE_STREAM === 'disable') {
module.exports = require('stream');
}

View File

@@ -0,0 +1,17 @@
"use strict";
var assert = require("chai").assert
, ensureNumber = require("../../number/ensure");
describe("number/ensure", function () {
it("Should return coerced value", function () { assert.equal(ensureNumber("12.23"), 12.23); });
it("Should crash on no value", function () {
try {
ensureNumber(null);
throw new Error("Unexpected");
} catch (error) {
assert.equal(error.name, "TypeError");
assert.equal(error.message, "null is not a number");
}
});
});

View File

@@ -0,0 +1,9 @@
"use strict";
var fn = function (value) { return value > 3; };
module.exports = function () {
var arr = [1, 2, 3, 4, 5, 6];
if (typeof arr.findIndex !== "function") return false;
return arr.findIndex(fn) === 3;
};

View File

@@ -0,0 +1 @@
{"version":3,"file":"ignoreElements.d.ts","sourceRoot":"","sources":["../../../../src/internal/operators/ignoreElements.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAK5C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,wBAAgB,cAAc,IAAI,gBAAgB,CAAC,OAAO,EAAE,KAAK,CAAC,CAIjE"}

View File

@@ -0,0 +1,75 @@
{
"name": "validator",
"description": "String validation and sanitization",
"version": "13.9.0",
"sideEffects": false,
"homepage": "https://github.com/validatorjs/validator.js",
"files": [
"index.js",
"es",
"lib",
"README.md",
"LICENCE",
"validator.js",
"validator.min.js"
],
"keywords": [
"validator",
"validation",
"validate",
"sanitization",
"sanitize",
"sanitisation",
"sanitise",
"assert"
],
"author": "Chris O'Hara <cohara87@gmail.com>",
"contributors": [
"Anthony Nandaa (https://github.com/profnandaa)"
],
"main": "index.js",
"bugs": {
"url": "https://github.com/validatorjs/validator.js/issues"
},
"repository": {
"type": "git",
"url": "git+https://github.com/validatorjs/validator.js.git"
},
"devDependencies": {
"@babel/cli": "^7.0.0",
"@babel/core": "^7.0.0",
"@babel/preset-env": "^7.0.0",
"@babel/register": "^7.0.0",
"babel-eslint": "^10.0.1",
"babel-plugin-add-module-exports": "^1.0.0",
"eslint": "^4.19.1",
"eslint-config-airbnb-base": "^12.1.0",
"eslint-plugin-import": "^2.11.0",
"mocha": "^6.2.3",
"npm-run-all": "^4.1.5",
"nyc": "^14.1.0",
"rimraf": "^3.0.0",
"rollup": "^0.47.0",
"rollup-plugin-babel": "^4.0.1",
"uglify-js": "^3.0.19"
},
"scripts": {
"lint": "eslint src test",
"lint:fix": "eslint --fix src test",
"clean:node": "rimraf index.js lib",
"clean:es": "rimraf es",
"clean:browser": "rimraf validator*.js",
"clean": "run-p clean:*",
"minify": "uglifyjs validator.js -o validator.min.js --compress --mangle --comments /Copyright/",
"build:browser": "node --require @babel/register build-browser && npm run minify",
"build:es": "babel src -d es --env-name=es",
"build:node": "babel src -d .",
"build": "run-p build:*",
"pretest": "npm run build && npm run lint",
"test": "nyc --reporter=cobertura --reporter=text-summary mocha --require @babel/register --reporter dot --recursive"
},
"engines": {
"node": ">= 0.10"
},
"license": "MIT"
}

View File

@@ -0,0 +1,65 @@
{
"name": "postcss-import",
"version": "14.1.0",
"description": "PostCSS plugin to import CSS files",
"keywords": [
"css",
"postcss",
"postcss-plugin",
"import",
"node modules",
"npm"
],
"author": "Maxime Thirouin",
"license": "MIT",
"repository": "https://github.com/postcss/postcss-import.git",
"files": [
"index.js",
"lib"
],
"engines": {
"node": ">=10.0.0"
},
"dependencies": {
"postcss-value-parser": "^4.0.0",
"read-cache": "^1.0.0",
"resolve": "^1.1.7"
},
"devDependencies": {
"ava": "^3.0.0",
"eslint": "^7.0.0",
"eslint-config-problems": "^5.0.0",
"eslint-plugin-prettier": "^4.0.0",
"postcss": "^8.0.0",
"postcss-scss": "^4.0.0",
"prettier": "~2.6.0",
"sugarss": "^4.0.0"
},
"peerDependencies": {
"postcss": "^8.0.0"
},
"scripts": {
"ci": "eslint . && ava",
"lint": "eslint . --fix",
"pretest": "npm run lint",
"test": "ava"
},
"eslintConfig": {
"extends": "eslint-config-problems",
"env": {
"node": true
},
"plugins": [
"prettier"
],
"rules": {
"prettier/prettier": [
"error",
{
"semi": false,
"arrowParens": "avoid"
}
]
}
}
}

View File

@@ -0,0 +1 @@
module.exports={A:{A:{"2":"J D E F A B CC"},B:{"1":"P Q R S T U V W X Y Z a b c d e i j k l m n o p q r s t u f H","2":"C K L G M N O"},C:{"1":"aB bB cB dB eB fB gB hB iB jB kB h lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d e i j k l m n o p q r s t u f H xB yB","2":"0 1 2 3 4 5 6 7 8 9 DC tB I v J D E F A B C K L G M N O w g x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB EC FC","322":"RB SB TB UB VB WB XB YB uB ZB vB"},D:{"1":"DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB h lB mB nB oB pB P Q R S T U V W X Y Z a b c d e i j k l m n o p q r s t u f H xB yB GC","2":"0 1 2 3 4 5 6 7 8 9 I v J D E F A B C K L G M N O w g x y z","194":"AB BB CB"},E:{"1":"B C K L G 0B qB rB 1B MC NC 2B 3B 4B 5B sB 6B 7B 8B 9B OC","2":"I v J D HC zB IC JC","33":"E F A KC LC"},F:{"1":"0 1 2 3 4 5 6 7 8 9 AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB h lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d e","2":"F B C G M N O w g x y z PC QC RC SC qB AC TC rB"},G:{"1":"cC dC eC fC gC hC iC jC kC lC mC nC 2B 3B 4B 5B sB 6B 7B 8B 9B","2":"zB UC BC VC WC XC","33":"E YC ZC aC bC"},H:{"2":"oC"},I:{"1":"f","2":"tB I pC qC rC sC BC tC uC"},J:{"2":"D A"},K:{"1":"h","2":"A B C qB AC rB"},L:{"1":"H"},M:{"1":"H"},N:{"2":"A B"},O:{"1":"vC"},P:{"1":"I g wC xC yC zC 0C 0B 1C 2C 3C 4C 5C sB 6C 7C 8C"},Q:{"1":"1B"},R:{"1":"9C"},S:{"1":"BD","2":"AD"}},B:4,C:"CSS Shapes Level 1"};

View File

@@ -0,0 +1 @@
module.exports={C:{"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0.00399,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0.00399,"41":0,"42":0,"43":0,"44":0,"45":0.21168,"46":0,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0.05192,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"59":0,"60":0,"61":0,"62":0,"63":0,"64":0,"65":0,"66":0,"67":0,"68":0.00399,"69":0,"70":0,"71":0,"72":0,"73":0,"74":0,"75":0,"76":0,"77":0,"78":0.00799,"79":0,"80":0,"81":0.01198,"82":0,"83":0,"84":0,"85":0,"86":0,"87":0,"88":0.00399,"89":0,"90":0.00399,"91":0,"92":0,"93":0,"94":0,"95":0,"96":0,"97":0.00799,"98":0,"99":0.01198,"100":0,"101":0,"102":0.00799,"103":0.00399,"104":0.00799,"105":0.01997,"106":0.01198,"107":0.01198,"108":0.03595,"109":0.87868,"110":0.47529,"111":0,"112":0,"3.5":0,"3.6":0},D:{"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0.00399,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0.00399,"39":0,"40":0.00399,"41":0.00399,"42":0,"43":0.00399,"44":0.00399,"45":0.00399,"46":0.00399,"47":0.00399,"48":0,"49":0.03195,"50":0,"51":0,"52":0,"53":0.00799,"54":0,"55":0.00399,"56":0,"57":0,"58":0,"59":0,"60":0,"61":0,"62":0,"63":0,"64":0,"65":0.00399,"66":0,"67":0,"68":0.00799,"69":0.00399,"70":0.00399,"71":0.00399,"72":0.00399,"73":0.00399,"74":0.00399,"75":0,"76":0.00799,"77":0.00399,"78":0.00399,"79":0.09586,"80":0.00399,"81":0.00799,"83":0.01598,"84":0.01198,"85":0.01598,"86":0.00799,"87":0.01198,"88":0.00799,"89":0.00799,"90":0.00399,"91":0.01198,"92":0.01198,"93":0.00399,"94":0.01198,"95":0.01198,"96":0.01198,"97":0.01198,"98":0.01198,"99":0.00799,"100":0.00799,"101":0.00799,"102":0.03595,"103":0.04393,"104":0.01598,"105":0.03994,"106":0.02396,"107":0.04393,"108":0.28757,"109":7.34896,"110":3.2631,"111":0.00399,"112":0,"113":0},F:{"9":0,"11":0,"12":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0.03195,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0.00399,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0.00399,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"60":0,"62":0,"63":0,"64":0,"65":0,"66":0,"67":0.00799,"68":0,"69":0,"70":0,"71":0,"72":0,"73":0,"74":0,"75":0,"76":0,"77":0,"78":0,"79":0,"80":0,"81":0,"82":0,"83":0,"84":0,"85":0.00799,"86":0,"87":0,"88":0,"89":0,"90":0,"91":0,"92":0,"93":0.02396,"94":0.35946,"95":0.23565,"9.5-9.6":0,"10.0-10.1":0,"10.5":0,"10.6":0,"11.1":0,"11.5":0,"11.6":0,"12.1":0},B:{"12":0.00399,"13":0,"14":0,"15":0.05592,"16":0,"17":0,"18":0.00399,"79":0,"80":0,"81":0,"83":0,"84":0.00399,"85":0.01198,"86":0,"87":0,"88":0,"89":0,"90":0,"91":0,"92":0.01997,"93":0,"94":0,"95":0,"96":0,"97":0,"98":0,"99":0,"100":0,"101":0,"102":0,"103":0,"104":0,"105":0.00399,"106":0.00399,"107":0.01198,"108":0.01997,"109":0.37544,"110":0.45931},E:{"4":0,"5":0,"6":0,"7":0,"8":0,"9":0.00399,"10":0,"11":0,"12":0,"13":0,"14":0.01198,"15":0,_:"0","3.1":0,"3.2":0,"5.1":0,"6.1":0,"7.1":0,"9.1":0,"10.1":0,"11.1":0,"12.1":0.00399,"13.1":0.00799,"14.1":0.01598,"15.1":0.00399,"15.2-15.3":0.00399,"15.4":0.00799,"15.5":0.00799,"15.6":0.0639,"16.0":0.00799,"16.1":0.01997,"16.2":0.0679,"16.3":0.05192,"16.4":0},G:{"8":0.00213,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00107,"5.0-5.1":0.00107,"6.0-6.1":0.00747,"7.0-7.1":0.02347,"8.1-8.4":0.0192,"9.0-9.2":0.00213,"9.3":0.1515,"10.0-10.2":0,"10.3":0.07788,"11.0-11.2":0.02667,"11.3-11.4":0.0032,"12.0-12.1":0.00747,"12.2-12.5":0.25819,"13.0-13.1":0.00427,"13.2":0.00107,"13.3":0.00747,"13.4-13.7":0.03841,"14.0-14.4":0.10242,"14.5-14.8":0.33288,"15.0-15.1":0.04801,"15.2-15.3":0.06935,"15.4":0.08962,"15.5":0.30087,"15.6":0.85353,"16.0":1.18428,"16.1":2.37602,"16.2":2.42083,"16.3":1.46381,"16.4":0.00747},P:{"4":0.45696,"20":1.3201,"5.0-5.4":0.01015,"6.2-6.4":0,"7.2-7.4":0.07108,"8.2":0,"9.2":0.02031,"10.1":0,"11.1-11.2":0.07108,"12.0":0.02031,"13.0":0.05077,"14.0":0.03046,"15.0":0.02031,"16.0":0.05077,"17.0":0.05077,"18.0":0.08124,"19.0":2.24417},I:{"0":0,"3":0,"4":0.01011,"2.1":0,"2.2":0.01348,"2.3":0.00674,"4.1":0.02359,"4.2-4.3":0.02696,"4.4":0,"4.4.3-4.4.4":0.16511},K:{_:"0 10 11 12 11.1 11.5 12.1"},A:{"6":0,"7":0.00399,"8":0.02796,"9":0.00799,"10":0.00399,"11":0.03195,"5.5":0},N:{"10":0.00601,"11":0.00601},S:{"2.5":0,_:"3.0-3.1"},J:{"7":0,"10":0.00601},O:{"0":0.01802},H:{"0":0.23313},L:{"0":66.94695},R:{_:"0"},M:{"0":0.48048},Q:{"13.1":0}};

View File

@@ -0,0 +1,114 @@
/* -*- Mode: js; js-indent-level: 2; -*- */
/*
* Copyright 2011 Mozilla Foundation and contributors
* Licensed under the New BSD license. See LICENSE or:
* http://opensource.org/licenses/BSD-3-Clause
*/
// It turns out that some (most?) JavaScript engines don't self-host
// `Array.prototype.sort`. This makes sense because C++ will likely remain
// faster than JS when doing raw CPU-intensive sorting. However, when using a
// custom comparator function, calling back and forth between the VM's C++ and
// JIT'd JS is rather slow *and* loses JIT type information, resulting in
// worse generated code for the comparator function than would be optimal. In
// fact, when sorting with a comparator, these costs outweigh the benefits of
// sorting in C++. By using our own JS-implemented Quick Sort (below), we get
// a ~3500ms mean speed-up in `bench/bench.html`.
/**
* Swap the elements indexed by `x` and `y` in the array `ary`.
*
* @param {Array} ary
* The array.
* @param {Number} x
* The index of the first item.
* @param {Number} y
* The index of the second item.
*/
function swap(ary, x, y) {
var temp = ary[x];
ary[x] = ary[y];
ary[y] = temp;
}
/**
* Returns a random integer within the range `low .. high` inclusive.
*
* @param {Number} low
* The lower bound on the range.
* @param {Number} high
* The upper bound on the range.
*/
function randomIntInRange(low, high) {
return Math.round(low + (Math.random() * (high - low)));
}
/**
* The Quick Sort algorithm.
*
* @param {Array} ary
* An array to sort.
* @param {function} comparator
* Function to use to compare two items.
* @param {Number} p
* Start index of the array
* @param {Number} r
* End index of the array
*/
function doQuickSort(ary, comparator, p, r) {
// If our lower bound is less than our upper bound, we (1) partition the
// array into two pieces and (2) recurse on each half. If it is not, this is
// the empty array and our base case.
if (p < r) {
// (1) Partitioning.
//
// The partitioning chooses a pivot between `p` and `r` and moves all
// elements that are less than or equal to the pivot to the before it, and
// all the elements that are greater than it after it. The effect is that
// once partition is done, the pivot is in the exact place it will be when
// the array is put in sorted order, and it will not need to be moved
// again. This runs in O(n) time.
// Always choose a random pivot so that an input array which is reverse
// sorted does not cause O(n^2) running time.
var pivotIndex = randomIntInRange(p, r);
var i = p - 1;
swap(ary, pivotIndex, r);
var pivot = ary[r];
// Immediately after `j` is incremented in this loop, the following hold
// true:
//
// * Every element in `ary[p .. i]` is less than or equal to the pivot.
//
// * Every element in `ary[i+1 .. j-1]` is greater than the pivot.
for (var j = p; j < r; j++) {
if (comparator(ary[j], pivot) <= 0) {
i += 1;
swap(ary, i, j);
}
}
swap(ary, i + 1, j);
var q = i + 1;
// (2) Recurse on each half.
doQuickSort(ary, comparator, p, q - 1);
doQuickSort(ary, comparator, q + 1, r);
}
}
/**
* Sort the given array in-place with the given comparator function.
*
* @param {Array} ary
* An array to sort.
* @param {function} comparator
* Function to use to compare two items.
*/
exports.quickSort = function (ary, comparator) {
doQuickSort(ary, comparator, 0, ary.length - 1);
};