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":"interpret","version":"1.4.0","files":{"CHANGELOG":{"checkedAt":1678883672418,"integrity":"sha512-ep0VffGdbwoXXQKH/jH2s2WleQVXSLsjRc+uBSECB00LvpgQ7/hNezDREF0DeU1hYnrBsqw/54VbW3T1f4bW1Q==","mode":420,"size":2364},"LICENSE":{"checkedAt":1678883672418,"integrity":"sha512-fbUi2OSPVijJujoNPa4MMjrntGjuyU8dyN1OD/zj5I0/SHkVoapcy40nrtYVnk/BehgSbb9lfbnMSDwhgLhz+g==","mode":420,"size":1163},"package.json":{"checkedAt":1678883672418,"integrity":"sha512-/rE8Ao94aBDnfB8oviaDcdUAV2K7zzX9TRmpwpfb7T6caG8VNG+ExNA0yc3J3pZmbVezZD+IEt1xc+JnjCXWjQ==","mode":420,"size":1553},"mjs-stub.js":{"checkedAt":1678883672418,"integrity":"sha512-/nlQ5nE6gMUlJGai4MLLmeOkZhStOmR15sENh6+GMqzgrqLIfze2bq0R9rOWaZbTNhHfXjTe1ngUR7YoJeSjAA==","mode":420,"size":35},"index.js":{"checkedAt":1678883672418,"integrity":"sha512-tKC3Jd0YCvaHdDbaQ5dW0tvDCqmjEMJ13D7S1GXpRmIwg/c+K/TGF6aTVP7eINX62G8Q4KHYx+6e6Cc1hVT4jA==","mode":420,"size":3951},"README.md":{"checkedAt":1678883672419,"integrity":"sha512-ofsNpMXfRtisAa0j1HqaF4QmfdRiR+Lnbo/ZVfw6gMARhHI//2TPRWx92szrnJF669wBf0owxCC5vOQ1QZcLWQ==","mode":420,"size":5786}}}

View File

@@ -0,0 +1,23 @@
let Declaration = require('../declaration')
class TextDecorationSkipInk extends Declaration {
/**
* Change prefix for ink value
*/
set(decl, prefix) {
if (decl.prop === 'text-decoration-skip-ink' && decl.value === 'auto') {
decl.prop = prefix + 'text-decoration-skip'
decl.value = 'ink'
return decl
} else {
return super.set(decl, prefix)
}
}
}
TextDecorationSkipInk.names = [
'text-decoration-skip-ink',
'text-decoration-skip'
]
module.exports = TextDecorationSkipInk

View File

@@ -0,0 +1,9 @@
// TODO: consolidate on using a helpers file at some point in the future, which
// is the approach currently used to export Parser and applyExtends for ESM:
const {applyExtends, cjsPlatformShim, Parser, Yargs, processArgv} = require('./build/index.cjs')
Yargs.applyExtends = (config, cwd, mergeExtends) => {
return applyExtends(config, cwd, mergeExtends, cjsPlatformShim)
}
Yargs.hideBin = processArgv.hideBin
Yargs.Parser = Parser
module.exports = Yargs

View File

@@ -0,0 +1,6 @@
export var RangePatternType;
(function (RangePatternType) {
RangePatternType["startRange"] = "startRange";
RangePatternType["shared"] = "shared";
RangePatternType["endRange"] = "endRange";
})(RangePatternType || (RangePatternType = {}));

View File

@@ -0,0 +1,30 @@
var baseGetTag = require('./_baseGetTag'),
isArray = require('./isArray'),
isObjectLike = require('./isObjectLike');
/** `Object#toString` result references. */
var stringTag = '[object String]';
/**
* Checks if `value` is classified as a `String` primitive or object.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a string, else `false`.
* @example
*
* _.isString('abc');
* // => true
*
* _.isString(1);
* // => false
*/
function isString(value) {
return typeof value == 'string' ||
(!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);
}
module.exports = isString;

View File

@@ -0,0 +1,12 @@
import { NumberFormatInternal } from '../types/number';
/**
* The abstract operation ComputeExponent computes an exponent (power of ten) by which to scale x
* according to the number formatting settings. It handles cases such as 999 rounding up to 1000,
* requiring a different exponent.
*
* NOT IN SPEC: it returns [exponent, magnitude].
*/
export declare function ComputeExponent(numberFormat: Intl.NumberFormat, x: number, { getInternalSlots, }: {
getInternalSlots(nf: Intl.NumberFormat): NumberFormatInternal;
}): [number, number];
//# sourceMappingURL=ComputeExponent.d.ts.map

View File

@@ -0,0 +1,2 @@
declare function coerceToNumber(value: any): number | null;
export default coerceToNumber;

View File

@@ -0,0 +1,7 @@
/**
* https://tc39.es/ecma402/#sec-currencydigits
*/
export declare function CurrencyDigits(c: string, { currencyDigitsData }: {
currencyDigitsData: Record<string, number>;
}): number;
//# sourceMappingURL=CurrencyDigits.d.ts.map

View File

@@ -0,0 +1,18 @@
{
"extends": "@ljharb",
"root": true,
"rules": {
"func-style": 1,
},
"overrides": [
{
"files": "test/**",
"rules": {
"global-require": 0,
"max-depth": 0,
"max-lines-per-function": 0,
"no-negated-condition": 0,
},
},
],
}

View File

@@ -0,0 +1,59 @@
'use strict';
function isNothing(subject) {
return (typeof subject === 'undefined') || (subject === null);
}
function isObject(subject) {
return (typeof subject === 'object') && (subject !== null);
}
function toArray(sequence) {
if (Array.isArray(sequence)) return sequence;
else if (isNothing(sequence)) return [];
return [ sequence ];
}
function extend(target, source) {
var index, length, key, sourceKeys;
if (source) {
sourceKeys = Object.keys(source);
for (index = 0, length = sourceKeys.length; index < length; index += 1) {
key = sourceKeys[index];
target[key] = source[key];
}
}
return target;
}
function repeat(string, count) {
var result = '', cycle;
for (cycle = 0; cycle < count; cycle += 1) {
result += string;
}
return result;
}
function isNegativeZero(number) {
return (number === 0) && (Number.NEGATIVE_INFINITY === 1 / number);
}
module.exports.isNothing = isNothing;
module.exports.isObject = isObject;
module.exports.toArray = toArray;
module.exports.repeat = repeat;
module.exports.isNegativeZero = isNegativeZero;
module.exports.extend = extend;

View File

@@ -0,0 +1,49 @@
{
"name": "svelte-select",
"version": "3.17.0",
"repository": "https://rob-balfre@github.com/rob-balfre/svelte-select.git",
"description": "A <Select> component for Svelte apps",
"svelte": "src/Select.svelte",
"module": "index.mjs",
"main": "index.js",
"scripts": {
"build": "rollup -c",
"dev": "rollup -cw",
"prepublishOnly": "npm test",
"test": "node test/runner.js",
"test:browser": "npm run build && serve test/public",
"gen:docs": "node docs/generate_theming_variables_md.js",
"pretest": "npm run build"
},
"devDependencies": {
"@babel/polyfill": "7.0.0",
"find-in-files": "^0.5.0",
"namey-mcnameface": "^1.0.3",
"port-authority": "^1.0.5",
"puppeteer": "^1.9.0",
"require-nocache": "1.0.0",
"rollup": "^0.66.6",
"rollup-plugin-commonjs": "^9.2.0",
"rollup-plugin-html": "^0.2.1",
"rollup-plugin-node-resolve": "^4.0.0",
"rollup-plugin-svelte": "^6.1.1",
"sirv": "^0.2.2",
"svelte": "^3.31.0",
"tap-diff": "^0.1.1",
"tap-dot": "^2.0.0",
"tape-modern": "^1.1.1"
},
"author": "rob-balfre",
"license": "LIL",
"keywords": [
"svelte"
],
"files": [
"src",
"index.mjs",
"index.js",
"index.d.ts",
"Select.js"
],
"dependencies": {}
}

View File

@@ -0,0 +1 @@
module.exports={A:{A:{"2":"J D E F A B CC"},B:{"1":"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 K L G M N"},C:{"1":"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 EC FC","8":"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 NB OB PB QB RB SB TB UB VB WB XB YB uB ZB vB aB bB cB"},D:{"1":"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 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","8":"J D E","132":"F A B C K L G M N O w g x y","260":"0 1 2 3 4 5 6 7 z"},E:{"1":"sB 6B 7B 8B 9B OC","2":"I v J D E F A B C K HC zB IC JC KC LC 0B qB rB 1B","516":"L G MC NC 2B 3B 4B 5B"},F:{"1":"0 1 2 3 4 5 6 7 8 9 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 PC QC RC","8":"B SC","132":"qB AC TC","260":"C G M N O rB"},G:{"1":"lC mC nC 2B 3B 4B 5B sB 6B 7B 8B 9B","2":"E zB UC BC VC WC XC YC ZC aC bC cC dC eC fC gC hC iC jC kC"},H:{"1":"oC"},I:{"1":"f BC tC uC","2":"tB pC qC rC","132":"I sC"},J:{"2":"D A"},K:{"1":"C h qB AC rB","2":"A","132":"B"},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","8":"AD"}},B:6,C:"WebP image format"};

View File

@@ -0,0 +1,75 @@
{
"name": "minimist",
"version": "1.2.8",
"description": "parse argument options",
"main": "index.js",
"devDependencies": {
"@ljharb/eslint-config": "^21.0.1",
"aud": "^2.0.2",
"auto-changelog": "^2.4.0",
"eslint": "=8.8.0",
"in-publish": "^2.0.1",
"npmignore": "^0.3.0",
"nyc": "^10.3.2",
"safe-publish-latest": "^2.0.0",
"tape": "^5.6.3"
},
"scripts": {
"prepack": "npmignore --auto --commentLines=auto",
"prepublishOnly": "safe-publish-latest",
"prepublish": "not-in-publish || npm run prepublishOnly",
"lint": "eslint --ext=js,mjs .",
"pretest": "npm run lint",
"tests-only": "nyc tape 'test/**/*.js'",
"test": "npm run tests-only",
"posttest": "aud --production",
"version": "auto-changelog && git add CHANGELOG.md",
"postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\""
},
"testling": {
"files": "test/*.js",
"browsers": [
"ie/6..latest",
"ff/5",
"firefox/latest",
"chrome/10",
"chrome/latest",
"safari/5.1",
"safari/latest",
"opera/12"
]
},
"repository": {
"type": "git",
"url": "git://github.com/minimistjs/minimist.git"
},
"homepage": "https://github.com/minimistjs/minimist",
"keywords": [
"argv",
"getopt",
"parser",
"optimist"
],
"author": {
"name": "James Halliday",
"email": "mail@substack.net",
"url": "http://substack.net"
},
"funding": {
"url": "https://github.com/sponsors/ljharb"
},
"license": "MIT",
"auto-changelog": {
"output": "CHANGELOG.md",
"template": "keepachangelog",
"unreleased": false,
"commitLimit": false,
"backfillLimit": false,
"hideCredit": true
},
"publishConfig": {
"ignore": [
".github/workflows"
]
}
}

View File

@@ -0,0 +1 @@
module.exports={A:{A:{"2":"J D E F A B CC"},B:{"1":"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 K L G M"},C:{"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 RB SB EC FC","4609":"aB bB cB dB eB fB gB hB iB","4674":"vB","5698":"ZB","7490":"TB UB VB WB XB","7746":"YB uB","8705":"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"},D:{"1":"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 FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB","4097":"eB","4290":"uB ZB vB","6148":"aB bB cB dB"},E:{"1":"G NC 2B 3B 4B 5B sB 6B 7B 8B 9B OC","2":"I v J D E F A HC zB IC JC KC LC 0B","4609":"B C qB rB","8193":"K L 1B MC"},F:{"1":"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 2 3 4 5 6 7 8 9 F B C G M N O w g x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PC QC RC SC qB AC TC rB","4097":"TB","6148":"PB QB RB SB"},G:{"1":"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 bC cC","4097":"dC eC fC gC"},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:{"4097":"H"},N:{"2":"A B"},O:{"1":"vC"},P:{"2":"I wC xC yC","4097":"g zC 0C 0B 1C 2C 3C 4C 5C sB 6C 7C 8C"},Q:{"1":"1B"},R:{"1":"9C"},S:{"1":"BD","2":"AD"}},B:5,C:"Variable fonts"};

View File

@@ -0,0 +1,88 @@
data-uri-to-buffer
==================
### Generate a Buffer instance from a [Data URI][rfc] string
[![Build Status](https://travis-ci.org/TooTallNate/node-data-uri-to-buffer.svg?branch=master)](https://travis-ci.org/TooTallNate/node-data-uri-to-buffer)
This module accepts a ["data" URI][rfc] String of data, and returns a
node.js `Buffer` instance with the decoded data.
Installation
------------
Install with `npm`:
``` bash
$ npm install data-uri-to-buffer
```
Example
-------
``` js
import dataUriToBuffer from 'data-uri-to-buffer';
// plain-text data is supported
let uri = 'data:,Hello%2C%20World!';
let decoded = dataUriToBuffer(uri);
console.log(decoded.toString());
// 'Hello, World!'
// base64-encoded data is supported
uri = 'data:text/plain;base64,SGVsbG8sIFdvcmxkIQ%3D%3D';
decoded = dataUriToBuffer(uri);
console.log(decoded.toString());
// 'Hello, World!'
```
API
---
### dataUriToBuffer(String uri) → Buffer
The `type` property on the Buffer instance gets set to the main type portion of
the "mediatype" portion of the "data" URI, or defaults to `"text/plain"` if not
specified.
The `typeFull` property on the Buffer instance gets set to the entire
"mediatype" portion of the "data" URI (including all parameters), or defaults
to `"text/plain;charset=US-ASCII"` if not specified.
The `charset` property on the Buffer instance gets set to the Charset portion of
the "mediatype" portion of the "data" URI, or defaults to `"US-ASCII"` if the
entire type is not specified, or defaults to `""` otherwise.
*Note*: If the only the main type is specified but not the charset, e.g.
`"data:text/plain,abc"`, the charset is set to the empty string. The spec only
defaults to US-ASCII as charset if the entire type is not specified.
License
-------
(The MIT License)
Copyright (c) 2014 Nathan Rajlich &lt;nathan@tootallnate.net&gt;
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.
[rfc]: http://tools.ietf.org/html/rfc2397

View File

@@ -0,0 +1,41 @@
var arrayMap = require('./_arrayMap'),
baseIntersection = require('./_baseIntersection'),
baseRest = require('./_baseRest'),
castArrayLikeObject = require('./_castArrayLikeObject'),
last = require('./last');
/**
* This method is like `_.intersection` except that it accepts `comparator`
* which is invoked to compare elements of `arrays`. The order and references
* of result values are determined by the first array. The comparator is
* invoked with two arguments: (arrVal, othVal).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Array
* @param {...Array} [arrays] The arrays to inspect.
* @param {Function} [comparator] The comparator invoked per element.
* @returns {Array} Returns the new array of intersecting values.
* @example
*
* var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
* var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
*
* _.intersectionWith(objects, others, _.isEqual);
* // => [{ 'x': 1, 'y': 2 }]
*/
var intersectionWith = baseRest(function(arrays) {
var comparator = last(arrays),
mapped = arrayMap(arrays, castArrayLikeObject);
comparator = typeof comparator == 'function' ? comparator : undefined;
if (comparator) {
mapped.pop();
}
return (mapped.length && mapped[0] === arrays[0])
? baseIntersection(mapped, undefined, comparator)
: [];
});
module.exports = intersectionWith;

View File

@@ -0,0 +1,36 @@
import { __extends } from "tslib";
import { AsyncAction } from './AsyncAction';
import { immediateProvider } from './immediateProvider';
var AsapAction = (function (_super) {
__extends(AsapAction, _super);
function AsapAction(scheduler, work) {
var _this = _super.call(this, scheduler, work) || this;
_this.scheduler = scheduler;
_this.work = work;
return _this;
}
AsapAction.prototype.requestAsyncId = function (scheduler, id, delay) {
if (delay === void 0) { delay = 0; }
if (delay !== null && delay > 0) {
return _super.prototype.requestAsyncId.call(this, scheduler, id, delay);
}
scheduler.actions.push(this);
return scheduler._scheduled || (scheduler._scheduled = immediateProvider.setImmediate(scheduler.flush.bind(scheduler, undefined)));
};
AsapAction.prototype.recycleAsyncId = function (scheduler, id, delay) {
var _a;
if (delay === void 0) { delay = 0; }
if (delay != null ? delay > 0 : this.delay > 0) {
return _super.prototype.recycleAsyncId.call(this, scheduler, id, delay);
}
var actions = scheduler.actions;
if (id != null && ((_a = actions[actions.length - 1]) === null || _a === void 0 ? void 0 : _a.id) !== id) {
immediateProvider.clearImmediate(id);
scheduler._scheduled = undefined;
}
return undefined;
};
return AsapAction;
}(AsyncAction));
export { AsapAction };
//# sourceMappingURL=AsapAction.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"IsWellFormedUnitIdentifier.d.ts","sourceRoot":"","sources":["../../../../../../packages/ecma402-abstract/IsWellFormedUnitIdentifier.ts"],"names":[],"mappings":"AAUA;;;GAGG;AACH,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,MAAM,WAiBtD"}

View File

@@ -0,0 +1,62 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "default", {
enumerable: true,
get: ()=>processTailwindFeatures
});
const _normalizeTailwindDirectives = /*#__PURE__*/ _interopRequireDefault(require("./lib/normalizeTailwindDirectives"));
const _expandTailwindAtRules = /*#__PURE__*/ _interopRequireDefault(require("./lib/expandTailwindAtRules"));
const _expandApplyAtRules = /*#__PURE__*/ _interopRequireDefault(require("./lib/expandApplyAtRules"));
const _evaluateTailwindFunctions = /*#__PURE__*/ _interopRequireDefault(require("./lib/evaluateTailwindFunctions"));
const _substituteScreenAtRules = /*#__PURE__*/ _interopRequireDefault(require("./lib/substituteScreenAtRules"));
const _resolveDefaultsAtRules = /*#__PURE__*/ _interopRequireDefault(require("./lib/resolveDefaultsAtRules"));
const _collapseAdjacentRules = /*#__PURE__*/ _interopRequireDefault(require("./lib/collapseAdjacentRules"));
const _collapseDuplicateDeclarations = /*#__PURE__*/ _interopRequireDefault(require("./lib/collapseDuplicateDeclarations"));
const _partitionApplyAtRules = /*#__PURE__*/ _interopRequireDefault(require("./lib/partitionApplyAtRules"));
const _detectNesting = /*#__PURE__*/ _interopRequireDefault(require("./lib/detectNesting"));
const _setupContextUtils = require("./lib/setupContextUtils");
const _featureFlags = require("./featureFlags");
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
function processTailwindFeatures(setupContext) {
return function(root, result) {
let { tailwindDirectives , applyDirectives } = (0, _normalizeTailwindDirectives.default)(root);
(0, _detectNesting.default)()(root, result);
// Partition apply rules that are found in the css
// itself.
(0, _partitionApplyAtRules.default)()(root, result);
let context = setupContext({
tailwindDirectives,
applyDirectives,
registerDependency (dependency) {
result.messages.push({
plugin: "tailwindcss",
parent: result.opts.from,
...dependency
});
},
createContext (tailwindConfig, changedContent) {
return (0, _setupContextUtils.createContext)(tailwindConfig, changedContent, root);
}
})(root, result);
if (context.tailwindConfig.separator === "-") {
throw new Error("The '-' character cannot be used as a custom separator in JIT mode due to parsing ambiguity. Please use another character like '_' instead.");
}
(0, _featureFlags.issueFlagNotices)(context.tailwindConfig);
(0, _expandTailwindAtRules.default)(context)(root, result);
// Partition apply rules that are generated by
// addComponents, addUtilities and so on.
(0, _partitionApplyAtRules.default)()(root, result);
(0, _expandApplyAtRules.default)(context)(root, result);
(0, _evaluateTailwindFunctions.default)(context)(root, result);
(0, _substituteScreenAtRules.default)(context)(root, result);
(0, _resolveDefaultsAtRules.default)(context)(root, result);
(0, _collapseAdjacentRules.default)(context)(root, result);
(0, _collapseDuplicateDeclarations.default)(context)(root, result);
};
}

View File

@@ -0,0 +1,88 @@
{
"name": "rechoir",
"description": "Require any supported file as a node module.",
"version": "0.6.2",
"homepage": "https://github.com/tkellen/node-rechoir",
"author": {
"name": "Tyler Kellen",
"url": "http://goingslowly.com/"
},
"repository": {
"type": "git",
"url": "git://github.com/tkellen/node-rechoir.git"
},
"bugs": {
"url": "https://github.com/tkellen/node-rechoir/issues"
},
"licenses": [
{
"type": "MIT",
"url": "https://github.com/tkellen/node-rechoir/blob/master/LICENSE"
}
],
"main": "index.js",
"engines": {
"node": ">= 0.10"
},
"scripts": {
"test": "mocha -R spec test/index.js"
},
"dependencies": {
"resolve": "^1.1.6"
},
"devDependencies": {
"babel": "^5.4.3",
"chai": "^2.3.0",
"coco": "^0.9.1",
"coffee-script": "^1.9.2",
"earlgrey": "0.0.9",
"iced-coffee-script": "^1.8.0-d",
"interpret": "^0.6.1",
"json5": "^0.4.0",
"livescript": "^1.4.0",
"mocha": "^2.2.5",
"node-jsx": "^0.13.3",
"require-csv": "0.0.1",
"require-ini": "0.0.1",
"require-uncached": "^1.0.2",
"require-xml": "0.0.1",
"require-yaml": "0.0.1",
"rimraf": "^2.3.4",
"semver": "^4.3.4",
"sinon": "^1.14.1",
"toml-require": "^1.0.1",
"typescript-register": "^1.1.0"
},
"keywords": [
"require",
"cjsx",
"co",
"coco",
"coffee-script",
"coffee",
"coffee.md",
"csv",
"earlgrey",
"es",
"es6",
"iced",
"iced.md",
"iced-coffee-script",
"ini",
"js",
"json",
"json5",
"jsx",
"react",
"litcoffee",
"liticed",
"ls",
"livescript",
"toml",
"ts",
"typescript",
"xml",
"yaml",
"yml"
]
}

View File

@@ -0,0 +1,97 @@
pac-resolver
============
### Generates an asynchronous resolver function from a [PAC file][pac-wikipedia]
[![Build Status](https://github.com/TooTallNate/node-pac-resolver/workflows/Node%20CI/badge.svg)](https://github.com/TooTallNate/node-pac-resolver/actions?workflow=Node+CI)
This module accepts a JavaScript String of code, which is meant to be a
[PAC proxy file][pac-wikipedia], and returns a generated asynchronous
`FindProxyForURL()` function.
Installation
------------
Install with `npm`:
```bash
$ npm install pac-resolver
```
Example
-------
Given the PAC proxy file named `proxy.pac`:
```js
function FindProxyForURL(url, host) {
if (isInNet(myIpAddress(), "10.1.10.0", "255.255.255.0")) {
return "PROXY 1.2.3.4:8080";
} else {
return "DIRECT";
}
}
```
You can consume this PAC file with `pac-resolver` like so:
```js
var fs = require('fs');
var pac = require('pac-resolver');
var FindProxyForURL = pac(fs.readFileSync('proxy.pac'));
FindProxyForURL('http://foo.com/').then((res) => {
console.log(res);
// "DIRECT"
});
```
API
---
### pac(String pacFileContents[, Object options]) → Function
Returns an asynchronous `FindProxyForURL()` function based off of the given JS
string `pacFileContents` PAC proxy file. An optional `options` object may be
passed in which respects the following options:
* `filename` - String - the filename to use in error stack traces. Defaults to `proxy.pac`.
* `sandbox` - Object - a map of functions to include in the sandbox of the
JavaScript environment where the JS code will be executed. i.e. if you wanted to
include the common `alert` function you could pass `alert: console.log`. For
async functions, you must set the `async = true` property on the function
instance, and the JS code will be able to invoke the function as if it were
synchronous.
License
-------
(The MIT License)
Copyright (c) 2013 Nathan Rajlich &lt;nathan@tootallnate.net&gt;
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.
[pac-file-docs]: https://web.archive.org/web/20070602031929/http://wp.netscape.com/eng/mozilla/2.0/relnotes/demo/proxy-live.html
[pac-wikipedia]: http://wikipedia.org/wiki/Proxy_auto-config

View File

@@ -0,0 +1,25 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = isWhitelisted;
var _assertString = _interopRequireDefault(require("./util/assertString"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function isWhitelisted(str, chars) {
(0, _assertString.default)(str);
for (var i = str.length - 1; i >= 0; i--) {
if (chars.indexOf(str[i]) === -1) {
return false;
}
}
return true;
}
module.exports = exports.default;
module.exports.default = exports.default;

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,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0.01303,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0.00434,"49":0,"50":0,"51":0,"52":0.01303,"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.00434,"67":0,"68":0,"69":0,"70":0,"71":0,"72":0,"73":0,"74":0,"75":0,"76":0,"77":0,"78":0.00868,"79":0,"80":0,"81":0,"82":0.00434,"83":0,"84":0,"85":0,"86":0,"87":0,"88":0,"89":0,"90":0,"91":0,"92":0,"93":0,"94":0,"95":0,"96":0,"97":0,"98":0,"99":0.00434,"100":0.00434,"101":0.00868,"102":0.01303,"103":0.00434,"104":0.00434,"105":0.02605,"106":0.00434,"107":0.00868,"108":0.01303,"109":0.55578,"110":0.36039,"111":0.00434,"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,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0.01303,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0.00434,"49":0.01303,"50":0,"51":0,"52":0,"53":0.00434,"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.00434,"67":0.01303,"68":0,"69":0.01737,"70":0.00434,"71":0,"72":0,"73":0,"74":0.00868,"75":0.00434,"76":0,"77":0.00434,"78":0.00434,"79":0.00434,"80":0.00434,"81":0.00868,"83":0.00434,"84":0,"85":0.00434,"86":0.00868,"87":0.01737,"88":0.01303,"89":0.00434,"90":0.01303,"91":0.00434,"92":0.00868,"93":0.00434,"94":0.00434,"95":0.01303,"96":0.00868,"97":0.00434,"98":0.02171,"99":0.00434,"100":0.03474,"101":0.02171,"102":0.01303,"103":0.03474,"104":0.01737,"105":0.01303,"106":0.01737,"107":0.04342,"108":0.18236,"109":6.54339,"110":3.9903,"111":0.00434,"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.01303,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0.00434,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"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.00868,"62":0,"63":0.00868,"64":0.00434,"65":0,"66":0.01737,"67":0.20407,"68":0,"69":0,"70":0,"71":0,"72":0,"73":0,"74":0.00434,"75":0,"76":0,"77":0,"78":0,"79":0.00434,"80":0,"81":0,"82":0,"83":0,"84":0,"85":0.01303,"86":0.00434,"87":0,"88":0,"89":0.00434,"90":0,"91":0,"92":0,"93":0.00868,"94":0.1346,"95":0.2692,"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.00868,"13":0.00434,"14":0.00434,"15":0.00868,"16":0.01737,"17":0.00434,"18":0.02605,"79":0,"80":0,"81":0,"83":0,"84":0.00434,"85":0,"86":0,"87":0,"88":0,"89":0,"90":0.00434,"91":0,"92":0.06947,"93":0,"94":0,"95":0.00434,"96":0.00434,"97":0.00434,"98":0,"99":0.00434,"100":0.00434,"101":0.04776,"102":0.02171,"103":0.00434,"104":0,"105":0.06947,"106":0.00868,"107":0.0521,"108":0.0521,"109":1.19405,"110":1.41549},E:{"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0.00434,"14":0.01303,"15":0,_:"0","3.1":0,"3.2":0,"5.1":0.00434,"6.1":0,"7.1":0,"9.1":0,"10.1":0,"11.1":0,"12.1":0.00434,"13.1":0.02171,"14.1":0.04342,"15.1":0.02605,"15.2-15.3":0.00868,"15.4":0.03474,"15.5":0.02171,"15.6":0.19105,"16.0":0.01303,"16.1":0.03908,"16.2":0.09987,"16.3":0.06947,"16.4":0},G:{"8":0.00124,"3.2":0,"4.0-4.1":0,"4.2-4.3":0,"5.0-5.1":0.0261,"6.0-6.1":0.01864,"7.0-7.1":0.01367,"8.1-8.4":0.00746,"9.0-9.2":0,"9.3":0.05468,"10.0-10.2":0,"10.3":0.06586,"11.0-11.2":0,"11.3-11.4":0,"12.0-12.1":0.00497,"12.2-12.5":1.2278,"13.0-13.1":0.02113,"13.2":0,"13.3":0.04598,"13.4-13.7":0.02983,"14.0-14.4":0.44489,"14.5-14.8":0.46602,"15.0-15.1":0.23984,"15.2-15.3":0.25973,"15.4":0.12676,"15.5":0.24482,"15.6":0.69344,"16.0":1.15573,"16.1":2.34128,"16.2":2.1586,"16.3":1.38563,"16.4":0.00373},P:{"4":0.45754,"20":0.90492,"5.0-5.4":0.01017,"6.2-6.4":0.02034,"7.2-7.4":0.26436,"8.2":0,"9.2":0,"10.1":0.0305,"11.1-11.2":0.01017,"12.0":0.01017,"13.0":0.02034,"14.0":0.05084,"15.0":0.02034,"16.0":0.09151,"17.0":0.24402,"18.0":0.12201,"19.0":1.8505},I:{"0":0,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0.00215,"4.2-4.3":0.0158,"4.4":0,"4.4.3-4.4.4":0.09981},K:{_:"0 10 11 12 11.1 11.5 12.1"},A:{"6":0,"7":0,"8":0,"9":0,"10":0,"11":0.0825,"5.5":0},N:{"10":0,"11":0},S:{"2.5":0.01132,_:"3.0-3.1"},J:{"7":0,"10":0},O:{"0":0.58277},H:{"0":1.22131},L:{"0":63.23517},R:{_:"0"},M:{"0":0.2829},Q:{"13.1":0.01132}};

View File

@@ -0,0 +1 @@
{"name":"html-minifier","version":"4.0.0","files":{"package.json":{"checkedAt":1678883670323,"integrity":"sha512-8xH5/D5KyDD4HBaWzoXJT2Zc/uxBCivFJOkeJOJe1xvNuhfXt4vtN/ohhh0R5h9K7K9+7nryEW1pCI5vPztw4g==","mode":438,"size":1908},"cli.js":{"checkedAt":1678883670323,"integrity":"sha512-nVLH+XDQuF8z+qWVmAYTJcMFpJtSgx1ZGZKFtNDlwN5MMrkV2TjAxLn7yju6jxvZ438H5CQalvgFQnApLWW+kA==","mode":438,"size":11719},"LICENSE":{"checkedAt":1678883670329,"integrity":"sha512-eTfFX3TuMmm/hJorHCd+2lJCLEojKch3waYoEliMhDdUARkbAyfuur7+zhrkXNzhFtJ0DTB64QQhiuMNU8RywA==","mode":438,"size":1071},"README.md":{"checkedAt":1678883670329,"integrity":"sha512-WtiR34kIpjcRh9uQqvTT20e3bkL4wsDjXola3N3ZnfHoeqNKDNub6TQMOBmOMyy+GjWp/dk2f0IMpmHIJwZL4g==","mode":438,"size":12982},"sample-cli-config-file.conf":{"checkedAt":1678883670329,"integrity":"sha512-MX2TBeo2L5UgDB4kSf4emzLbZtfxrCfFy+7cMmekCe6M+V/mKVqrcbja07yghjgNouvVXm0HzvVi8CkXT0J8Gw==","mode":438,"size":1065},"src/htmlminifier.js":{"checkedAt":1678883670341,"integrity":"sha512-ar1mhiflKuJar0W7izP51BG1qf789TBTCDTLT8idqC3QjL9W7FA/Qt+qHrG+QAdYM450qRcCn79QMDlSgyYeUQ==","mode":438,"size":45860},"src/tokenchain.js":{"checkedAt":1678883670348,"integrity":"sha512-xOGqWxfiW4bm+3Br4vBnJwQTDrTLHMaaHVqw5tV/W0fWxKSCiL5nKTlH02TliqhybRfNVSaGPn7jbDB2so0U8A==","mode":438,"size":1813},"src/htmlparser.js":{"checkedAt":1678883670348,"integrity":"sha512-OQibjSIn5nj5cTQoLG7NTvxjG1YxK60MsiuGs52u+cSKt44V6jekmvuKLBz/xzhkdVMFLXXtXs5mHVCNysKvtQ==","mode":438,"size":19975},"src/utils.js":{"checkedAt":1678883670348,"integrity":"sha512-qyt0KF5kNMuI6Byo2AvfPF0/KIrfyJdUg4nFgrpTv6coPW4uO7A7Oa0/Rll9bgZYpynjOf8dd36ioW67jXIeEA==","mode":438,"size":423}}}

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,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0.00514,"44":0,"45":0,"46":0,"47":0.00171,"48":0,"49":0,"50":0,"51":0,"52":0.00171,"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.00171,"66":0,"67":0,"68":0.00514,"69":0,"70":0,"71":0,"72":0.00171,"73":0,"74":0,"75":0,"76":0,"77":0,"78":0.00171,"79":0,"80":0,"81":0,"82":0,"83":0,"84":0,"85":0,"86":0,"87":0,"88":0,"89":0,"90":0,"91":0.00171,"92":0,"93":0,"94":0,"95":0,"96":0.00171,"97":0.00171,"98":0.00171,"99":0.00343,"100":0.00686,"101":0.00171,"102":0.00686,"103":0.00171,"104":0.00343,"105":0.00343,"106":0.00514,"107":0.00514,"108":0.01371,"109":0.1714,"110":0.10284,"111":0.00343,"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.00343,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0.00171,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0.00514,"48":0,"49":0,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0.00343,"56":0.00171,"57":0,"58":0.00343,"59":0,"60":0,"61":0,"62":0.00171,"63":0,"64":0.00343,"65":0,"66":0,"67":0,"68":0.00171,"69":0.00171,"70":0.00343,"71":0,"72":0.00171,"73":0.00171,"74":0.00343,"75":0.00171,"76":0.00171,"77":0.00514,"78":0,"79":0.00514,"80":0.00514,"81":0.01028,"83":0.00171,"84":0.00171,"85":0.00514,"86":0.00343,"87":0.00343,"88":0.00343,"89":0.00171,"90":0.00171,"91":0.00686,"92":0.00171,"93":0.00686,"94":0.00514,"95":0.00686,"96":0.00171,"97":0.00343,"98":0.00171,"99":0.00171,"100":0.00514,"101":0.00171,"102":0.00857,"103":0.01028,"104":0.00686,"105":0.01028,"106":0.00857,"107":0.01714,"108":0.04628,"109":0.82786,"110":0.37194,"111":0.00171,"112":0,"113":0},F:{"9":0,"11":0,"12":0.00171,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0.00171,"24":0.02571,"25":0,"26":0.01371,"27":0.02914,"28":0.01885,"29":0.00343,"30":0.02571,"31":0.01028,"32":0.02571,"33":0.012,"34":0,"35":0.00171,"36":0.00514,"37":0.00343,"38":0.01371,"39":0.00171,"40":0,"41":0.00171,"42":0.02228,"43":0,"44":0.00171,"45":0.00514,"46":0.01543,"47":0.00514,"48":0,"49":0,"50":0.01543,"51":0.01028,"52":0,"53":0.00171,"54":0.01543,"55":0.012,"56":0.00343,"57":0.01543,"58":0.03771,"60":0.23996,"62":0.00343,"63":0.26396,"64":0.07199,"65":0.03257,"66":0.36508,"67":0.49535,"68":0,"69":0.00343,"70":0.00686,"71":0.00514,"72":0.01371,"73":0.04114,"74":0.00514,"75":0,"76":0,"77":0,"78":0,"79":0.00171,"80":0,"81":0,"82":0,"83":0,"84":0,"85":0.00171,"86":0,"87":0,"88":0.00171,"89":0,"90":0.00171,"91":0,"92":0.00343,"93":0.00171,"94":0.02914,"95":0.03085,"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.03942},B:{"12":0.00343,"13":0,"14":0,"15":0.00171,"16":0,"17":0,"18":0.00514,"79":0,"80":0,"81":0,"83":0,"84":0.00171,"85":0,"86":0,"87":0,"88":0,"89":0,"90":0,"91":0,"92":0.00343,"93":0,"94":0,"95":0,"96":0,"97":0,"98":0,"99":0,"100":0,"101":0.00171,"102":0,"103":0,"104":0.00171,"105":0.00171,"106":0.00171,"107":0.00343,"108":0.012,"109":0.09084,"110":0.08399},E:{"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0.00171,"14":0.00343,"15":0,_:"0","3.1":0,"3.2":0,"5.1":0.00343,"6.1":0,"7.1":0,"9.1":0,"10.1":0,"11.1":0,"12.1":0,"13.1":0.00343,"14.1":0.00514,"15.1":0.00171,"15.2-15.3":0.00171,"15.4":0.00171,"15.5":0.00171,"15.6":0.01028,"16.0":0.00171,"16.1":0.00514,"16.2":0.00857,"16.3":0.00686,"16.4":0},G:{"8":0.00241,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00241,"5.0-5.1":0.0012,"6.0-6.1":0.0012,"7.0-7.1":0.00602,"8.1-8.4":0,"9.0-9.2":0,"9.3":0.01807,"10.0-10.2":0.00241,"10.3":0.03614,"11.0-11.2":0.00964,"11.3-11.4":0.00482,"12.0-12.1":0.06987,"12.2-12.5":0.97697,"13.0-13.1":0.04698,"13.2":0.02048,"13.3":0.07951,"13.4-13.7":0.16865,"14.0-14.4":0.91554,"14.5-14.8":0.93722,"15.0-15.1":0.50114,"15.2-15.3":0.51198,"15.4":0.38669,"15.5":0.65292,"15.6":0.78664,"16.0":1.33355,"16.1":1.22031,"16.2":1.52991,"16.3":0.95168,"16.4":0.00361},P:{"4":0.04153,"20":0.12458,"5.0-5.4":0,"6.2-6.4":0,"7.2-7.4":0.05191,"8.2":0,"9.2":0.03114,"10.1":0,"11.1-11.2":0.02076,"12.0":0,"13.0":0.02076,"14.0":0.02076,"15.0":0.02076,"16.0":0.05191,"17.0":0.04153,"18.0":0.06229,"19.0":0.41525},I:{"0":0,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0.00356,"4.4":0,"4.4.3-4.4.4":0.04844},K:{_:"0 10 11 12 11.1 11.5 12.1"},A:{"6":0,"7":0,"8":0,"9":0,"10":0,"11":0.00514,"5.5":0},N:{"10":0,"11":0},S:{"2.5":0.04972,_:"3.0-3.1"},J:{"7":0,"10":0.00829},O:{"0":1.20976},H:{"0":26.79732},L:{"0":50.26306},R:{_:"0"},M:{"0":0.33144},Q:{"13.1":0.00829}};

View File

@@ -0,0 +1,227 @@
# rc
The non-configurable configuration loader for lazy people.
## Usage
The only option is to pass rc the name of your app, and your default configuration.
```javascript
var conf = require('rc')(appname, {
//defaults go here.
port: 2468,
//defaults which are objects will be merged, not replaced
views: {
engine: 'jade'
}
});
```
`rc` will return your configuration options merged with the defaults you specify.
If you pass in a predefined defaults object, it will be mutated:
```javascript
var conf = {};
require('rc')(appname, conf);
```
If `rc` finds any config files for your app, the returned config object will have
a `configs` array containing their paths:
```javascript
var appCfg = require('rc')(appname, conf);
appCfg.configs[0] // /etc/appnamerc
appCfg.configs[1] // /home/dominictarr/.config/appname
appCfg.config // same as appCfg.configs[appCfg.configs.length - 1]
```
## Standards
Given your application name (`appname`), rc will look in all the obvious places for configuration.
* command line arguments, parsed by minimist _(e.g. `--foo baz`, also nested: `--foo.bar=baz`)_
* environment variables prefixed with `${appname}_`
* or use "\_\_" to indicate nested properties <br/> _(e.g. `appname_foo__bar__baz` => `foo.bar.baz`)_
* if you passed an option `--config file` then from that file
* a local `.${appname}rc` or the first found looking in `./ ../ ../../ ../../../` etc.
* `$HOME/.${appname}rc`
* `$HOME/.${appname}/config`
* `$HOME/.config/${appname}`
* `$HOME/.config/${appname}/config`
* `/etc/${appname}rc`
* `/etc/${appname}/config`
* the defaults object you passed in.
All configuration sources that were found will be flattened into one object,
so that sources **earlier** in this list override later ones.
## Configuration File Formats
Configuration files (e.g. `.appnamerc`) may be in either [json](http://json.org/example) or [ini](http://en.wikipedia.org/wiki/INI_file) format. **No** file extension (`.json` or `.ini`) should be used. The example configurations below are equivalent:
#### Formatted as `ini`
```
; You can include comments in `ini` format if you want.
dependsOn=0.10.0
; `rc` has built-in support for ini sections, see?
[commands]
www = ./commands/www
console = ./commands/repl
; You can even do nested sections
[generators.options]
engine = ejs
[generators.modules]
new = generate-new
engine = generate-backend
```
#### Formatted as `json`
```javascript
{
// You can even comment your JSON, if you want
"dependsOn": "0.10.0",
"commands": {
"www": "./commands/www",
"console": "./commands/repl"
},
"generators": {
"options": {
"engine": "ejs"
},
"modules": {
"new": "generate-new",
"backend": "generate-backend"
}
}
}
```
Comments are stripped from JSON config via [strip-json-comments](https://github.com/sindresorhus/strip-json-comments).
> Since ini, and env variables do not have a standard for types, your application needs be prepared for strings.
To ensure that string representations of booleans and numbers are always converted into their proper types (especially useful if you intend to do strict `===` comparisons), consider using a module such as [parse-strings-in-object](https://github.com/anselanza/parse-strings-in-object) to wrap the config object returned from rc.
## Simple example demonstrating precedence
Assume you have an application like this (notice the hard-coded defaults passed to rc):
```
const conf = require('rc')('myapp', {
port: 12345,
mode: 'test'
});
console.log(JSON.stringify(conf, null, 2));
```
You also have a file `config.json`, with these contents:
```
{
"port": 9000,
"foo": "from config json",
"something": "else"
}
```
And a file `.myapprc` in the same folder, with these contents:
```
{
"port": "3001",
"foo": "bar"
}
```
Here is the expected output from various commands:
`node .`
```
{
"port": "3001",
"mode": "test",
"foo": "bar",
"_": [],
"configs": [
"/Users/stephen/repos/conftest/.myapprc"
],
"config": "/Users/stephen/repos/conftest/.myapprc"
}
```
*Default `mode` from hard-coded object is retained, but port is overridden by `.myapprc` file (automatically found based on appname match), and `foo` is added.*
`node . --foo baz`
```
{
"port": "3001",
"mode": "test",
"foo": "baz",
"_": [],
"configs": [
"/Users/stephen/repos/conftest/.myapprc"
],
"config": "/Users/stephen/repos/conftest/.myapprc"
}
```
*Same result as above but `foo` is overridden because command-line arguments take precedence over `.myapprc` file.*
`node . --foo barbar --config config.json`
```
{
"port": 9000,
"mode": "test",
"foo": "barbar",
"something": "else",
"_": [],
"config": "config.json",
"configs": [
"/Users/stephen/repos/conftest/.myapprc",
"config.json"
]
}
```
*Now the `port` comes from the `config.json` file specified (overriding the value from `.myapprc`), and `foo` value is overriden by command-line despite also being specified in the `config.json` file.*
## Advanced Usage
#### Pass in your own `argv`
You may pass in your own `argv` as the third argument to `rc`. This is in case you want to [use your own command-line opts parser](https://github.com/dominictarr/rc/pull/12).
```javascript
require('rc')(appname, defaults, customArgvParser);
```
## Pass in your own parser
If you have a special need to use a non-standard parser,
you can do so by passing in the parser as the 4th argument.
(leave the 3rd as null to get the default args parser)
```javascript
require('rc')(appname, defaults, null, parser);
```
This may also be used to force a more strict format,
such as strict, valid JSON only.
## Note on Performance
`rc` is running `fs.statSync`-- so make sure you don't use it in a hot code path (e.g. a request handler)
## License
Multi-licensed under the two-clause BSD License, MIT License, or Apache License, version 2.0

View File

@@ -0,0 +1,17 @@
import { ResponseHeaders } from "./ResponseHeaders";
import { Url } from "./Url";
export type OctokitResponse<T, S extends number = number> = {
headers: ResponseHeaders;
/**
* http response code
*/
status: S;
/**
* URL of response after all redirects
*/
url: Url;
/**
* Response data as documented in the REST API reference documentation at https://docs.github.com/rest/reference
*/
data: T;
};

View File

@@ -0,0 +1,57 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
dim: ()=>dim,
default: ()=>_default
});
const _picocolors = /*#__PURE__*/ _interopRequireDefault(require("picocolors"));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
let alreadyShown = new Set();
function log(type, messages, key) {
if (typeof process !== "undefined" && process.env.JEST_WORKER_ID) return;
if (key && alreadyShown.has(key)) return;
if (key) alreadyShown.add(key);
console.warn("");
messages.forEach((message)=>console.warn(type, "-", message));
}
function dim(input) {
return _picocolors.default.dim(input);
}
const _default = {
info (key, messages) {
log(_picocolors.default.bold(_picocolors.default.cyan("info")), ...Array.isArray(key) ? [
key
] : [
messages,
key
]);
},
warn (key, messages) {
log(_picocolors.default.bold(_picocolors.default.yellow("warn")), ...Array.isArray(key) ? [
key
] : [
messages,
key
]);
},
risk (key, messages) {
log(_picocolors.default.bold(_picocolors.default.magenta("risk")), ...Array.isArray(key) ? [
key
] : [
messages,
key
]);
}
};

View File

@@ -0,0 +1,114 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.SOCKS5_NO_ACCEPTABLE_AUTH = exports.SOCKS5_CUSTOM_AUTH_END = exports.SOCKS5_CUSTOM_AUTH_START = exports.SOCKS_INCOMING_PACKET_SIZES = exports.SocksClientState = exports.Socks5Response = exports.Socks5HostType = exports.Socks5Auth = exports.Socks4Response = exports.SocksCommand = exports.ERRORS = exports.DEFAULT_TIMEOUT = void 0;
const DEFAULT_TIMEOUT = 30000;
exports.DEFAULT_TIMEOUT = DEFAULT_TIMEOUT;
// prettier-ignore
const ERRORS = {
InvalidSocksCommand: 'An invalid SOCKS command was provided. Valid options are connect, bind, and associate.',
InvalidSocksCommandForOperation: 'An invalid SOCKS command was provided. Only a subset of commands are supported for this operation.',
InvalidSocksCommandChain: 'An invalid SOCKS command was provided. Chaining currently only supports the connect command.',
InvalidSocksClientOptionsDestination: 'An invalid destination host was provided.',
InvalidSocksClientOptionsExistingSocket: 'An invalid existing socket was provided. This should be an instance of stream.Duplex.',
InvalidSocksClientOptionsProxy: 'Invalid SOCKS proxy details were provided.',
InvalidSocksClientOptionsTimeout: 'An invalid timeout value was provided. Please enter a value above 0 (in ms).',
InvalidSocksClientOptionsProxiesLength: 'At least two socks proxies must be provided for chaining.',
InvalidSocksClientOptionsCustomAuthRange: 'Custom auth must be a value between 0x80 and 0xFE.',
InvalidSocksClientOptionsCustomAuthOptions: 'When a custom_auth_method is provided, custom_auth_request_handler, custom_auth_response_size, and custom_auth_response_handler must also be provided and valid.',
NegotiationError: 'Negotiation error',
SocketClosed: 'Socket closed',
ProxyConnectionTimedOut: 'Proxy connection timed out',
InternalError: 'SocksClient internal error (this should not happen)',
InvalidSocks4HandshakeResponse: 'Received invalid Socks4 handshake response',
Socks4ProxyRejectedConnection: 'Socks4 Proxy rejected connection',
InvalidSocks4IncomingConnectionResponse: 'Socks4 invalid incoming connection response',
Socks4ProxyRejectedIncomingBoundConnection: 'Socks4 Proxy rejected incoming bound connection',
InvalidSocks5InitialHandshakeResponse: 'Received invalid Socks5 initial handshake response',
InvalidSocks5IntiailHandshakeSocksVersion: 'Received invalid Socks5 initial handshake (invalid socks version)',
InvalidSocks5InitialHandshakeNoAcceptedAuthType: 'Received invalid Socks5 initial handshake (no accepted authentication type)',
InvalidSocks5InitialHandshakeUnknownAuthType: 'Received invalid Socks5 initial handshake (unknown authentication type)',
Socks5AuthenticationFailed: 'Socks5 Authentication failed',
InvalidSocks5FinalHandshake: 'Received invalid Socks5 final handshake response',
InvalidSocks5FinalHandshakeRejected: 'Socks5 proxy rejected connection',
InvalidSocks5IncomingConnectionResponse: 'Received invalid Socks5 incoming connection response',
Socks5ProxyRejectedIncomingBoundConnection: 'Socks5 Proxy rejected incoming bound connection',
};
exports.ERRORS = ERRORS;
const SOCKS_INCOMING_PACKET_SIZES = {
Socks5InitialHandshakeResponse: 2,
Socks5UserPassAuthenticationResponse: 2,
// Command response + incoming connection (bind)
Socks5ResponseHeader: 5,
Socks5ResponseIPv4: 10,
Socks5ResponseIPv6: 22,
Socks5ResponseHostname: (hostNameLength) => hostNameLength + 7,
// Command response + incoming connection (bind)
Socks4Response: 8, // 2 header + 2 port + 4 ip
};
exports.SOCKS_INCOMING_PACKET_SIZES = SOCKS_INCOMING_PACKET_SIZES;
var SocksCommand;
(function (SocksCommand) {
SocksCommand[SocksCommand["connect"] = 1] = "connect";
SocksCommand[SocksCommand["bind"] = 2] = "bind";
SocksCommand[SocksCommand["associate"] = 3] = "associate";
})(SocksCommand || (SocksCommand = {}));
exports.SocksCommand = SocksCommand;
var Socks4Response;
(function (Socks4Response) {
Socks4Response[Socks4Response["Granted"] = 90] = "Granted";
Socks4Response[Socks4Response["Failed"] = 91] = "Failed";
Socks4Response[Socks4Response["Rejected"] = 92] = "Rejected";
Socks4Response[Socks4Response["RejectedIdent"] = 93] = "RejectedIdent";
})(Socks4Response || (Socks4Response = {}));
exports.Socks4Response = Socks4Response;
var Socks5Auth;
(function (Socks5Auth) {
Socks5Auth[Socks5Auth["NoAuth"] = 0] = "NoAuth";
Socks5Auth[Socks5Auth["GSSApi"] = 1] = "GSSApi";
Socks5Auth[Socks5Auth["UserPass"] = 2] = "UserPass";
})(Socks5Auth || (Socks5Auth = {}));
exports.Socks5Auth = Socks5Auth;
const SOCKS5_CUSTOM_AUTH_START = 0x80;
exports.SOCKS5_CUSTOM_AUTH_START = SOCKS5_CUSTOM_AUTH_START;
const SOCKS5_CUSTOM_AUTH_END = 0xfe;
exports.SOCKS5_CUSTOM_AUTH_END = SOCKS5_CUSTOM_AUTH_END;
const SOCKS5_NO_ACCEPTABLE_AUTH = 0xff;
exports.SOCKS5_NO_ACCEPTABLE_AUTH = SOCKS5_NO_ACCEPTABLE_AUTH;
var Socks5Response;
(function (Socks5Response) {
Socks5Response[Socks5Response["Granted"] = 0] = "Granted";
Socks5Response[Socks5Response["Failure"] = 1] = "Failure";
Socks5Response[Socks5Response["NotAllowed"] = 2] = "NotAllowed";
Socks5Response[Socks5Response["NetworkUnreachable"] = 3] = "NetworkUnreachable";
Socks5Response[Socks5Response["HostUnreachable"] = 4] = "HostUnreachable";
Socks5Response[Socks5Response["ConnectionRefused"] = 5] = "ConnectionRefused";
Socks5Response[Socks5Response["TTLExpired"] = 6] = "TTLExpired";
Socks5Response[Socks5Response["CommandNotSupported"] = 7] = "CommandNotSupported";
Socks5Response[Socks5Response["AddressNotSupported"] = 8] = "AddressNotSupported";
})(Socks5Response || (Socks5Response = {}));
exports.Socks5Response = Socks5Response;
var Socks5HostType;
(function (Socks5HostType) {
Socks5HostType[Socks5HostType["IPv4"] = 1] = "IPv4";
Socks5HostType[Socks5HostType["Hostname"] = 3] = "Hostname";
Socks5HostType[Socks5HostType["IPv6"] = 4] = "IPv6";
})(Socks5HostType || (Socks5HostType = {}));
exports.Socks5HostType = Socks5HostType;
var SocksClientState;
(function (SocksClientState) {
SocksClientState[SocksClientState["Created"] = 0] = "Created";
SocksClientState[SocksClientState["Connecting"] = 1] = "Connecting";
SocksClientState[SocksClientState["Connected"] = 2] = "Connected";
SocksClientState[SocksClientState["SentInitialHandshake"] = 3] = "SentInitialHandshake";
SocksClientState[SocksClientState["ReceivedInitialHandshakeResponse"] = 4] = "ReceivedInitialHandshakeResponse";
SocksClientState[SocksClientState["SentAuthentication"] = 5] = "SentAuthentication";
SocksClientState[SocksClientState["ReceivedAuthenticationResponse"] = 6] = "ReceivedAuthenticationResponse";
SocksClientState[SocksClientState["SentFinalHandshake"] = 7] = "SentFinalHandshake";
SocksClientState[SocksClientState["ReceivedFinalResponse"] = 8] = "ReceivedFinalResponse";
SocksClientState[SocksClientState["BoundWaitingForConnection"] = 9] = "BoundWaitingForConnection";
SocksClientState[SocksClientState["Established"] = 10] = "Established";
SocksClientState[SocksClientState["Disconnected"] = 11] = "Disconnected";
SocksClientState[SocksClientState["Error"] = 99] = "Error";
})(SocksClientState || (SocksClientState = {}));
exports.SocksClientState = SocksClientState;
//# sourceMappingURL=constants.js.map

View File

@@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2014 Jameson Little
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.

View File

@@ -0,0 +1,24 @@
var baseSortedIndex = require('./_baseSortedIndex');
/**
* Uses a binary search to determine the lowest index at which `value`
* should be inserted into `array` in order to maintain its sort order.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Array
* @param {Array} array The sorted array to inspect.
* @param {*} value The value to evaluate.
* @returns {number} Returns the index at which `value` should be inserted
* into `array`.
* @example
*
* _.sortedIndex([30, 50], 40);
* // => 1
*/
function sortedIndex(array, value) {
return baseSortedIndex(array, value);
}
module.exports = sortedIndex;

View File

@@ -0,0 +1,28 @@
'use strict'
module.exports = Object.assign(
{},
// Export promiseified graceful-fs:
require('./fs'),
// Export extra methods:
require('./copy-sync'),
require('./copy'),
require('./empty'),
require('./ensure'),
require('./json'),
require('./mkdirs'),
require('./move-sync'),
require('./move'),
require('./output'),
require('./path-exists'),
require('./remove')
)
// Export fs.promises as a getter property so that we don't trigger
// ExperimentalWarning before fs.promises is actually accessed.
const fs = require('fs')
if (Object.getOwnPropertyDescriptor(fs, 'promises')) {
Object.defineProperty(module.exports, 'promises', {
get () { return fs.promises }
})
}

View File

@@ -0,0 +1 @@
{"version":3,"file":"asap.js","sourceRoot":"","sources":["../../../../src/internal/scheduler/asap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAqChD,MAAM,CAAC,IAAM,aAAa,GAAG,IAAI,aAAa,CAAC,UAAU,CAAC,CAAC;AAK3D,MAAM,CAAC,IAAM,IAAI,GAAG,aAAa,CAAC"}

View File

@@ -0,0 +1,422 @@
/* These definitions were imported from https://github.com/DefinitelyTyped/DefinitelyTyped
* and includes previous contributions from the DefinitelyTyped community by:
* - Albert Willemsen <https://github.com/AlbertWillemsen-Centric>
* - Boris Yankov <https://github.com/borisyankov>
* - Jessica Franco <https://github.com/Kovensky>
* - Masahiro Wakame <https://github.com/vvakame>
* - Raanan Weber <https://github.com/RaananW>
* - Sergei Dorogin <https://github.com/evil-shrike>
* - webbiesdk <https://github.com/webbiesdk>
* - Andrew Leedham <https://github.com/AndrewLeedham>
* - Nils Knappmeier <https://github.com/nknapp>
* For full history prior to their migration to handlebars.js, please see:
* https://github.com/DefinitelyTyped/DefinitelyTyped/commits/1ce60bdc07f10e0b076778c6c953271c072bc894/types/handlebars/index.d.ts
*/
// TypeScript Version: 2.3
declare namespace Handlebars {
export interface TemplateDelegate<T = any> {
(context: T, options?: RuntimeOptions): string;
}
export type Template<T = any> = TemplateDelegate<T>|string;
export interface RuntimeOptions {
partial?: boolean;
depths?: any[];
helpers?: { [name: string]: Function };
partials?: { [name: string]: HandlebarsTemplateDelegate };
decorators?: { [name: string]: Function };
data?: any;
blockParams?: any[];
allowCallsToHelperMissing?: boolean;
allowedProtoProperties?: { [name: string]: boolean };
allowedProtoMethods?: { [name: string]: boolean };
allowProtoPropertiesByDefault?: boolean;
allowProtoMethodsByDefault?: boolean;
}
export interface HelperOptions {
fn: TemplateDelegate;
inverse: TemplateDelegate;
hash: any;
data?: any;
}
export interface HelperDelegate {
(context?: any, arg1?: any, arg2?: any, arg3?: any, arg4?: any, arg5?: any, options?: HelperOptions): any;
}
export interface HelperDeclareSpec {
[key: string]: HelperDelegate;
}
export interface ParseOptions {
srcName?: string;
ignoreStandalone?: boolean;
}
export function registerHelper(name: string, fn: HelperDelegate): void;
export function registerHelper(name: HelperDeclareSpec): void;
export function unregisterHelper(name: string): void;
export function registerPartial(name: string, fn: Template): void;
export function registerPartial(spec: { [name: string]: HandlebarsTemplateDelegate }): void;
export function unregisterPartial(name: string): void;
// TODO: replace Function with actual signature
export function registerDecorator(name: string, fn: Function): void;
export function unregisterDecorator(name: string): void;
export function K(): void;
export function createFrame(object: any): any;
export function blockParams(obj: any[], ids: any[]): any[];
export function log(level: number, obj: any): void;
export function parse(input: string, options?: ParseOptions): hbs.AST.Program;
export function parseWithoutProcessing(input: string, options?: ParseOptions): hbs.AST.Program;
export function compile<T = any>(input: any, options?: CompileOptions): HandlebarsTemplateDelegate<T>;
export function precompile(input: any, options?: PrecompileOptions): TemplateSpecification;
export function template<T = any>(precompilation: TemplateSpecification): HandlebarsTemplateDelegate<T>;
export function create(): typeof Handlebars;
export const escapeExpression: typeof Utils.escapeExpression;
//export const Utils: typeof hbs.Utils;
export const logger: Logger;
export const templates: HandlebarsTemplates;
export const helpers: { [name: string]: HelperDelegate };
export const partials: { [name: string]: any };
// TODO: replace Function with actual signature
export const decorators: { [name: string]: Function };
export const VERSION: string;
export function noConflict(): typeof Handlebars;
export class Exception {
constructor(message: string, node?: hbs.AST.Node);
description: string;
fileName: string;
lineNumber?: any;
endLineNumber?: any;
message: string;
name: string;
number: number;
stack?: string;
column?: any;
endColumn?: any;
}
export class SafeString {
constructor(str: string);
toString(): string;
toHTML(): string;
}
export namespace Utils {
export function escapeExpression(str: string): string;
export function createFrame(object: any): any;
export function blockParams(obj: any[], ids: any[]): any[];
export function isEmpty(obj: any) : boolean;
export function extend(obj: any, ...source: any[]): any;
export function toString(obj: any): string;
export function isArray(obj: any): boolean;
export function isFunction(obj: any): boolean;
}
export namespace AST {
export const helpers: hbs.AST.helpers;
}
interface ICompiler {
accept(node: hbs.AST.Node): void;
Program(program: hbs.AST.Program): void;
BlockStatement(block: hbs.AST.BlockStatement): void;
PartialStatement(partial: hbs.AST.PartialStatement): void;
PartialBlockStatement(partial: hbs.AST.PartialBlockStatement): void;
DecoratorBlock(decorator: hbs.AST.DecoratorBlock): void;
Decorator(decorator: hbs.AST.Decorator): void;
MustacheStatement(mustache: hbs.AST.MustacheStatement): void;
ContentStatement(content: hbs.AST.ContentStatement): void;
CommentStatement(comment?: hbs.AST.CommentStatement): void;
SubExpression(sexpr: hbs.AST.SubExpression): void;
PathExpression(path: hbs.AST.PathExpression): void;
StringLiteral(str: hbs.AST.StringLiteral): void;
NumberLiteral(num: hbs.AST.NumberLiteral): void;
BooleanLiteral(bool: hbs.AST.BooleanLiteral): void;
UndefinedLiteral(): void;
NullLiteral(): void;
Hash(hash: hbs.AST.Hash): void;
}
export class Visitor implements ICompiler {
accept(node: hbs.AST.Node): void;
acceptKey(node: hbs.AST.Node, name: string): void;
acceptArray(arr: hbs.AST.Expression[]): void;
Program(program: hbs.AST.Program): void;
BlockStatement(block: hbs.AST.BlockStatement): void;
PartialStatement(partial: hbs.AST.PartialStatement): void;
PartialBlockStatement(partial: hbs.AST.PartialBlockStatement): void;
DecoratorBlock(decorator: hbs.AST.DecoratorBlock): void;
Decorator(decorator: hbs.AST.Decorator): void;
MustacheStatement(mustache: hbs.AST.MustacheStatement): void;
ContentStatement(content: hbs.AST.ContentStatement): void;
CommentStatement(comment?: hbs.AST.CommentStatement): void;
SubExpression(sexpr: hbs.AST.SubExpression): void;
PathExpression(path: hbs.AST.PathExpression): void;
StringLiteral(str: hbs.AST.StringLiteral): void;
NumberLiteral(num: hbs.AST.NumberLiteral): void;
BooleanLiteral(bool: hbs.AST.BooleanLiteral): void;
UndefinedLiteral(): void;
NullLiteral(): void;
Hash(hash: hbs.AST.Hash): void;
}
export interface ResolvePartialOptions {
name: string;
helpers?: { [name: string]: Function };
partials?: { [name: string]: HandlebarsTemplateDelegate };
decorators?: { [name: string]: Function };
data?: any;
}
export namespace VM {
/**
* @deprecated
*/
export function resolvePartial<T = any>(partial: HandlebarsTemplateDelegate<T> | undefined, context: any, options: ResolvePartialOptions): HandlebarsTemplateDelegate<T>;
}
}
/**
* Implement this interface on your MVW/MVVM/MVC views such as Backbone.View
**/
interface HandlebarsTemplatable {
template: HandlebarsTemplateDelegate;
}
// NOTE: for backward compatibility of this typing
type HandlebarsTemplateDelegate<T = any> = Handlebars.TemplateDelegate<T>;
interface HandlebarsTemplates {
[index: string]: HandlebarsTemplateDelegate;
}
interface TemplateSpecification {
}
// for backward compatibility of this typing
type RuntimeOptions = Handlebars.RuntimeOptions;
interface CompileOptions {
data?: boolean;
compat?: boolean;
knownHelpers?: KnownHelpers;
knownHelpersOnly?: boolean;
noEscape?: boolean;
strict?: boolean;
assumeObjects?: boolean;
preventIndent?: boolean;
ignoreStandalone?: boolean;
explicitPartialContext?: boolean;
}
type KnownHelpers = {
[name in BuiltinHelperName | CustomHelperName]: boolean;
};
type BuiltinHelperName =
"helperMissing"|
"blockHelperMissing"|
"each"|
"if"|
"unless"|
"with"|
"log"|
"lookup";
type CustomHelperName = string;
interface PrecompileOptions extends CompileOptions {
srcName?: string;
destName?: string;
}
declare namespace hbs {
// for backward compatibility of this typing
type SafeString = Handlebars.SafeString;
type Utils = typeof Handlebars.Utils;
}
interface Logger {
DEBUG: number;
INFO: number;
WARN: number;
ERROR: number;
level: number;
methodMap: { [level: number]: string };
log(level: number, obj: string): void;
}
type CompilerInfo = [number/* revision */, string /* versions */];
declare namespace hbs {
namespace AST {
interface Node {
type: string;
loc: SourceLocation;
}
interface SourceLocation {
source: string;
start: Position;
end: Position;
}
interface Position {
line: number;
column: number;
}
interface Program extends Node {
body: Statement[];
blockParams: string[];
}
interface Statement extends Node {}
interface MustacheStatement extends Statement {
type: 'MustacheStatement';
path: PathExpression | Literal;
params: Expression[];
hash: Hash;
escaped: boolean;
strip: StripFlags;
}
interface Decorator extends MustacheStatement { }
interface BlockStatement extends Statement {
type: 'BlockStatement';
path: PathExpression;
params: Expression[];
hash: Hash;
program: Program;
inverse: Program;
openStrip: StripFlags;
inverseStrip: StripFlags;
closeStrip: StripFlags;
}
interface DecoratorBlock extends BlockStatement { }
interface PartialStatement extends Statement {
type: 'PartialStatement';
name: PathExpression | SubExpression;
params: Expression[];
hash: Hash;
indent: string;
strip: StripFlags;
}
interface PartialBlockStatement extends Statement {
type: 'PartialBlockStatement';
name: PathExpression | SubExpression;
params: Expression[];
hash: Hash;
program: Program;
openStrip: StripFlags;
closeStrip: StripFlags;
}
interface ContentStatement extends Statement {
type: 'ContentStatement';
value: string;
original: StripFlags;
}
interface CommentStatement extends Statement {
type: 'CommentStatement';
value: string;
strip: StripFlags;
}
interface Expression extends Node {}
interface SubExpression extends Expression {
type: 'SubExpression';
path: PathExpression;
params: Expression[];
hash: Hash;
}
interface PathExpression extends Expression {
type: 'PathExpression';
data: boolean;
depth: number;
parts: string[];
original: string;
}
interface Literal extends Expression {}
interface StringLiteral extends Literal {
type: 'StringLiteral';
value: string;
original: string;
}
interface BooleanLiteral extends Literal {
type: 'BooleanLiteral';
value: boolean;
original: boolean;
}
interface NumberLiteral extends Literal {
type: 'NumberLiteral';
value: number;
original: number;
}
interface UndefinedLiteral extends Literal {
type: 'UndefinedLiteral';
}
interface NullLiteral extends Literal {
type: 'NullLiteral';
}
interface Hash extends Node {
type: 'Hash';
pairs: HashPair[];
}
interface HashPair extends Node {
type: 'HashPair';
key: string;
value: Expression;
}
interface StripFlags {
open: boolean;
close: boolean;
}
interface helpers {
helperExpression(node: Node): boolean;
scopeId(path: PathExpression): boolean;
simpleId(path: PathExpression): boolean;
}
}
}
declare module "handlebars" {
export = Handlebars;
}
declare module "handlebars/runtime" {
export = Handlebars;
}

View File

@@ -0,0 +1,3 @@
export declare const UNICODE_EXTENSION_SEQUENCE_REGEX: RegExp;
export declare function invariant(condition: boolean, message: string, Err?: any): asserts condition;
//# sourceMappingURL=utils.d.ts.map

View File

@@ -0,0 +1,45 @@
{
"name": "acorn-walk",
"description": "ECMAScript (ESTree) AST walker",
"homepage": "https://github.com/acornjs/acorn",
"main": "dist/walk.js",
"types": "dist/walk.d.ts",
"module": "dist/walk.mjs",
"exports": {
".": [
{
"import": "./dist/walk.mjs",
"require": "./dist/walk.js",
"default": "./dist/walk.js"
},
"./dist/walk.js"
],
"./package.json": "./package.json"
},
"version": "8.2.0",
"engines": {"node": ">=0.4.0"},
"maintainers": [
{
"name": "Marijn Haverbeke",
"email": "marijnh@gmail.com",
"web": "https://marijnhaverbeke.nl"
},
{
"name": "Ingvar Stepanyan",
"email": "me@rreverser.com",
"web": "https://rreverser.com/"
},
{
"name": "Adrian Heine",
"web": "http://adrianheine.de"
}
],
"repository": {
"type": "git",
"url": "https://github.com/acornjs/acorn.git"
},
"scripts": {
"prepare": "cd ..; npm run build:walk"
},
"license": "MIT"
}

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,"29":0,"30":0,"31":0.01065,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0.00532,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"59":0.00532,"60":0,"61":0,"62":0,"63":0,"64":0,"65":0,"66":0,"67":0,"68":0,"69":0,"70":0,"71":0,"72":0,"73":0,"74":0,"75":0,"76":0,"77":0,"78":0.01597,"79":0.00532,"80":0,"81":0,"82":0,"83":0,"84":0,"85":0,"86":0,"87":0,"88":0.00532,"89":0,"90":0,"91":0,"92":0,"93":0,"94":0,"95":0,"96":0,"97":0,"98":0,"99":0,"100":0,"101":0,"102":0.03194,"103":0.00532,"104":0.00532,"105":0.00532,"106":0.00532,"107":0.01065,"108":0.04258,"109":0.70264,"110":0.43649,"111":0.00532,"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,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0.00532,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0.01065,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"59":0,"60":0,"61":0,"62":0,"63":0.00532,"64":0,"65":0,"66":0.02662,"67":0,"68":0,"69":0,"70":0,"71":0,"72":0,"73":0,"74":0.00532,"75":0.01065,"76":0.00532,"77":0.00532,"78":0.00532,"79":0.02662,"80":0.00532,"81":0.00532,"83":0.01065,"84":0.01065,"85":0.01597,"86":0.02662,"87":0.04258,"88":0.00532,"89":0.03194,"90":0.00532,"91":0.01065,"92":0.01597,"93":0.09049,"94":0.00532,"95":0.00532,"96":0.03194,"97":0.01597,"98":0.01065,"99":0.01065,"100":0.02129,"101":0.09581,"102":0.05855,"103":0.2076,"104":0.02662,"105":0.05323,"106":0.03726,"107":0.24486,"108":1.55432,"109":9.06507,"110":6.16403,"111":0.01065,"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,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0.00532,"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.00532,"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.00532,"86":0,"87":0,"88":0,"89":0,"90":0,"91":0,"92":0,"93":0.04258,"94":0.33535,"95":0.14372,"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,"13":0,"14":0,"15":0,"16":0,"17":0.00532,"18":0.00532,"79":0,"80":0,"81":0,"83":0,"84":0,"85":0,"86":0,"87":0,"88":0.00532,"89":0,"90":0.00532,"91":0,"92":0.00532,"93":0,"94":0,"95":0,"96":0,"97":0,"98":0,"99":0,"100":0,"101":0.00532,"102":0,"103":0.00532,"104":0.00532,"105":0.00532,"106":0.01065,"107":0.02662,"108":0.19163,"109":1.79917,"110":2.42197},E:{"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0.01065,"14":0.06388,"15":0.01065,_:"0","3.1":0,"3.2":0,"5.1":0,"6.1":0,"7.1":0,"9.1":0.00532,"10.1":0,"11.1":0.00532,"12.1":0.01597,"13.1":0.08517,"14.1":0.23954,"15.1":0.02662,"15.2-15.3":0.02662,"15.4":0.08517,"15.5":0.14904,"15.6":0.71861,"16.0":0.05855,"16.1":0.22889,"16.2":0.72393,"16.3":0.54827,"16.4":0},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0,"5.0-5.1":0,"6.0-6.1":0,"7.0-7.1":0.00418,"8.1-8.4":0.00418,"9.0-9.2":0.00836,"9.3":0.09616,"10.0-10.2":0,"10.3":0.1296,"11.0-11.2":0.02508,"11.3-11.4":0.07525,"12.0-12.1":0.02927,"12.2-12.5":0.63129,"13.0-13.1":0.01254,"13.2":0.01672,"13.3":0.04181,"13.4-13.7":0.1296,"14.0-14.4":0.39717,"14.5-14.8":1.35875,"15.0-15.1":0.20486,"15.2-15.3":0.34282,"15.4":0.39299,"15.5":0.94067,"15.6":4.03443,"16.0":3.69997,"16.1":11.20025,"16.2":10.12162,"16.3":5.50606,"16.4":0.01672},P:{"4":0.07256,"20":1.39936,"5.0-5.4":0,"6.2-6.4":0,"7.2-7.4":0,"8.2":0,"9.2":0,"10.1":0,"11.1-11.2":0,"12.0":0,"13.0":0.01037,"14.0":0.02073,"15.0":0.01037,"16.0":0.04146,"17.0":0.04146,"18.0":0.06219,"19.0":2.03166},I:{"0":0,"3":0,"4":0.02867,"2.1":0,"2.2":0,"2.3":0,"4.1":0.0041,"4.2-4.3":0.02048,"4.4":0,"4.4.3-4.4.4":0.06143},K:{_:"0 10 11 12 11.1 11.5 12.1"},A:{"6":0,"7":0,"8":0,"9":0,"10":0,"11":0.03726,"5.5":0},N:{"10":0,"11":0},S:{"2.5":0,_:"3.0-3.1"},J:{"7":0,"10":0},O:{"0":0.01403},H:{"0":0.13284},L:{"0":26.49896},R:{_:"0"},M:{"0":0.29933},Q:{"13.1":0}};

View File

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

View File

@@ -0,0 +1,758 @@
# Source Map JS
[![NPM](https://nodei.co/npm/source-map-js.png?downloads=true&downloadRank=true)](https://www.npmjs.com/package/source-map-js)
Difference between original [source-map](https://github.com/mozilla/source-map):
> TL,DR: it's fork of original source-map@0.6, but with perfomance optimizations.
This journey starts from [source-map@0.7.0](https://github.com/mozilla/source-map/blob/master/CHANGELOG.md#070). Some part of it was rewritten to Rust and WASM and API became async.
It's still a major block for many libraries like PostCSS or Sass for example because they need to migrate the whole API to the async way. This is the reason why 0.6.1 has 2x more downloads than 0.7.3 while it's faster several times.
![Downloads count](media/downloads.png)
More important that WASM version has some optimizations in JS code too. This is why [community asked to create branch for 0.6 version](https://github.com/mozilla/source-map/issues/324) and port these optimizations but, sadly, the answer was «no». A bit later I discovered [the issue](https://github.com/mozilla/source-map/issues/370) created by [Ben Rothman (@benthemonkey)](https://github.com/benthemonkey) with no response at all.
[Roman Dvornov (@lahmatiy)](https://github.com/lahmatiy) wrote a [serveral posts](https://t.me/gorshochekvarit/76) (russian, only, sorry) about source-map library in his own Telegram channel. He mentioned the article [«Maybe you don't need Rust and WASM to speed up your JS»](https://mrale.ph/blog/2018/02/03/maybe-you-dont-need-rust-to-speed-up-your-js.html) written by [Vyacheslav Egorov (@mraleph)](https://github.com/mraleph). This article contains optimizations and hacks that lead to almost the same performance compare to WASM implementation.
I decided to fork the original source-map and port these optimizations from the article and several others PR from the original source-map.
---------
This is a library to generate and consume the source map format
[described here][format].
[format]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit
## Use with Node
$ npm install source-map-js
<!-- ## Use on the Web
<script src="https://raw.githubusercontent.com/mozilla/source-map/master/dist/source-map.min.js" defer></script> -->
--------------------------------------------------------------------------------
<!-- `npm run toc` to regenerate the Table of Contents -->
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
## Table of Contents
- [Examples](#examples)
- [Consuming a source map](#consuming-a-source-map)
- [Generating a source map](#generating-a-source-map)
- [With SourceNode (high level API)](#with-sourcenode-high-level-api)
- [With SourceMapGenerator (low level API)](#with-sourcemapgenerator-low-level-api)
- [API](#api)
- [SourceMapConsumer](#sourcemapconsumer)
- [new SourceMapConsumer(rawSourceMap)](#new-sourcemapconsumerrawsourcemap)
- [SourceMapConsumer.prototype.computeColumnSpans()](#sourcemapconsumerprototypecomputecolumnspans)
- [SourceMapConsumer.prototype.originalPositionFor(generatedPosition)](#sourcemapconsumerprototypeoriginalpositionforgeneratedposition)
- [SourceMapConsumer.prototype.generatedPositionFor(originalPosition)](#sourcemapconsumerprototypegeneratedpositionfororiginalposition)
- [SourceMapConsumer.prototype.allGeneratedPositionsFor(originalPosition)](#sourcemapconsumerprototypeallgeneratedpositionsfororiginalposition)
- [SourceMapConsumer.prototype.hasContentsOfAllSources()](#sourcemapconsumerprototypehascontentsofallsources)
- [SourceMapConsumer.prototype.sourceContentFor(source[, returnNullOnMissing])](#sourcemapconsumerprototypesourcecontentforsource-returnnullonmissing)
- [SourceMapConsumer.prototype.eachMapping(callback, context, order)](#sourcemapconsumerprototypeeachmappingcallback-context-order)
- [SourceMapGenerator](#sourcemapgenerator)
- [new SourceMapGenerator([startOfSourceMap])](#new-sourcemapgeneratorstartofsourcemap)
- [SourceMapGenerator.fromSourceMap(sourceMapConsumer)](#sourcemapgeneratorfromsourcemapsourcemapconsumer)
- [SourceMapGenerator.prototype.addMapping(mapping)](#sourcemapgeneratorprototypeaddmappingmapping)
- [SourceMapGenerator.prototype.setSourceContent(sourceFile, sourceContent)](#sourcemapgeneratorprototypesetsourcecontentsourcefile-sourcecontent)
- [SourceMapGenerator.prototype.applySourceMap(sourceMapConsumer[, sourceFile[, sourceMapPath]])](#sourcemapgeneratorprototypeapplysourcemapsourcemapconsumer-sourcefile-sourcemappath)
- [SourceMapGenerator.prototype.toString()](#sourcemapgeneratorprototypetostring)
- [SourceNode](#sourcenode)
- [new SourceNode([line, column, source[, chunk[, name]]])](#new-sourcenodeline-column-source-chunk-name)
- [SourceNode.fromStringWithSourceMap(code, sourceMapConsumer[, relativePath])](#sourcenodefromstringwithsourcemapcode-sourcemapconsumer-relativepath)
- [SourceNode.prototype.add(chunk)](#sourcenodeprototypeaddchunk)
- [SourceNode.prototype.prepend(chunk)](#sourcenodeprototypeprependchunk)
- [SourceNode.prototype.setSourceContent(sourceFile, sourceContent)](#sourcenodeprototypesetsourcecontentsourcefile-sourcecontent)
- [SourceNode.prototype.walk(fn)](#sourcenodeprototypewalkfn)
- [SourceNode.prototype.walkSourceContents(fn)](#sourcenodeprototypewalksourcecontentsfn)
- [SourceNode.prototype.join(sep)](#sourcenodeprototypejoinsep)
- [SourceNode.prototype.replaceRight(pattern, replacement)](#sourcenodeprototypereplacerightpattern-replacement)
- [SourceNode.prototype.toString()](#sourcenodeprototypetostring)
- [SourceNode.prototype.toStringWithSourceMap([startOfSourceMap])](#sourcenodeprototypetostringwithsourcemapstartofsourcemap)
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
## Examples
### Consuming a source map
```js
var rawSourceMap = {
version: 3,
file: 'min.js',
names: ['bar', 'baz', 'n'],
sources: ['one.js', 'two.js'],
sourceRoot: 'http://example.com/www/js/',
mappings: 'CAAC,IAAI,IAAM,SAAUA,GAClB,OAAOC,IAAID;CCDb,IAAI,IAAM,SAAUE,GAClB,OAAOA'
};
var smc = new SourceMapConsumer(rawSourceMap);
console.log(smc.sources);
// [ 'http://example.com/www/js/one.js',
// 'http://example.com/www/js/two.js' ]
console.log(smc.originalPositionFor({
line: 2,
column: 28
}));
// { source: 'http://example.com/www/js/two.js',
// line: 2,
// column: 10,
// name: 'n' }
console.log(smc.generatedPositionFor({
source: 'http://example.com/www/js/two.js',
line: 2,
column: 10
}));
// { line: 2, column: 28 }
smc.eachMapping(function (m) {
// ...
});
```
### Generating a source map
In depth guide:
[**Compiling to JavaScript, and Debugging with Source Maps**](https://hacks.mozilla.org/2013/05/compiling-to-javascript-and-debugging-with-source-maps/)
#### With SourceNode (high level API)
```js
function compile(ast) {
switch (ast.type) {
case 'BinaryExpression':
return new SourceNode(
ast.location.line,
ast.location.column,
ast.location.source,
[compile(ast.left), " + ", compile(ast.right)]
);
case 'Literal':
return new SourceNode(
ast.location.line,
ast.location.column,
ast.location.source,
String(ast.value)
);
// ...
default:
throw new Error("Bad AST");
}
}
var ast = parse("40 + 2", "add.js");
console.log(compile(ast).toStringWithSourceMap({
file: 'add.js'
}));
// { code: '40 + 2',
// map: [object SourceMapGenerator] }
```
#### With SourceMapGenerator (low level API)
```js
var map = new SourceMapGenerator({
file: "source-mapped.js"
});
map.addMapping({
generated: {
line: 10,
column: 35
},
source: "foo.js",
original: {
line: 33,
column: 2
},
name: "christopher"
});
console.log(map.toString());
// '{"version":3,"file":"source-mapped.js","sources":["foo.js"],"names":["christopher"],"mappings":";;;;;;;;;mCAgCEA"}'
```
## API
Get a reference to the module:
```js
// Node.js
var sourceMap = require('source-map');
// Browser builds
var sourceMap = window.sourceMap;
// Inside Firefox
const sourceMap = require("devtools/toolkit/sourcemap/source-map.js");
```
### SourceMapConsumer
A SourceMapConsumer instance represents a parsed source map which we can query
for information about the original file positions by giving it a file position
in the generated source.
#### new SourceMapConsumer(rawSourceMap)
The only parameter is the raw source map (either as a string which can be
`JSON.parse`'d, or an object). According to the spec, source maps have the
following attributes:
* `version`: Which version of the source map spec this map is following.
* `sources`: An array of URLs to the original source files.
* `names`: An array of identifiers which can be referenced by individual
mappings.
* `sourceRoot`: Optional. The URL root from which all sources are relative.
* `sourcesContent`: Optional. An array of contents of the original source files.
* `mappings`: A string of base64 VLQs which contain the actual mappings.
* `file`: Optional. The generated filename this source map is associated with.
```js
var consumer = new sourceMap.SourceMapConsumer(rawSourceMapJsonData);
```
#### SourceMapConsumer.prototype.computeColumnSpans()
Compute the last column for each generated mapping. The last column is
inclusive.
```js
// Before:
consumer.allGeneratedPositionsFor({ line: 2, source: "foo.coffee" })
// [ { line: 2,
// column: 1 },
// { line: 2,
// column: 10 },
// { line: 2,
// column: 20 } ]
consumer.computeColumnSpans();
// After:
consumer.allGeneratedPositionsFor({ line: 2, source: "foo.coffee" })
// [ { line: 2,
// column: 1,
// lastColumn: 9 },
// { line: 2,
// column: 10,
// lastColumn: 19 },
// { line: 2,
// column: 20,
// lastColumn: Infinity } ]
```
#### SourceMapConsumer.prototype.originalPositionFor(generatedPosition)
Returns the original source, line, and column information for the generated
source's line and column positions provided. The only argument is an object with
the following properties:
* `line`: The line number in the generated source. Line numbers in
this library are 1-based (note that the underlying source map
specification uses 0-based line numbers -- this library handles the
translation).
* `column`: The column number in the generated source. Column numbers
in this library are 0-based.
* `bias`: Either `SourceMapConsumer.GREATEST_LOWER_BOUND` or
`SourceMapConsumer.LEAST_UPPER_BOUND`. Specifies whether to return the closest
element that is smaller than or greater than the one we are searching for,
respectively, if the exact element cannot be found. Defaults to
`SourceMapConsumer.GREATEST_LOWER_BOUND`.
and an object is returned with the following properties:
* `source`: The original source file, or null if this information is not
available.
* `line`: The line number in the original source, or null if this information is
not available. The line number is 1-based.
* `column`: The column number in the original source, or null if this
information is not available. The column number is 0-based.
* `name`: The original identifier, or null if this information is not available.
```js
consumer.originalPositionFor({ line: 2, column: 10 })
// { source: 'foo.coffee',
// line: 2,
// column: 2,
// name: null }
consumer.originalPositionFor({ line: 99999999999999999, column: 999999999999999 })
// { source: null,
// line: null,
// column: null,
// name: null }
```
#### SourceMapConsumer.prototype.generatedPositionFor(originalPosition)
Returns the generated line and column information for the original source,
line, and column positions provided. The only argument is an object with
the following properties:
* `source`: The filename of the original source.
* `line`: The line number in the original source. The line number is
1-based.
* `column`: The column number in the original source. The column
number is 0-based.
and an object is returned with the following properties:
* `line`: The line number in the generated source, or null. The line
number is 1-based.
* `column`: The column number in the generated source, or null. The
column number is 0-based.
```js
consumer.generatedPositionFor({ source: "example.js", line: 2, column: 10 })
// { line: 1,
// column: 56 }
```
#### SourceMapConsumer.prototype.allGeneratedPositionsFor(originalPosition)
Returns all generated line and column information for the original source, line,
and column provided. If no column is provided, returns all mappings
corresponding to a either the line we are searching for or the next closest line
that has any mappings. Otherwise, returns all mappings corresponding to the
given line and either the column we are searching for or the next closest column
that has any offsets.
The only argument is an object with the following properties:
* `source`: The filename of the original source.
* `line`: The line number in the original source. The line number is
1-based.
* `column`: Optional. The column number in the original source. The
column number is 0-based.
and an array of objects is returned, each with the following properties:
* `line`: The line number in the generated source, or null. The line
number is 1-based.
* `column`: The column number in the generated source, or null. The
column number is 0-based.
```js
consumer.allGeneratedpositionsfor({ line: 2, source: "foo.coffee" })
// [ { line: 2,
// column: 1 },
// { line: 2,
// column: 10 },
// { line: 2,
// column: 20 } ]
```
#### SourceMapConsumer.prototype.hasContentsOfAllSources()
Return true if we have the embedded source content for every source listed in
the source map, false otherwise.
In other words, if this method returns `true`, then
`consumer.sourceContentFor(s)` will succeed for every source `s` in
`consumer.sources`.
```js
// ...
if (consumer.hasContentsOfAllSources()) {
consumerReadyCallback(consumer);
} else {
fetchSources(consumer, consumerReadyCallback);
}
// ...
```
#### SourceMapConsumer.prototype.sourceContentFor(source[, returnNullOnMissing])
Returns the original source content for the source provided. The only
argument is the URL of the original source file.
If the source content for the given source is not found, then an error is
thrown. Optionally, pass `true` as the second param to have `null` returned
instead.
```js
consumer.sources
// [ "my-cool-lib.clj" ]
consumer.sourceContentFor("my-cool-lib.clj")
// "..."
consumer.sourceContentFor("this is not in the source map");
// Error: "this is not in the source map" is not in the source map
consumer.sourceContentFor("this is not in the source map", true);
// null
```
#### SourceMapConsumer.prototype.eachMapping(callback, context, order)
Iterate over each mapping between an original source/line/column and a
generated line/column in this source map.
* `callback`: The function that is called with each mapping. Mappings have the
form `{ source, generatedLine, generatedColumn, originalLine, originalColumn,
name }`
* `context`: Optional. If specified, this object will be the value of `this`
every time that `callback` is called.
* `order`: Either `SourceMapConsumer.GENERATED_ORDER` or
`SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to iterate over
the mappings sorted by the generated file's line/column order or the
original's source/line/column order, respectively. Defaults to
`SourceMapConsumer.GENERATED_ORDER`.
```js
consumer.eachMapping(function (m) { console.log(m); })
// ...
// { source: 'illmatic.js',
// generatedLine: 1,
// generatedColumn: 0,
// originalLine: 1,
// originalColumn: 0,
// name: null }
// { source: 'illmatic.js',
// generatedLine: 2,
// generatedColumn: 0,
// originalLine: 2,
// originalColumn: 0,
// name: null }
// ...
```
### SourceMapGenerator
An instance of the SourceMapGenerator represents a source map which is being
built incrementally.
#### new SourceMapGenerator([startOfSourceMap])
You may pass an object with the following properties:
* `file`: The filename of the generated source that this source map is
associated with.
* `sourceRoot`: A root for all relative URLs in this source map.
* `skipValidation`: Optional. When `true`, disables validation of mappings as
they are added. This can improve performance but should be used with
discretion, as a last resort. Even then, one should avoid using this flag when
running tests, if possible.
```js
var generator = new sourceMap.SourceMapGenerator({
file: "my-generated-javascript-file.js",
sourceRoot: "http://example.com/app/js/"
});
```
#### SourceMapGenerator.fromSourceMap(sourceMapConsumer)
Creates a new `SourceMapGenerator` from an existing `SourceMapConsumer` instance.
* `sourceMapConsumer` The SourceMap.
```js
var generator = sourceMap.SourceMapGenerator.fromSourceMap(consumer);
```
#### SourceMapGenerator.prototype.addMapping(mapping)
Add a single mapping from original source line and column to the generated
source's line and column for this source map being created. The mapping object
should have the following properties:
* `generated`: An object with the generated line and column positions.
* `original`: An object with the original line and column positions.
* `source`: The original source file (relative to the sourceRoot).
* `name`: An optional original token name for this mapping.
```js
generator.addMapping({
source: "module-one.scm",
original: { line: 128, column: 0 },
generated: { line: 3, column: 456 }
})
```
#### SourceMapGenerator.prototype.setSourceContent(sourceFile, sourceContent)
Set the source content for an original source file.
* `sourceFile` the URL of the original source file.
* `sourceContent` the content of the source file.
```js
generator.setSourceContent("module-one.scm",
fs.readFileSync("path/to/module-one.scm"))
```
#### SourceMapGenerator.prototype.applySourceMap(sourceMapConsumer[, sourceFile[, sourceMapPath]])
Applies a SourceMap for a source file to the SourceMap.
Each mapping to the supplied source file is rewritten using the
supplied SourceMap. Note: The resolution for the resulting mappings
is the minimum of this map and the supplied map.
* `sourceMapConsumer`: The SourceMap to be applied.
* `sourceFile`: Optional. The filename of the source file.
If omitted, sourceMapConsumer.file will be used, if it exists.
Otherwise an error will be thrown.
* `sourceMapPath`: Optional. The dirname of the path to the SourceMap
to be applied. If relative, it is relative to the SourceMap.
This parameter is needed when the two SourceMaps aren't in the same
directory, and the SourceMap to be applied contains relative source
paths. If so, those relative source paths need to be rewritten
relative to the SourceMap.
If omitted, it is assumed that both SourceMaps are in the same directory,
thus not needing any rewriting. (Supplying `'.'` has the same effect.)
#### SourceMapGenerator.prototype.toString()
Renders the source map being generated to a string.
```js
generator.toString()
// '{"version":3,"sources":["module-one.scm"],"names":[],"mappings":"...snip...","file":"my-generated-javascript-file.js","sourceRoot":"http://example.com/app/js/"}'
```
### SourceNode
SourceNodes provide a way to abstract over interpolating and/or concatenating
snippets of generated JavaScript source code, while maintaining the line and
column information associated between those snippets and the original source
code. This is useful as the final intermediate representation a compiler might
use before outputting the generated JS and source map.
#### new SourceNode([line, column, source[, chunk[, name]]])
* `line`: The original line number associated with this source node, or null if
it isn't associated with an original line. The line number is 1-based.
* `column`: The original column number associated with this source node, or null
if it isn't associated with an original column. The column number
is 0-based.
* `source`: The original source's filename; null if no filename is provided.
* `chunk`: Optional. Is immediately passed to `SourceNode.prototype.add`, see
below.
* `name`: Optional. The original identifier.
```js
var node = new SourceNode(1, 2, "a.cpp", [
new SourceNode(3, 4, "b.cpp", "extern int status;\n"),
new SourceNode(5, 6, "c.cpp", "std::string* make_string(size_t n);\n"),
new SourceNode(7, 8, "d.cpp", "int main(int argc, char** argv) {}\n"),
]);
```
#### SourceNode.fromStringWithSourceMap(code, sourceMapConsumer[, relativePath])
Creates a SourceNode from generated code and a SourceMapConsumer.
* `code`: The generated code
* `sourceMapConsumer` The SourceMap for the generated code
* `relativePath` The optional path that relative sources in `sourceMapConsumer`
should be relative to.
```js
var consumer = new SourceMapConsumer(fs.readFileSync("path/to/my-file.js.map", "utf8"));
var node = SourceNode.fromStringWithSourceMap(fs.readFileSync("path/to/my-file.js"),
consumer);
```
#### SourceNode.prototype.add(chunk)
Add a chunk of generated JS to this source node.
* `chunk`: A string snippet of generated JS code, another instance of
`SourceNode`, or an array where each member is one of those things.
```js
node.add(" + ");
node.add(otherNode);
node.add([leftHandOperandNode, " + ", rightHandOperandNode]);
```
#### SourceNode.prototype.prepend(chunk)
Prepend a chunk of generated JS to this source node.
* `chunk`: A string snippet of generated JS code, another instance of
`SourceNode`, or an array where each member is one of those things.
```js
node.prepend("/** Build Id: f783haef86324gf **/\n\n");
```
#### SourceNode.prototype.setSourceContent(sourceFile, sourceContent)
Set the source content for a source file. This will be added to the
`SourceMap` in the `sourcesContent` field.
* `sourceFile`: The filename of the source file
* `sourceContent`: The content of the source file
```js
node.setSourceContent("module-one.scm",
fs.readFileSync("path/to/module-one.scm"))
```
#### SourceNode.prototype.walk(fn)
Walk over the tree of JS snippets in this node and its children. The walking
function is called once for each snippet of JS and is passed that snippet and
the its original associated source's line/column location.
* `fn`: The traversal function.
```js
var node = new SourceNode(1, 2, "a.js", [
new SourceNode(3, 4, "b.js", "uno"),
"dos",
[
"tres",
new SourceNode(5, 6, "c.js", "quatro")
]
]);
node.walk(function (code, loc) { console.log("WALK:", code, loc); })
// WALK: uno { source: 'b.js', line: 3, column: 4, name: null }
// WALK: dos { source: 'a.js', line: 1, column: 2, name: null }
// WALK: tres { source: 'a.js', line: 1, column: 2, name: null }
// WALK: quatro { source: 'c.js', line: 5, column: 6, name: null }
```
#### SourceNode.prototype.walkSourceContents(fn)
Walk over the tree of SourceNodes. The walking function is called for each
source file content and is passed the filename and source content.
* `fn`: The traversal function.
```js
var a = new SourceNode(1, 2, "a.js", "generated from a");
a.setSourceContent("a.js", "original a");
var b = new SourceNode(1, 2, "b.js", "generated from b");
b.setSourceContent("b.js", "original b");
var c = new SourceNode(1, 2, "c.js", "generated from c");
c.setSourceContent("c.js", "original c");
var node = new SourceNode(null, null, null, [a, b, c]);
node.walkSourceContents(function (source, contents) { console.log("WALK:", source, ":", contents); })
// WALK: a.js : original a
// WALK: b.js : original b
// WALK: c.js : original c
```
#### SourceNode.prototype.join(sep)
Like `Array.prototype.join` except for SourceNodes. Inserts the separator
between each of this source node's children.
* `sep`: The separator.
```js
var lhs = new SourceNode(1, 2, "a.rs", "my_copy");
var operand = new SourceNode(3, 4, "a.rs", "=");
var rhs = new SourceNode(5, 6, "a.rs", "orig.clone()");
var node = new SourceNode(null, null, null, [ lhs, operand, rhs ]);
var joinedNode = node.join(" ");
```
#### SourceNode.prototype.replaceRight(pattern, replacement)
Call `String.prototype.replace` on the very right-most source snippet. Useful
for trimming white space from the end of a source node, etc.
* `pattern`: The pattern to replace.
* `replacement`: The thing to replace the pattern with.
```js
// Trim trailing white space.
node.replaceRight(/\s*$/, "");
```
#### SourceNode.prototype.toString()
Return the string representation of this source node. Walks over the tree and
concatenates all the various snippets together to one string.
```js
var node = new SourceNode(1, 2, "a.js", [
new SourceNode(3, 4, "b.js", "uno"),
"dos",
[
"tres",
new SourceNode(5, 6, "c.js", "quatro")
]
]);
node.toString()
// 'unodostresquatro'
```
#### SourceNode.prototype.toStringWithSourceMap([startOfSourceMap])
Returns the string representation of this tree of source nodes, plus a
SourceMapGenerator which contains all the mappings between the generated and
original sources.
The arguments are the same as those to `new SourceMapGenerator`.
```js
var node = new SourceNode(1, 2, "a.js", [
new SourceNode(3, 4, "b.js", "uno"),
"dos",
[
"tres",
new SourceNode(5, 6, "c.js", "quatro")
]
]);
node.toStringWithSourceMap({ file: "my-output-file.js" })
// { code: 'unodostresquatro',
// map: [object SourceMapGenerator] }
```

View File

@@ -0,0 +1,81 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for csv2json/browser_index.js</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</a> browser_index.js
</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">0% </span>
<span class="quiet">Statements</span>
<span class='fraction'>0/3</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">0% </span>
<span class="quiet">Branches</span>
<span class='fraction'>0/2</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Functions</span>
<span class='fraction'>0/0</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">0% </span>
<span class="quiet">Lines</span>
<span class='fraction'>0/3</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 low'></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></td><td class="line-coverage quiet"><span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&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"><span class="cstat-no" title="statement not covered" >if (window){</span>
<span class="cstat-no" title="statement not covered" > window.csvtojson=require("./index.js");</span>
<span class="cstat-no" title="statement not covered" > window.csvtojson.version=require("./package.json").version;</span>
}
&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 @@
module.exports={A:{A:{"1":"A B","2":"J D E F CC"},B:{"1":"C 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"},C:{"1":"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 tB I v J D E F A B C K L G M EC FC","4":"0 1 2 3 N O w g x y z"},D:{"1":"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 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"},E:{"1":"v J D E F A B C K L G IC JC KC LC 0B qB rB 1B MC NC 2B 3B 4B 5B sB 6B 7B 8B 9B OC","2":"I HC zB"},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 C PC QC RC SC qB AC TC rB"},G:{"1":"E BC VC 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 UC"},H:{"2":"oC"},I:{"1":"tB I f qC rC sC BC tC uC","2":"pC"},J:{"1":"D A"},K:{"1":"h","2":"A B C qB AC rB"},L:{"1":"H"},M:{"1":"H"},N:{"1":"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:"sandbox attribute for iframes"};

View File

@@ -0,0 +1,477 @@
// Copyright Joyent, Inc. and other Node contributors.
//
// 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.
// A bit simpler than readable streams.
// Implement an async ._write(chunk, cb), and it'll handle all
// the drain event emission and buffering.
module.exports = Writable;
/*<replacement>*/
var Buffer = require('buffer').Buffer;
/*</replacement>*/
Writable.WritableState = WritableState;
/*<replacement>*/
var util = require('core-util-is');
util.inherits = require('inherits');
/*</replacement>*/
var Stream = require('stream');
util.inherits(Writable, Stream);
function WriteReq(chunk, encoding, cb) {
this.chunk = chunk;
this.encoding = encoding;
this.callback = cb;
}
function WritableState(options, stream) {
var Duplex = require('./_stream_duplex');
options = options || {};
// the point at which write() starts returning false
// Note: 0 is a valid value, means that we always return false if
// the entire buffer is not flushed immediately on write()
var hwm = options.highWaterMark;
var defaultHwm = options.objectMode ? 16 : 16 * 1024;
this.highWaterMark = (hwm || hwm === 0) ? hwm : defaultHwm;
// object stream flag to indicate whether or not this stream
// contains buffers or objects.
this.objectMode = !!options.objectMode;
if (stream instanceof Duplex)
this.objectMode = this.objectMode || !!options.writableObjectMode;
// cast to ints.
this.highWaterMark = ~~this.highWaterMark;
this.needDrain = false;
// at the start of calling end()
this.ending = false;
// when end() has been called, and returned
this.ended = false;
// when 'finish' is emitted
this.finished = false;
// should we decode strings into buffers before passing to _write?
// this is here so that some node-core streams can optimize string
// handling at a lower level.
var noDecode = options.decodeStrings === false;
this.decodeStrings = !noDecode;
// Crypto is kind of old and crusty. Historically, its default string
// encoding is 'binary' so we have to make this configurable.
// Everything else in the universe uses 'utf8', though.
this.defaultEncoding = options.defaultEncoding || 'utf8';
// not an actual buffer we keep track of, but a measurement
// of how much we're waiting to get pushed to some underlying
// socket or file.
this.length = 0;
// a flag to see when we're in the middle of a write.
this.writing = false;
// when true all writes will be buffered until .uncork() call
this.corked = 0;
// a flag to be able to tell if the onwrite cb is called immediately,
// or on a later tick. We set this to true at first, because any
// actions that shouldn't happen until "later" should generally also
// not happen before the first write call.
this.sync = true;
// a flag to know if we're processing previously buffered items, which
// may call the _write() callback in the same tick, so that we don't
// end up in an overlapped onwrite situation.
this.bufferProcessing = false;
// the callback that's passed to _write(chunk,cb)
this.onwrite = function(er) {
onwrite(stream, er);
};
// the callback that the user supplies to write(chunk,encoding,cb)
this.writecb = null;
// the amount that is being written when _write is called.
this.writelen = 0;
this.buffer = [];
// number of pending user-supplied write callbacks
// this must be 0 before 'finish' can be emitted
this.pendingcb = 0;
// emit prefinish if the only thing we're waiting for is _write cbs
// This is relevant for synchronous Transform streams
this.prefinished = false;
// True if the error was already emitted and should not be thrown again
this.errorEmitted = false;
}
function Writable(options) {
var Duplex = require('./_stream_duplex');
// Writable ctor is applied to Duplexes, though they're not
// instanceof Writable, they're instanceof Readable.
if (!(this instanceof Writable) && !(this instanceof Duplex))
return new Writable(options);
this._writableState = new WritableState(options, this);
// legacy.
this.writable = true;
Stream.call(this);
}
// Otherwise people can pipe Writable streams, which is just wrong.
Writable.prototype.pipe = function() {
this.emit('error', new Error('Cannot pipe. Not readable.'));
};
function writeAfterEnd(stream, state, cb) {
var er = new Error('write after end');
// TODO: defer error events consistently everywhere, not just the cb
stream.emit('error', er);
process.nextTick(function() {
cb(er);
});
}
// If we get something that is not a buffer, string, null, or undefined,
// and we're not in objectMode, then that's an error.
// Otherwise stream chunks are all considered to be of length=1, and the
// watermarks determine how many objects to keep in the buffer, rather than
// how many bytes or characters.
function validChunk(stream, state, chunk, cb) {
var valid = true;
if (!util.isBuffer(chunk) &&
!util.isString(chunk) &&
!util.isNullOrUndefined(chunk) &&
!state.objectMode) {
var er = new TypeError('Invalid non-string/buffer chunk');
stream.emit('error', er);
process.nextTick(function() {
cb(er);
});
valid = false;
}
return valid;
}
Writable.prototype.write = function(chunk, encoding, cb) {
var state = this._writableState;
var ret = false;
if (util.isFunction(encoding)) {
cb = encoding;
encoding = null;
}
if (util.isBuffer(chunk))
encoding = 'buffer';
else if (!encoding)
encoding = state.defaultEncoding;
if (!util.isFunction(cb))
cb = function() {};
if (state.ended)
writeAfterEnd(this, state, cb);
else if (validChunk(this, state, chunk, cb)) {
state.pendingcb++;
ret = writeOrBuffer(this, state, chunk, encoding, cb);
}
return ret;
};
Writable.prototype.cork = function() {
var state = this._writableState;
state.corked++;
};
Writable.prototype.uncork = function() {
var state = this._writableState;
if (state.corked) {
state.corked--;
if (!state.writing &&
!state.corked &&
!state.finished &&
!state.bufferProcessing &&
state.buffer.length)
clearBuffer(this, state);
}
};
function decodeChunk(state, chunk, encoding) {
if (!state.objectMode &&
state.decodeStrings !== false &&
util.isString(chunk)) {
chunk = new Buffer(chunk, encoding);
}
return chunk;
}
// if we're already writing something, then just put this
// in the queue, and wait our turn. Otherwise, call _write
// If we return false, then we need a drain event, so set that flag.
function writeOrBuffer(stream, state, chunk, encoding, cb) {
chunk = decodeChunk(state, chunk, encoding);
if (util.isBuffer(chunk))
encoding = 'buffer';
var len = state.objectMode ? 1 : chunk.length;
state.length += len;
var ret = state.length < state.highWaterMark;
// we must ensure that previous needDrain will not be reset to false.
if (!ret)
state.needDrain = true;
if (state.writing || state.corked)
state.buffer.push(new WriteReq(chunk, encoding, cb));
else
doWrite(stream, state, false, len, chunk, encoding, cb);
return ret;
}
function doWrite(stream, state, writev, len, chunk, encoding, cb) {
state.writelen = len;
state.writecb = cb;
state.writing = true;
state.sync = true;
if (writev)
stream._writev(chunk, state.onwrite);
else
stream._write(chunk, encoding, state.onwrite);
state.sync = false;
}
function onwriteError(stream, state, sync, er, cb) {
if (sync)
process.nextTick(function() {
state.pendingcb--;
cb(er);
});
else {
state.pendingcb--;
cb(er);
}
stream._writableState.errorEmitted = true;
stream.emit('error', er);
}
function onwriteStateUpdate(state) {
state.writing = false;
state.writecb = null;
state.length -= state.writelen;
state.writelen = 0;
}
function onwrite(stream, er) {
var state = stream._writableState;
var sync = state.sync;
var cb = state.writecb;
onwriteStateUpdate(state);
if (er)
onwriteError(stream, state, sync, er, cb);
else {
// Check if we're actually ready to finish, but don't emit yet
var finished = needFinish(stream, state);
if (!finished &&
!state.corked &&
!state.bufferProcessing &&
state.buffer.length) {
clearBuffer(stream, state);
}
if (sync) {
process.nextTick(function() {
afterWrite(stream, state, finished, cb);
});
} else {
afterWrite(stream, state, finished, cb);
}
}
}
function afterWrite(stream, state, finished, cb) {
if (!finished)
onwriteDrain(stream, state);
state.pendingcb--;
cb();
finishMaybe(stream, state);
}
// Must force callback to be called on nextTick, so that we don't
// emit 'drain' before the write() consumer gets the 'false' return
// value, and has a chance to attach a 'drain' listener.
function onwriteDrain(stream, state) {
if (state.length === 0 && state.needDrain) {
state.needDrain = false;
stream.emit('drain');
}
}
// if there's something in the buffer waiting, then process it
function clearBuffer(stream, state) {
state.bufferProcessing = true;
if (stream._writev && state.buffer.length > 1) {
// Fast case, write everything using _writev()
var cbs = [];
for (var c = 0; c < state.buffer.length; c++)
cbs.push(state.buffer[c].callback);
// count the one we are adding, as well.
// TODO(isaacs) clean this up
state.pendingcb++;
doWrite(stream, state, true, state.length, state.buffer, '', function(err) {
for (var i = 0; i < cbs.length; i++) {
state.pendingcb--;
cbs[i](err);
}
});
// Clear buffer
state.buffer = [];
} else {
// Slow case, write chunks one-by-one
for (var c = 0; c < state.buffer.length; c++) {
var entry = state.buffer[c];
var chunk = entry.chunk;
var encoding = entry.encoding;
var cb = entry.callback;
var len = state.objectMode ? 1 : chunk.length;
doWrite(stream, state, false, len, chunk, encoding, cb);
// if we didn't call the onwrite immediately, then
// it means that we need to wait until it does.
// also, that means that the chunk and cb are currently
// being processed, so move the buffer counter past them.
if (state.writing) {
c++;
break;
}
}
if (c < state.buffer.length)
state.buffer = state.buffer.slice(c);
else
state.buffer.length = 0;
}
state.bufferProcessing = false;
}
Writable.prototype._write = function(chunk, encoding, cb) {
cb(new Error('not implemented'));
};
Writable.prototype._writev = null;
Writable.prototype.end = function(chunk, encoding, cb) {
var state = this._writableState;
if (util.isFunction(chunk)) {
cb = chunk;
chunk = null;
encoding = null;
} else if (util.isFunction(encoding)) {
cb = encoding;
encoding = null;
}
if (!util.isNullOrUndefined(chunk))
this.write(chunk, encoding);
// .end() fully uncorks
if (state.corked) {
state.corked = 1;
this.uncork();
}
// ignore unnecessary end() calls.
if (!state.ending && !state.finished)
endWritable(this, state, cb);
};
function needFinish(stream, state) {
return (state.ending &&
state.length === 0 &&
!state.finished &&
!state.writing);
}
function prefinish(stream, state) {
if (!state.prefinished) {
state.prefinished = true;
stream.emit('prefinish');
}
}
function finishMaybe(stream, state) {
var need = needFinish(stream, state);
if (need) {
if (state.pendingcb === 0) {
prefinish(stream, state);
state.finished = true;
stream.emit('finish');
} else
prefinish(stream, state);
}
return need;
}
function endWritable(stream, state, cb) {
state.ending = true;
finishMaybe(stream, state);
if (cb) {
if (state.finished)
process.nextTick(cb);
else
stream.once('finish', cb);
}
state.ended = true;
}

View File

@@ -0,0 +1,2 @@
if(typeof cptable === 'undefined') cptable = {};
cptable[20880] = (function(){ var d = "ŸŸ\u0002\u0003œ\t†—Ž\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013…\b‡\u0018\u0019’\u001c\u001d\u001e\u001f€‚ƒ„\n\u0017\u001bˆ‰Š‹Œ\u0005\u0006\u0007‘\u0016“”•–\u0004˜™š›\u0014\u0015ž\u001a  ђѓёєѕіїј[.<(+!&љњћќўџЪ№Ђ]$*);^-/ЃЁЄЅІЇЈЉ|,%_>?ЊЋЌ­ЎЏюаб`:#@'=\"цabcdefghiдефгхийjklmnopqrклмнопя~stuvwxyzрстужвьызшэщчъЮАБЦДЕФГ{ABCDEFGHIХИЙКЛМ}JKLMNOPQRНОПЯРС\\¤STUVWXYZТУЖВЬЫ0123456789ЗШЭЩЧŸ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();

View File

@@ -0,0 +1,148 @@
"use strict";
module.exports =
function(Promise, PromiseArray, apiRejection) {
var util = require("./util");
var RangeError = require("./errors").RangeError;
var AggregateError = require("./errors").AggregateError;
var isArray = util.isArray;
var CANCELLATION = {};
function SomePromiseArray(values) {
this.constructor$(values);
this._howMany = 0;
this._unwrap = false;
this._initialized = false;
}
util.inherits(SomePromiseArray, PromiseArray);
SomePromiseArray.prototype._init = function () {
if (!this._initialized) {
return;
}
if (this._howMany === 0) {
this._resolve([]);
return;
}
this._init$(undefined, -5);
var isArrayResolved = isArray(this._values);
if (!this._isResolved() &&
isArrayResolved &&
this._howMany > this._canPossiblyFulfill()) {
this._reject(this._getRangeError(this.length()));
}
};
SomePromiseArray.prototype.init = function () {
this._initialized = true;
this._init();
};
SomePromiseArray.prototype.setUnwrap = function () {
this._unwrap = true;
};
SomePromiseArray.prototype.howMany = function () {
return this._howMany;
};
SomePromiseArray.prototype.setHowMany = function (count) {
this._howMany = count;
};
SomePromiseArray.prototype._promiseFulfilled = function (value) {
this._addFulfilled(value);
if (this._fulfilled() === this.howMany()) {
this._values.length = this.howMany();
if (this.howMany() === 1 && this._unwrap) {
this._resolve(this._values[0]);
} else {
this._resolve(this._values);
}
return true;
}
return false;
};
SomePromiseArray.prototype._promiseRejected = function (reason) {
this._addRejected(reason);
return this._checkOutcome();
};
SomePromiseArray.prototype._promiseCancelled = function () {
if (this._values instanceof Promise || this._values == null) {
return this._cancel();
}
this._addRejected(CANCELLATION);
return this._checkOutcome();
};
SomePromiseArray.prototype._checkOutcome = function() {
if (this.howMany() > this._canPossiblyFulfill()) {
var e = new AggregateError();
for (var i = this.length(); i < this._values.length; ++i) {
if (this._values[i] !== CANCELLATION) {
e.push(this._values[i]);
}
}
if (e.length > 0) {
this._reject(e);
} else {
this._cancel();
}
return true;
}
return false;
};
SomePromiseArray.prototype._fulfilled = function () {
return this._totalResolved;
};
SomePromiseArray.prototype._rejected = function () {
return this._values.length - this.length();
};
SomePromiseArray.prototype._addRejected = function (reason) {
this._values.push(reason);
};
SomePromiseArray.prototype._addFulfilled = function (value) {
this._values[this._totalResolved++] = value;
};
SomePromiseArray.prototype._canPossiblyFulfill = function () {
return this.length() - this._rejected();
};
SomePromiseArray.prototype._getRangeError = function (count) {
var message = "Input array must contain at least " +
this._howMany + " items but contains only " + count + " items";
return new RangeError(message);
};
SomePromiseArray.prototype._resolveEmptyArray = function () {
this._reject(this._getRangeError(0));
};
function some(promises, howMany) {
if ((howMany | 0) !== howMany || howMany < 0) {
return apiRejection("expecting a positive integer\u000a\u000a See http://goo.gl/MqrFmX\u000a");
}
var ret = new SomePromiseArray(promises);
var promise = ret.promise();
ret.setHowMany(howMany);
ret.init();
return promise;
}
Promise.some = function (promises, howMany) {
return some(promises, howMany);
};
Promise.prototype.some = function (howMany) {
return some(this, howMany);
};
Promise._SomePromiseArray = SomePromiseArray;
};

View File

@@ -0,0 +1 @@
{"version":3,"file":"timer.js","sourceRoot":"","sources":["../../../../src/internal/observable/timer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAE,KAAK,IAAI,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAgI7C,MAAM,UAAU,KAAK,CACnB,UAAyB,CAAC,EAC1B,mBAA4C,EAC5C,YAA2B,cAAc;IAIzC,IAAI,gBAAgB,GAAG,CAAC,CAAC,CAAC;IAE1B,IAAI,mBAAmB,IAAI,IAAI,EAAE;QAI/B,IAAI,WAAW,CAAC,mBAAmB,CAAC,EAAE;YACpC,SAAS,GAAG,mBAAmB,CAAC;SACjC;aAAM;YAGL,gBAAgB,GAAG,mBAAmB,CAAC;SACxC;KACF;IAED,OAAO,IAAI,UAAU,CAAC,CAAC,UAAU,EAAE,EAAE;QAInC,IAAI,GAAG,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,GAAG,SAAU,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC;QAEvE,IAAI,GAAG,GAAG,CAAC,EAAE;YAEX,GAAG,GAAG,CAAC,CAAC;SACT;QAGD,IAAI,CAAC,GAAG,CAAC,CAAC;QAGV,OAAO,SAAS,CAAC,QAAQ,CAAC;YACxB,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE;gBAEtB,UAAU,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC;gBAErB,IAAI,CAAC,IAAI,gBAAgB,EAAE;oBAGzB,IAAI,CAAC,QAAQ,CAAC,SAAS,EAAE,gBAAgB,CAAC,CAAC;iBAC5C;qBAAM;oBAEL,UAAU,CAAC,QAAQ,EAAE,CAAC;iBACvB;aACF;QACH,CAAC,EAAE,GAAG,CAAC,CAAC;IACV,CAAC,CAAC,CAAC;AACL,CAAC"}

View File

@@ -0,0 +1,13 @@
{
"root": true,
"extends": "@ljharb",
"rules": {
"new-cap": [2, {
"capIsNewExceptions": [
"GetIntrinsic",
],
}],
},
}

View File

@@ -0,0 +1,40 @@
import type {Except} from './except';
import type {Simplify} from './simplify';
/**
Create a type that strips `readonly` from all or some of an object's keys. Inverse of `Readonly<T>`.
This can be used to [store and mutate options within a class](https://github.com/sindresorhus/pageres/blob/4a5d05fca19a5fbd2f53842cbf3eb7b1b63bddd2/source/index.ts#L72), [edit `readonly` objects within tests](https://stackoverflow.com/questions/50703834), [construct a `readonly` object within a function](https://github.com/Microsoft/TypeScript/issues/24509), or to define a single model where the only thing that changes is whether or not some of the keys are writable.
@example
```
import type {Writable} from 'type-fest';
type Foo = {
readonly a: number;
readonly b: readonly string[]; // To show that only the mutability status of the properties, not their values, are affected.
readonly c: boolean;
};
const writableFoo: Writable<Foo> = {a: 1, b: ['2'], c: true};
writableFoo.a = 3;
writableFoo.b[0] = 'new value'; // Will still fail as the value of property "b" is still a readonly type.
writableFoo.b = ['something']; // Will work as the "b" property itself is no longer readonly.
type SomeWritable = Writable<Foo, 'b' | 'c'>;
// type SomeWritable = {
// readonly a: number;
// b: readonly string[]; // It's now writable. The type of the property remains unaffected.
// c: boolean; // It's now writable.
// }
```
@category Object
*/
export type Writable<BaseType, Keys extends keyof BaseType = keyof BaseType> =
Simplify<
// Pick just the keys that are not writable from the base type.
Except<BaseType, Keys> &
// Pick the keys that should be writable from the base type and make them writable by removing the `readonly` modifier from the key.
{-readonly [KeyType in keyof Pick<BaseType, Keys>]: Pick<BaseType, Keys>[KeyType]}
>;

View File

@@ -0,0 +1,14 @@
"use strict";
module.exports = function () {
var arr = [1, "foo"], iterator, result;
if (typeof arr.keys !== "function") return false;
iterator = arr.keys();
if (!iterator) return false;
if (typeof iterator.next !== "function") return false;
result = iterator.next();
if (!result) return false;
if (result.value !== 0) return false;
if (result.done !== false) return false;
return true;
};