new license file version [CI SKIP]
This commit is contained in:
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"distinct.js","sourceRoot":"","sources":["../../../../src/internal/operators/distinct.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAChE,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AA2DpD,MAAM,UAAU,QAAQ,CAAO,WAA6B,EAAE,OAA8B;IAC1F,OAAO,OAAO,CAAC,CAAC,MAAM,EAAE,UAAU,EAAE,EAAE;QACpC,MAAM,YAAY,GAAG,IAAI,GAAG,EAAE,CAAC;QAC/B,MAAM,CAAC,SAAS,CACd,wBAAwB,CAAC,UAAU,EAAE,CAAC,KAAK,EAAE,EAAE;YAC7C,MAAM,GAAG,GAAG,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;YACrD,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;gBAC1B,YAAY,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;gBACtB,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;aACxB;QACH,CAAC,CAAC,CACH,CAAC;QAEF,OAAO,IAAI,SAAS,CAAC,OAAO,CAAC,CAAC,SAAS,CAAC,wBAAwB,CAAC,UAAU,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,KAAK,EAAE,EAAE,IAAI,CAAC,CAAC,CAAC;IAClH,CAAC,CAAC,CAAC;AACL,CAAC"}
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"format_to_parts.d.ts","sourceRoot":"","sources":["../../../../../../../packages/ecma402-abstract/NumberFormat/format_to_parts.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,wBAAwB,EACxB,2BAA2B,EAC3B,iCAAiC,EACjC,kCAAkC,EAClC,+BAA+B,EAC/B,8BAA8B,EAC9B,8BAA8B,EAM9B,gBAAgB,EACjB,MAAM,iBAAiB,CAAA;AAexB,UAAU,YAAY;IACpB,eAAe,EAAE,MAAM,CAAA;IACvB,aAAa,EAAE,MAAM,CAAA;IACrB,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;IAEhB,QAAQ,EAAE,MAAM,CAAA;IAChB,SAAS,EAAE,MAAM,CAAA;CAClB;AAED,MAAM,CAAC,OAAO,UAAU,aAAa,CACnC,YAAY,EAAE,YAAY,EAC1B,IAAI,EAAE,8BAA8B,EACpC,EAAE,EAAE,IAAI,CAAC,WAAW,EACpB,OAAO,EAAE;IACP,eAAe,EAAE,MAAM,CAAA;IACvB,WAAW,EAAE,OAAO,CAAA;IACpB,KAAK,EAAE,wBAAwB,CAAA;IAE/B,QAAQ,EAAE,2BAA2B,CAAA;IAErC,cAAc,CAAC,EAAE,iCAAiC,CAAA;IAElD,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,eAAe,CAAC,EAAE,kCAAkC,CAAA;IACpD,YAAY,CAAC,EAAE,+BAA+B,CAAA;IAE9C,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,WAAW,CAAC,EAAE,8BAA8B,CAAA;CAC7C,GACA,gBAAgB,EAAE,CAySpB"}
|
||||
@@ -0,0 +1,37 @@
|
||||
'use strict';
|
||||
const callsites = require('callsites');
|
||||
|
||||
module.exports = filepath => {
|
||||
const stacks = callsites();
|
||||
|
||||
if (!filepath) {
|
||||
return stacks[2].getFileName();
|
||||
}
|
||||
|
||||
let seenVal = false;
|
||||
|
||||
// Skip the first stack as it's this function
|
||||
stacks.shift();
|
||||
|
||||
for (const stack of stacks) {
|
||||
const parentFilepath = stack.getFileName();
|
||||
|
||||
if (typeof parentFilepath !== 'string') {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (parentFilepath === filepath) {
|
||||
seenVal = true;
|
||||
continue;
|
||||
}
|
||||
|
||||
// Skip native modules
|
||||
if (parentFilepath === 'module.js') {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (seenVal && parentFilepath !== filepath) {
|
||||
return parentFilepath;
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,3 @@
|
||||
import { EndpointsDefaultsAndDecorations } from "../types";
|
||||
declare const Endpoints: EndpointsDefaultsAndDecorations;
|
||||
export default Endpoints;
|
||||
@@ -0,0 +1,58 @@
|
||||
//TODO: handle reviver/dehydrate function like normal
|
||||
//and handle indentation, like normal.
|
||||
//if anyone needs this... please send pull request.
|
||||
|
||||
exports.stringify = function stringify (o) {
|
||||
if('undefined' == typeof o) return o
|
||||
|
||||
if(o && Buffer.isBuffer(o))
|
||||
return JSON.stringify(':base64:' + o.toString('base64'))
|
||||
|
||||
if(o && o.toJSON)
|
||||
o = o.toJSON()
|
||||
|
||||
if(o && 'object' === typeof o) {
|
||||
var s = ''
|
||||
var array = Array.isArray(o)
|
||||
s = array ? '[' : '{'
|
||||
var first = true
|
||||
|
||||
for(var k in o) {
|
||||
var ignore = 'function' == typeof o[k] || (!array && 'undefined' === typeof o[k])
|
||||
if(Object.hasOwnProperty.call(o, k) && !ignore) {
|
||||
if(!first)
|
||||
s += ','
|
||||
first = false
|
||||
if (array) {
|
||||
if(o[k] == undefined)
|
||||
s += 'null'
|
||||
else
|
||||
s += stringify(o[k])
|
||||
} else if (o[k] !== void(0)) {
|
||||
s += stringify(k) + ':' + stringify(o[k])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
s += array ? ']' : '}'
|
||||
|
||||
return s
|
||||
} else if ('string' === typeof o) {
|
||||
return JSON.stringify(/^:/.test(o) ? ':' + o : o)
|
||||
} else if ('undefined' === typeof o) {
|
||||
return 'null';
|
||||
} else
|
||||
return JSON.stringify(o)
|
||||
}
|
||||
|
||||
exports.parse = function (s) {
|
||||
return JSON.parse(s, function (key, value) {
|
||||
if('string' === typeof value) {
|
||||
if(/^:base64:/.test(value))
|
||||
return Buffer.from(value.substring(8), 'base64')
|
||||
else
|
||||
return /^:/.test(value) ? value.substring(1) : value
|
||||
}
|
||||
return value
|
||||
})
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
'use strict'
|
||||
Object.defineProperty(exports, '__esModule', { value: true })
|
||||
|
||||
const legacy = require('../dist/legacy-exports')
|
||||
exports.default = [legacy.intTime, legacy.floatTime, legacy.timestamp]
|
||||
exports.floatTime = legacy.floatTime
|
||||
exports.intTime = legacy.intTime
|
||||
exports.timestamp = legacy.timestamp
|
||||
|
||||
legacy.warnFileDeprecation(__filename)
|
||||
@@ -0,0 +1,5 @@
|
||||
var convert = require('./convert'),
|
||||
func = convert('indexOf', require('../indexOf'));
|
||||
|
||||
func.placeholder = require('./placeholder');
|
||||
module.exports = func;
|
||||
@@ -0,0 +1,345 @@
|
||||
{
|
||||
"program": {
|
||||
"fileInfos": {
|
||||
"../node_modules/typescript/lib/lib.es5.d.ts": {
|
||||
"version": "fc43680ad3a1a4ec8c7b8d908af1ec9ddff87845346de5f02c735c9171fa98ea",
|
||||
"signature": "fc43680ad3a1a4ec8c7b8d908af1ec9ddff87845346de5f02c735c9171fa98ea"
|
||||
},
|
||||
"../node_modules/typescript/lib/lib.es2015.d.ts": {
|
||||
"version": "7994d44005046d1413ea31d046577cdda33b8b2470f30281fd9c8b3c99fe2d96",
|
||||
"signature": "7994d44005046d1413ea31d046577cdda33b8b2470f30281fd9c8b3c99fe2d96"
|
||||
},
|
||||
"../node_modules/typescript/lib/lib.es2016.d.ts": {
|
||||
"version": "5f217838d25704474d9ef93774f04164889169ca31475fe423a9de6758f058d1",
|
||||
"signature": "5f217838d25704474d9ef93774f04164889169ca31475fe423a9de6758f058d1"
|
||||
},
|
||||
"../node_modules/typescript/lib/lib.es2017.d.ts": {
|
||||
"version": "459097c7bdd88fc5731367e56591e4f465f2c9de81a35427a7bd473165c34743",
|
||||
"signature": "459097c7bdd88fc5731367e56591e4f465f2c9de81a35427a7bd473165c34743"
|
||||
},
|
||||
"../node_modules/typescript/lib/lib.dom.d.ts": {
|
||||
"version": "d93de5e8a7275cb9d47481410e13b3b1debb997e216490954b5d106e37e086de",
|
||||
"signature": "d93de5e8a7275cb9d47481410e13b3b1debb997e216490954b5d106e37e086de"
|
||||
},
|
||||
"../node_modules/typescript/lib/lib.dom.iterable.d.ts": {
|
||||
"version": "8329c3401aa8708426c7760f14219170f69a2cb77e4519758cec6f5027270faf",
|
||||
"signature": "8329c3401aa8708426c7760f14219170f69a2cb77e4519758cec6f5027270faf"
|
||||
},
|
||||
"../node_modules/typescript/lib/lib.webworker.importscripts.d.ts": {
|
||||
"version": "fe4e59403e34c7ff747abe4ff6abbc7718229556d7c1a5b93473fb53156c913b",
|
||||
"signature": "fe4e59403e34c7ff747abe4ff6abbc7718229556d7c1a5b93473fb53156c913b"
|
||||
},
|
||||
"../node_modules/typescript/lib/lib.scripthost.d.ts": {
|
||||
"version": "b9faa17292f17d2ad75e34fac77dd63a6403af1dba02d39cd0cbb9ffdf3de8b9",
|
||||
"signature": "b9faa17292f17d2ad75e34fac77dd63a6403af1dba02d39cd0cbb9ffdf3de8b9"
|
||||
},
|
||||
"../node_modules/typescript/lib/lib.es2015.core.d.ts": {
|
||||
"version": "734ddc145e147fbcd55f07d034f50ccff1086f5a880107665ec326fb368876f6",
|
||||
"signature": "734ddc145e147fbcd55f07d034f50ccff1086f5a880107665ec326fb368876f6"
|
||||
},
|
||||
"../node_modules/typescript/lib/lib.es2015.collection.d.ts": {
|
||||
"version": "4a0862a21f4700de873db3b916f70e41570e2f558da77d2087c9490f5a0615d8",
|
||||
"signature": "4a0862a21f4700de873db3b916f70e41570e2f558da77d2087c9490f5a0615d8"
|
||||
},
|
||||
"../node_modules/typescript/lib/lib.es2015.generator.d.ts": {
|
||||
"version": "765e0e9c9d74cf4d031ca8b0bdb269a853e7d81eda6354c8510218d03db12122",
|
||||
"signature": "765e0e9c9d74cf4d031ca8b0bdb269a853e7d81eda6354c8510218d03db12122"
|
||||
},
|
||||
"../node_modules/typescript/lib/lib.es2015.iterable.d.ts": {
|
||||
"version": "285958e7699f1babd76d595830207f18d719662a0c30fac7baca7df7162a9210",
|
||||
"signature": "285958e7699f1babd76d595830207f18d719662a0c30fac7baca7df7162a9210"
|
||||
},
|
||||
"../node_modules/typescript/lib/lib.es2015.promise.d.ts": {
|
||||
"version": "d4deaafbb18680e3143e8b471acd650ed6f72a408a33137f0a0dd104fbe7f8ca",
|
||||
"signature": "d4deaafbb18680e3143e8b471acd650ed6f72a408a33137f0a0dd104fbe7f8ca"
|
||||
},
|
||||
"../node_modules/typescript/lib/lib.es2015.proxy.d.ts": {
|
||||
"version": "5e72f949a89717db444e3bd9433468890068bb21a5638d8ab15a1359e05e54fe",
|
||||
"signature": "5e72f949a89717db444e3bd9433468890068bb21a5638d8ab15a1359e05e54fe"
|
||||
},
|
||||
"../node_modules/typescript/lib/lib.es2015.reflect.d.ts": {
|
||||
"version": "f5b242136ae9bfb1cc99a5971cccc44e99947ae6b5ef6fd8aa54b5ade553b976",
|
||||
"signature": "f5b242136ae9bfb1cc99a5971cccc44e99947ae6b5ef6fd8aa54b5ade553b976"
|
||||
},
|
||||
"../node_modules/typescript/lib/lib.es2015.symbol.d.ts": {
|
||||
"version": "9ae2860252d6b5f16e2026d8a2c2069db7b2a3295e98b6031d01337b96437230",
|
||||
"signature": "9ae2860252d6b5f16e2026d8a2c2069db7b2a3295e98b6031d01337b96437230"
|
||||
},
|
||||
"../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts": {
|
||||
"version": "3e0a459888f32b42138d5a39f706ff2d55d500ab1031e0988b5568b0f67c2303",
|
||||
"signature": "3e0a459888f32b42138d5a39f706ff2d55d500ab1031e0988b5568b0f67c2303"
|
||||
},
|
||||
"../node_modules/typescript/lib/lib.es2016.array.include.d.ts": {
|
||||
"version": "3f96f1e570aedbd97bf818c246727151e873125d0512e4ae904330286c721bc0",
|
||||
"signature": "3f96f1e570aedbd97bf818c246727151e873125d0512e4ae904330286c721bc0"
|
||||
},
|
||||
"../node_modules/typescript/lib/lib.es2017.object.d.ts": {
|
||||
"version": "c2d60b2e558d44384e4704b00e6b3d154334721a911f094d3133c35f0917b408",
|
||||
"signature": "c2d60b2e558d44384e4704b00e6b3d154334721a911f094d3133c35f0917b408"
|
||||
},
|
||||
"../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts": {
|
||||
"version": "b8667586a618c5cf64523d4e500ae39e781428abfb28f3de441fc66b56144b6f",
|
||||
"signature": "b8667586a618c5cf64523d4e500ae39e781428abfb28f3de441fc66b56144b6f"
|
||||
},
|
||||
"../node_modules/typescript/lib/lib.es2017.string.d.ts": {
|
||||
"version": "21df2e0059f14dcb4c3a0e125859f6b6ff01332ee24b0065a741d121250bc71c",
|
||||
"signature": "21df2e0059f14dcb4c3a0e125859f6b6ff01332ee24b0065a741d121250bc71c"
|
||||
},
|
||||
"../node_modules/typescript/lib/lib.es2017.intl.d.ts": {
|
||||
"version": "c1759cb171c7619af0d2234f2f8fb2a871ee88e956e2ed91bb61778e41f272c6",
|
||||
"signature": "c1759cb171c7619af0d2234f2f8fb2a871ee88e956e2ed91bb61778e41f272c6"
|
||||
},
|
||||
"../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts": {
|
||||
"version": "28569d59e07d4378cb3d54979c4c60f9f06305c9bb6999ffe6cab758957adc46",
|
||||
"signature": "28569d59e07d4378cb3d54979c4c60f9f06305c9bb6999ffe6cab758957adc46"
|
||||
},
|
||||
"../node_modules/typescript/lib/lib.es2017.full.d.ts": {
|
||||
"version": "873c09f1c309389742d98b7b67419a8e0a5fa6f10ce59fd5149ecd31a2818594",
|
||||
"signature": "873c09f1c309389742d98b7b67419a8e0a5fa6f10ce59fd5149ecd31a2818594"
|
||||
},
|
||||
"../node_modules/@types/estree/index.d.ts": {
|
||||
"version": "c2efad8a2f2d7fb931ff15c7959fb45340e74684cd665ddf0cbf9b3977be1644",
|
||||
"signature": "c2efad8a2f2d7fb931ff15c7959fb45340e74684cd665ddf0cbf9b3977be1644"
|
||||
},
|
||||
"../src/walker.js": {
|
||||
"version": "4cc9d0e334d83a4cebeeac502de37a1aeeb953f6d4145a886d9eecea1f2142a7",
|
||||
"signature": "075872468ccc19c83b03fd717fc9305b5f8ec09592210cf60279cb13eca2bd70"
|
||||
},
|
||||
"../src/async.js": {
|
||||
"version": "904efd145090ac40c3c98f29cc928332898a62ab642dd5921db2ae249bfe014a",
|
||||
"signature": "da428f781d6dc6dfd4f4afd0dd5f25a780897dc8b57e5b30462491b7d08f32c0"
|
||||
},
|
||||
"../src/sync.js": {
|
||||
"version": "85bb22b85042f0a3717d8fac2fc8f62af16894652be34d1e08eb3e63785535f5",
|
||||
"signature": "5b131a727db18c956611a5e33d08217df96d0f2e0f26d98b804d1ec2407e59ae"
|
||||
},
|
||||
"../src/index.js": {
|
||||
"version": "99128f4c6cb79cb1e3abf3f2ba96faedd2b820aab4fd7f743aab0b8d710a73af",
|
||||
"signature": "c52be5c79280bfcfcf359c084c6f2f70f405b0ad14dde96b6703dbc5ef2261f5"
|
||||
}
|
||||
},
|
||||
"options": {
|
||||
"allowJs": true,
|
||||
"target": 4,
|
||||
"module": 99,
|
||||
"types": [
|
||||
"estree"
|
||||
],
|
||||
"declaration": true,
|
||||
"declarationDir": "./",
|
||||
"emitDeclarationOnly": true,
|
||||
"outDir": "./",
|
||||
"newLine": 1,
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"incremental": true,
|
||||
"configFilePath": "../tsconfig.json"
|
||||
},
|
||||
"referencedMap": {
|
||||
"../src/walker.js": [
|
||||
"../node_modules/@types/estree/index.d.ts"
|
||||
],
|
||||
"../src/async.js": [
|
||||
"../src/walker.js",
|
||||
"../node_modules/@types/estree/index.d.ts"
|
||||
],
|
||||
"../src/sync.js": [
|
||||
"../src/walker.js",
|
||||
"../node_modules/@types/estree/index.d.ts"
|
||||
],
|
||||
"../src/index.js": [
|
||||
"../src/sync.js",
|
||||
"../src/async.js",
|
||||
"../node_modules/@types/estree/index.d.ts"
|
||||
]
|
||||
},
|
||||
"exportedModulesMap": {
|
||||
"../src/walker.js": [
|
||||
"../node_modules/@types/estree/index.d.ts"
|
||||
],
|
||||
"../src/async.js": [
|
||||
"../node_modules/@types/estree/index.d.ts"
|
||||
],
|
||||
"../src/sync.js": [
|
||||
"../node_modules/@types/estree/index.d.ts"
|
||||
],
|
||||
"../src/index.js": [
|
||||
"../node_modules/@types/estree/index.d.ts"
|
||||
]
|
||||
},
|
||||
"semanticDiagnosticsPerFile": [
|
||||
"../node_modules/typescript/lib/lib.es5.d.ts",
|
||||
"../node_modules/typescript/lib/lib.es2015.d.ts",
|
||||
"../node_modules/typescript/lib/lib.es2016.d.ts",
|
||||
"../node_modules/typescript/lib/lib.es2017.d.ts",
|
||||
"../node_modules/typescript/lib/lib.dom.d.ts",
|
||||
"../node_modules/typescript/lib/lib.dom.iterable.d.ts",
|
||||
"../node_modules/typescript/lib/lib.webworker.importscripts.d.ts",
|
||||
"../node_modules/typescript/lib/lib.scripthost.d.ts",
|
||||
"../node_modules/typescript/lib/lib.es2015.core.d.ts",
|
||||
"../node_modules/typescript/lib/lib.es2015.collection.d.ts",
|
||||
"../node_modules/typescript/lib/lib.es2015.generator.d.ts",
|
||||
"../node_modules/typescript/lib/lib.es2015.iterable.d.ts",
|
||||
"../node_modules/typescript/lib/lib.es2015.promise.d.ts",
|
||||
"../node_modules/typescript/lib/lib.es2015.proxy.d.ts",
|
||||
"../node_modules/typescript/lib/lib.es2015.reflect.d.ts",
|
||||
"../node_modules/typescript/lib/lib.es2015.symbol.d.ts",
|
||||
"../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts",
|
||||
"../node_modules/typescript/lib/lib.es2016.array.include.d.ts",
|
||||
"../node_modules/typescript/lib/lib.es2017.object.d.ts",
|
||||
"../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts",
|
||||
"../node_modules/typescript/lib/lib.es2017.string.d.ts",
|
||||
"../node_modules/typescript/lib/lib.es2017.intl.d.ts",
|
||||
"../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts",
|
||||
"../node_modules/typescript/lib/lib.es2017.full.d.ts",
|
||||
"../node_modules/@types/estree/index.d.ts",
|
||||
"../src/walker.js",
|
||||
[
|
||||
"../src/async.js",
|
||||
[
|
||||
{
|
||||
"file": "../src/async.js",
|
||||
"start": 864,
|
||||
"length": 12,
|
||||
"messageText": "'_should_skip' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer.",
|
||||
"category": 1,
|
||||
"code": 7022
|
||||
},
|
||||
{
|
||||
"file": "../src/async.js",
|
||||
"start": 907,
|
||||
"length": 14,
|
||||
"messageText": "'_should_remove' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer.",
|
||||
"category": 1,
|
||||
"code": 7022
|
||||
},
|
||||
{
|
||||
"file": "../src/async.js",
|
||||
"start": 954,
|
||||
"length": 12,
|
||||
"messageText": "'_replacement' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer.",
|
||||
"category": 1,
|
||||
"code": 7022
|
||||
},
|
||||
{
|
||||
"file": "../src/async.js",
|
||||
"start": 991,
|
||||
"length": 24,
|
||||
"messageText": "'should_skip' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer.",
|
||||
"category": 1,
|
||||
"code": 7022
|
||||
},
|
||||
{
|
||||
"file": "../src/async.js",
|
||||
"start": 1021,
|
||||
"length": 26,
|
||||
"messageText": "'should_remove' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer.",
|
||||
"category": 1,
|
||||
"code": 7022
|
||||
},
|
||||
{
|
||||
"file": "../src/async.js",
|
||||
"start": 1053,
|
||||
"length": 23,
|
||||
"messageText": "'replacement' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer.",
|
||||
"category": 1,
|
||||
"code": 7022
|
||||
},
|
||||
{
|
||||
"file": "../src/async.js",
|
||||
"start": 1643,
|
||||
"length": 9,
|
||||
"code": 7053,
|
||||
"category": 1,
|
||||
"messageText": {
|
||||
"messageText": "Element implicitly has an 'any' type because expression of type 'string' can't be used to index type 'BaseNode'.",
|
||||
"category": 1,
|
||||
"code": 7053,
|
||||
"next": [
|
||||
{
|
||||
"messageText": "No index signature with a parameter of type 'string' was found on type 'BaseNode'.",
|
||||
"category": 1,
|
||||
"code": 7054
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
[
|
||||
"../src/sync.js",
|
||||
[
|
||||
{
|
||||
"file": "../src/sync.js",
|
||||
"start": 837,
|
||||
"length": 12,
|
||||
"messageText": "'_should_skip' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer.",
|
||||
"category": 1,
|
||||
"code": 7022
|
||||
},
|
||||
{
|
||||
"file": "../src/sync.js",
|
||||
"start": 880,
|
||||
"length": 14,
|
||||
"messageText": "'_should_remove' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer.",
|
||||
"category": 1,
|
||||
"code": 7022
|
||||
},
|
||||
{
|
||||
"file": "../src/sync.js",
|
||||
"start": 927,
|
||||
"length": 12,
|
||||
"messageText": "'_replacement' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer.",
|
||||
"category": 1,
|
||||
"code": 7022
|
||||
},
|
||||
{
|
||||
"file": "../src/sync.js",
|
||||
"start": 964,
|
||||
"length": 24,
|
||||
"messageText": "'should_skip' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer.",
|
||||
"category": 1,
|
||||
"code": 7022
|
||||
},
|
||||
{
|
||||
"file": "../src/sync.js",
|
||||
"start": 994,
|
||||
"length": 26,
|
||||
"messageText": "'should_remove' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer.",
|
||||
"category": 1,
|
||||
"code": 7022
|
||||
},
|
||||
{
|
||||
"file": "../src/sync.js",
|
||||
"start": 1026,
|
||||
"length": 23,
|
||||
"messageText": "'replacement' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer.",
|
||||
"category": 1,
|
||||
"code": 7022
|
||||
},
|
||||
{
|
||||
"file": "../src/sync.js",
|
||||
"start": 1610,
|
||||
"length": 9,
|
||||
"code": 7053,
|
||||
"category": 1,
|
||||
"messageText": {
|
||||
"messageText": "Element implicitly has an 'any' type because expression of type 'string' can't be used to index type 'BaseNode'.",
|
||||
"category": 1,
|
||||
"code": 7053,
|
||||
"next": [
|
||||
{
|
||||
"messageText": "No index signature with a parameter of type 'string' was found on type 'BaseNode'.",
|
||||
"category": 1,
|
||||
"code": 7054
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
"../src/index.js"
|
||||
]
|
||||
},
|
||||
"version": "3.7.5"
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"GetOptionsObject.d.ts","sourceRoot":"","sources":["../../../../../packages/ecma402-abstract/GetOptionsObject.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC,GAAG,CAAC,CAQjE"}
|
||||
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
Escape RegExp special characters.
|
||||
|
||||
You can also use this to escape a string that is inserted into the middle of a regex, for example, into a character class.
|
||||
|
||||
@example
|
||||
```
|
||||
import escapeStringRegexp from 'escape-string-regexp';
|
||||
|
||||
const escapedString = escapeStringRegexp('How much $ for a 🦄?');
|
||||
//=> 'How much \\$ for a 🦄\\?'
|
||||
|
||||
new RegExp(escapedString);
|
||||
```
|
||||
*/
|
||||
export default function escapeStringRegexp(string: string): string;
|
||||
@@ -0,0 +1 @@
|
||||
{"name":"minimist","version":"1.2.8","files":{"LICENSE":{"checkedAt":1678883669892,"integrity":"sha512-UYETA37gNUDKrmMFiphSX5pKZ0Jb2MNZb2l77Vrh0gU/5292uFpO77gMxRn3sD02jPS0RSiMTKfKy151I/M5Yg==","mode":420,"size":1073},".eslintrc":{"checkedAt":1678883669893,"integrity":"sha512-yD5Xe+wojBP42C0hN/bmg1Vn7UDJ/LjBwwgKDd7LFyKO567SpYldrAgHgu6pZnTwJ2oR1GJ5agqmo9TdwG1n7w==","mode":420,"size":511},".nycrc":{"checkedAt":1678883669893,"integrity":"sha512-zyESvn26nGQk2mMsy8Ixd5bEj8qgdhFPxuJqI5uoIxLF4pJn6KpqRh+OL5KeNPJcW6oN5SUoU8Xm8hl5kjncBw==","mode":420,"size":229},"test/all_bool.js":{"checkedAt":1678883669893,"integrity":"sha512-No0z4d5W++xeAHkMWZ8Qmasp7P7agVSA7pNaRix4kSA/B25LLsW3oasKramIPKwATByGTZI15yr8MjmzebiGPw==","mode":420,"size":675},"test/bool.js":{"checkedAt":1678883669893,"integrity":"sha512-L+nenVJA2BF9D2wD+uYp6UbmOTv+brLJdZKzj0be1IPKeVzaujx97UvnM1Z0dtBvsdfDGxgpjEJHa/Vdh+SHjw==","mode":420,"size":3575},"test/dash.js":{"checkedAt":1678883669893,"integrity":"sha512-3vnqJ6xe6nRYX8ZUD21RXymrBOqrHqECOHm/7LTRBjsMeDh+laaYJuMaQ4Z5pODMAJlEbKP6oY5h9Nu8Djcx2g==","mode":420,"size":1245},"test/default_bool.js":{"checkedAt":1678883669893,"integrity":"sha512-bbImUMM14waF+ACD/seYLKYLfw4D0UyVwkaSSny31/Tk5d3bH0gtZTnVpNjTe6gjtpWWtGq3igXsNG1L7L68YA==","mode":420,"size":713},"test/dotted.js":{"checkedAt":1678883669893,"integrity":"sha512-SvtIbw1ZHBvFK22eI7qDBJHA2RhvlgLjOk0K8A3rL+D9DuVdLvQiMXCEf/C02GHU93/JrdJSTTucAQC2L0i1dg==","mode":420,"size":586},"index.js":{"checkedAt":1678883669893,"integrity":"sha512-ZYkdzdCmTozQ3Kqwz7zFE6nWHXZ5ohyxeawJ5wDTU65tPI1rF4sPWH5LHAtgL7l/B2Goe7muopERh5Gb9rtv/Q==","mode":420,"size":6196},"test/kv_short.js":{"checkedAt":1678883669893,"integrity":"sha512-gabN3DHmDKXLXq/sk1OO94QlD08+cKxERwlGn/IIaV8NukzgI8fVfvvA3GA58Au92YQB0uz/wTqd+Im/gYwb/Q==","mode":420,"size":660},"test/num.js":{"checkedAt":1678883669893,"integrity":"sha512-v77ObqccgT6rGyyWgMOu6FnKnecKK5YLLARzqiEfTDFdATym8p73ZQkFYVooju1WkF7xg4sWMKUqp1/T1yuajA==","mode":420,"size":792},"test/parse_modified.js":{"checkedAt":1678883669893,"integrity":"sha512-gajSmBmztDavMxE+EqLgIySy0QYVvTNQvffS8OqOQCDytp+E0WBh6Uf4TWgxl553nc3YPmg6Czb8/A8OrUXrfQ==","mode":420,"size":237},"test/long.js":{"checkedAt":1678883669893,"integrity":"sha512-wr7c1nm4nr0BcuFsWUQaN2bEL2YWsA+4lu0HsIQJc4yedbtaVYZKrmLlWN3lehpRbFQx/JlnGu4c8DQZ6+T4Jw==","mode":420,"size":649},"example/parse.js":{"checkedAt":1678883669893,"integrity":"sha512-g4waPTbNabL6G3BD+UWs21OQsAxV3xQFAPSllpU7BJxOmX6A33a3W05pcng5c8s4Ci0kyutYFonQfmCoNzwekA==","mode":420,"size":84},"test/proto.js":{"checkedAt":1678883669893,"integrity":"sha512-WMIufDzjN7Rq7Asl5tIcwePDHEqR4GLG4T5fr2U5yGQaoCZshpfyIHUQ9zVXvNp/1Xopz9yyOk0dKrTNNf7Ofg==","mode":420,"size":1741},"test/parse.js":{"checkedAt":1678883669893,"integrity":"sha512-j7BmDeR+PdiVXxYcdXuvfEdojQGV8V4cQJ/M5h3mRfl4rOxcn9MCfhfTSSb6cKtlAXm37cWnfRFofzZJ9ECxbQ==","mode":420,"size":4086},"test/stop_early.js":{"checkedAt":1678883669893,"integrity":"sha512-gNUfKZ8Se2oq1NQRkY2agV+kcEe9P5qC0zVOxhl+H0Awfd110hxjYHTDZk15+4SKo4rTSZsVCZLyzaGUwJhYyQ==","mode":420,"size":312},"test/short.js":{"checkedAt":1678883669893,"integrity":"sha512-kuCni7aWR1Aq5c5yi/K/fwFJVib6kfVUwmHEelOv21xpMbIOBT121oBYx6P/5Ip3O7sRpD+ab9kSy7Ychx2PSQ==","mode":420,"size":1295},"test/unknown.js":{"checkedAt":1678883669893,"integrity":"sha512-rRV5Xq4y521ozvSN0F5Ha5mlkV+87DFP9t663hqBU1KKG7x1PjaLwg20t0GGEAj353TsiMgOuMrAthzngAePlw==","mode":420,"size":2106},"package.json":{"checkedAt":1678883669893,"integrity":"sha512-aktPjn+52BdrHNyb/WkVTGcNBwQDrzMh8HkHYip/XYlbhPasH2VzgjjZMuzxcj6coxtsAV/98NHxxDyggOkqGA==","mode":420,"size":1788},"test/whitespace.js":{"checkedAt":1678883669893,"integrity":"sha512-FhyAkoYVmMKZw6xPXhT2BFJeh47FlapX1V0TGZbIE/bTbLBAGLvbL6U7qmNb2ExnAqv9FVgcdyuhN416JyLKow==","mode":420,"size":194},"README.md":{"checkedAt":1678883669894,"integrity":"sha512-iyG6SotCEm57vOelFosCuxqJA+gw+c1zk5owDxsA3ps9lcA6ucdf+OKhR9oMWcdtWxT9wfIPpsZAWWMexW6iSA==","mode":420,"size":3609},".github/FUNDING.yml":{"checkedAt":1678883669894,"integrity":"sha512-8YEGlEsHhp3lEW5zqMi6Mp7I60fLit+FKdXI9TK/VOTta526+yq3/OCw9nxFELtTWevH4WDYGF4Lbx51yfr5hw==","mode":420,"size":579},"CHANGELOG.md":{"checkedAt":1678883669894,"integrity":"sha512-EcgXocvC/q3G2GZtYuneJnD4PQ6RXy+ASn4wy/4Bvn0DKG+oD8dtsRk3Z2PVazftFqgPX0u3B5H3b5B2kH9Opg==","mode":420,"size":21542}}}
|
||||
@@ -0,0 +1,11 @@
|
||||
// parse out just the options we care about so we always get a consistent
|
||||
// obj with keys in a consistent order.
|
||||
const opts = ['includePrerelease', 'loose', 'rtl']
|
||||
const parseOptions = options =>
|
||||
!options ? {}
|
||||
: typeof options !== 'object' ? { loose: true }
|
||||
: opts.filter(k => options[k]).reduce((o, k) => {
|
||||
o[k] = true
|
||||
return o
|
||||
}, {})
|
||||
module.exports = parseOptions
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"2":"J D E F A B CC"},B:{"1":"P Q R S T U V W X Y Z a b c d e i j k l m n o p q r s t u f H","2":"C K L G M N O"},C:{"1":"0 1 2 3 4 5 6 7 8 9 g x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB h lB mB nB oB pB P Q R 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 N O EC FC","132":"w"},D:{"1":"EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB h lB mB nB oB pB P Q R S T U V W X Y Z a b c d e i j k l m n o p q r s t u f H xB yB GC","2":"0 1 2 3 4 5 6 7 8 9 I v J D E F A B C K L G M N O w g x y z AB BB CB DB"},E:{"1":"B C K L G 0B qB rB 1B MC NC 2B 3B 4B 5B sB 6B 7B 8B 9B OC","2":"I v J D E F A HC zB IC JC KC LC"},F:{"1":"1 2 3 4 5 6 7 8 9 AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB 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 F B C G M N O w g x y z PC QC RC SC qB AC TC rB"},G:{"1":"cC dC eC fC gC hC iC jC kC lC mC nC 2B 3B 4B 5B sB 6B 7B 8B 9B","2":"E zB UC BC VC WC XC YC ZC aC bC"},H:{"2":"oC"},I:{"1":"f","2":"tB I pC qC rC sC BC tC uC"},J:{"2":"D A"},K:{"1":"h","2":"A B C qB AC rB"},L:{"1":"H"},M:{"1":"H"},N:{"2":"A B"},O:{"1":"vC"},P:{"1":"I g wC xC yC zC 0C 0B 1C 2C 3C 4C 5C sB 6C 7C 8C"},Q:{"1":"1B"},R:{"1":"9C"},S:{"1":"AD BD"}},B:1,C:"TextEncoder & TextDecoder"};
|
||||
@@ -0,0 +1,44 @@
|
||||
import { Observable } from '../Observable';
|
||||
import { noop } from '../util/noop';
|
||||
|
||||
/**
|
||||
* An Observable that emits no items to the Observer and never completes.
|
||||
*
|
||||
* 
|
||||
*
|
||||
* A simple Observable that emits neither values nor errors nor the completion
|
||||
* notification. It can be used for testing purposes or for composing with other
|
||||
* Observables. Please note that by never emitting a complete notification, this
|
||||
* Observable keeps the subscription from being disposed automatically.
|
||||
* Subscriptions need to be manually disposed.
|
||||
*
|
||||
* ## Example
|
||||
*
|
||||
* Emit the number 7, then never emit anything else (not even complete)
|
||||
*
|
||||
* ```ts
|
||||
* import { NEVER, startWith } from 'rxjs';
|
||||
*
|
||||
* const info = () => console.log('Will not be called');
|
||||
*
|
||||
* const result = NEVER.pipe(startWith(7));
|
||||
* result.subscribe({
|
||||
* next: x => console.log(x),
|
||||
* error: info,
|
||||
* complete: info
|
||||
* });
|
||||
* ```
|
||||
*
|
||||
* @see {@link Observable}
|
||||
* @see {@link EMPTY}
|
||||
* @see {@link of}
|
||||
* @see {@link throwError}
|
||||
*/
|
||||
export const NEVER = new Observable<never>(noop);
|
||||
|
||||
/**
|
||||
* @deprecated Replaced with the {@link NEVER} constant. Will be removed in v8.
|
||||
*/
|
||||
export function never() {
|
||||
return NEVER;
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = require('./lib/sync');
|
||||
@@ -0,0 +1,35 @@
|
||||
import type {Except} from './except';
|
||||
import type {Simplify} from './simplify';
|
||||
|
||||
/**
|
||||
Create a type that makes the given keys optional. The remaining keys are kept as is. The sister of the `SetRequired` type.
|
||||
|
||||
Use-case: You want to define a single model where the only thing that changes is whether or not some of the keys are optional.
|
||||
|
||||
@example
|
||||
```
|
||||
import type {SetOptional} from 'type-fest';
|
||||
|
||||
type Foo = {
|
||||
a: number;
|
||||
b?: string;
|
||||
c: boolean;
|
||||
}
|
||||
|
||||
type SomeOptional = SetOptional<Foo, 'b' | 'c'>;
|
||||
// type SomeOptional = {
|
||||
// a: number;
|
||||
// b?: string; // Was already optional and still is.
|
||||
// c?: boolean; // Is now optional.
|
||||
// }
|
||||
```
|
||||
|
||||
@category Object
|
||||
*/
|
||||
export type SetOptional<BaseType, Keys extends keyof BaseType> =
|
||||
Simplify<
|
||||
// Pick just the keys that are readonly from the base type.
|
||||
Except<BaseType, Keys> &
|
||||
// Pick the keys that should be mutable from the base type and make them mutable.
|
||||
Partial<Pick<BaseType, Keys>>
|
||||
>;
|
||||
@@ -0,0 +1,92 @@
|
||||
{
|
||||
"name": "regexp.prototype.flags",
|
||||
"version": "1.4.3",
|
||||
"author": "Jordan Harband <ljharb@gmail.com>",
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
},
|
||||
"description": "ES6 spec-compliant RegExp.prototype.flags shim.",
|
||||
"license": "MIT",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"prepublish": "not-in-publish || npm run prepublishOnly",
|
||||
"prepublishOnly": "safe-publish-latest",
|
||||
"pretest": "npm run lint",
|
||||
"test": "npm run tests-only",
|
||||
"posttest": "aud --production",
|
||||
"tests-only": "nyc tape 'test/**/*.js'",
|
||||
"prelint": "eclint check $(git ls-files | xargs find 2> /dev/null | grep -vE 'node_modules|\\.git')",
|
||||
"lint": "eslint --ext=js,mjs .",
|
||||
"postlint": "es-shim-api --bound",
|
||||
"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)\")\""
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/es-shims/RegExp.prototype.flags.git"
|
||||
},
|
||||
"keywords": [
|
||||
"RegExp.prototype.flags",
|
||||
"regex",
|
||||
"regular expression",
|
||||
"ES6",
|
||||
"shim",
|
||||
"flag",
|
||||
"flags",
|
||||
"regexp",
|
||||
"RegExp#flags",
|
||||
"polyfill",
|
||||
"es-shim API"
|
||||
],
|
||||
"dependencies": {
|
||||
"call-bind": "^1.0.2",
|
||||
"define-properties": "^1.1.3",
|
||||
"functions-have-names": "^1.2.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@es-shims/api": "^2.2.3",
|
||||
"@ljharb/eslint-config": "^21.0.0",
|
||||
"aud": "^2.0.0",
|
||||
"auto-changelog": "^2.4.0",
|
||||
"available-regexp-flags": "^1.0.0",
|
||||
"covert": "^1.1.1",
|
||||
"eclint": "^2.8.1",
|
||||
"eslint": "=8.8.0",
|
||||
"foreach": "^2.0.5",
|
||||
"has": "^1.0.3",
|
||||
"has-strict-mode": "^1.0.1",
|
||||
"nyc": "^10.3.2",
|
||||
"object-inspect": "^1.12.0",
|
||||
"safe-publish-latest": "^2.0.0",
|
||||
"tape": "^5.5.3"
|
||||
},
|
||||
"testling": {
|
||||
"files": "test/index.js",
|
||||
"browsers": [
|
||||
"iexplore/9.0..latest",
|
||||
"firefox/4.0..6.0",
|
||||
"firefox/15.0..latest",
|
||||
"firefox/nightly",
|
||||
"chrome/4.0..10.0",
|
||||
"chrome/20.0..latest",
|
||||
"chrome/canary",
|
||||
"opera/11.6..latest",
|
||||
"opera/next",
|
||||
"safari/5.0..latest",
|
||||
"ipad/6.0..latest",
|
||||
"iphone/6.0..latest",
|
||||
"android-browser/4.2"
|
||||
]
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"auto-changelog": {
|
||||
"output": "CHANGELOG.md",
|
||||
"template": "keepachangelog",
|
||||
"unreleased": false,
|
||||
"commitLimit": false,
|
||||
"backfillLimit": false,
|
||||
"hideCredit": true
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,116 @@
|
||||
'use strict';
|
||||
|
||||
const codes = {};
|
||||
|
||||
function createErrorType(code, message, Base) {
|
||||
if (!Base) {
|
||||
Base = Error
|
||||
}
|
||||
|
||||
function getMessage (arg1, arg2, arg3) {
|
||||
if (typeof message === 'string') {
|
||||
return message
|
||||
} else {
|
||||
return message(arg1, arg2, arg3)
|
||||
}
|
||||
}
|
||||
|
||||
class NodeError extends Base {
|
||||
constructor (arg1, arg2, arg3) {
|
||||
super(getMessage(arg1, arg2, arg3));
|
||||
}
|
||||
}
|
||||
|
||||
NodeError.prototype.name = Base.name;
|
||||
NodeError.prototype.code = code;
|
||||
|
||||
codes[code] = NodeError;
|
||||
}
|
||||
|
||||
// https://github.com/nodejs/node/blob/v10.8.0/lib/internal/errors.js
|
||||
function oneOf(expected, thing) {
|
||||
if (Array.isArray(expected)) {
|
||||
const len = expected.length;
|
||||
expected = expected.map((i) => String(i));
|
||||
if (len > 2) {
|
||||
return `one of ${thing} ${expected.slice(0, len - 1).join(', ')}, or ` +
|
||||
expected[len - 1];
|
||||
} else if (len === 2) {
|
||||
return `one of ${thing} ${expected[0]} or ${expected[1]}`;
|
||||
} else {
|
||||
return `of ${thing} ${expected[0]}`;
|
||||
}
|
||||
} else {
|
||||
return `of ${thing} ${String(expected)}`;
|
||||
}
|
||||
}
|
||||
|
||||
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith
|
||||
function startsWith(str, search, pos) {
|
||||
return str.substr(!pos || pos < 0 ? 0 : +pos, search.length) === search;
|
||||
}
|
||||
|
||||
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith
|
||||
function endsWith(str, search, this_len) {
|
||||
if (this_len === undefined || this_len > str.length) {
|
||||
this_len = str.length;
|
||||
}
|
||||
return str.substring(this_len - search.length, this_len) === search;
|
||||
}
|
||||
|
||||
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes
|
||||
function includes(str, search, start) {
|
||||
if (typeof start !== 'number') {
|
||||
start = 0;
|
||||
}
|
||||
|
||||
if (start + search.length > str.length) {
|
||||
return false;
|
||||
} else {
|
||||
return str.indexOf(search, start) !== -1;
|
||||
}
|
||||
}
|
||||
|
||||
createErrorType('ERR_INVALID_OPT_VALUE', function (name, value) {
|
||||
return 'The value "' + value + '" is invalid for option "' + name + '"'
|
||||
}, TypeError);
|
||||
createErrorType('ERR_INVALID_ARG_TYPE', function (name, expected, actual) {
|
||||
// determiner: 'must be' or 'must not be'
|
||||
let determiner;
|
||||
if (typeof expected === 'string' && startsWith(expected, 'not ')) {
|
||||
determiner = 'must not be';
|
||||
expected = expected.replace(/^not /, '');
|
||||
} else {
|
||||
determiner = 'must be';
|
||||
}
|
||||
|
||||
let msg;
|
||||
if (endsWith(name, ' argument')) {
|
||||
// For cases like 'first argument'
|
||||
msg = `The ${name} ${determiner} ${oneOf(expected, 'type')}`;
|
||||
} else {
|
||||
const type = includes(name, '.') ? 'property' : 'argument';
|
||||
msg = `The "${name}" ${type} ${determiner} ${oneOf(expected, 'type')}`;
|
||||
}
|
||||
|
||||
msg += `. Received type ${typeof actual}`;
|
||||
return msg;
|
||||
}, TypeError);
|
||||
createErrorType('ERR_STREAM_PUSH_AFTER_EOF', 'stream.push() after EOF');
|
||||
createErrorType('ERR_METHOD_NOT_IMPLEMENTED', function (name) {
|
||||
return 'The ' + name + ' method is not implemented'
|
||||
});
|
||||
createErrorType('ERR_STREAM_PREMATURE_CLOSE', 'Premature close');
|
||||
createErrorType('ERR_STREAM_DESTROYED', function (name) {
|
||||
return 'Cannot call ' + name + ' after a stream was destroyed';
|
||||
});
|
||||
createErrorType('ERR_MULTIPLE_CALLBACK', 'Callback called multiple times');
|
||||
createErrorType('ERR_STREAM_CANNOT_PIPE', 'Cannot pipe, not readable');
|
||||
createErrorType('ERR_STREAM_WRITE_AFTER_END', 'write after end');
|
||||
createErrorType('ERR_STREAM_NULL_VALUES', 'May not write null values to stream', TypeError);
|
||||
createErrorType('ERR_UNKNOWN_ENCODING', function (arg) {
|
||||
return 'Unknown encoding: ' + arg
|
||||
}, TypeError);
|
||||
createErrorType('ERR_STREAM_UNSHIFT_AFTER_END_EVENT', 'stream.unshift() after end event');
|
||||
|
||||
module.exports.codes = codes;
|
||||
@@ -0,0 +1 @@
|
||||
{"name":"promise.allsettled","version":"1.0.6","files":{".nycrc":{"checkedAt":1678883669555,"integrity":"sha512-2vm1RFz8Ajl/OYrfoCWPJIm3Bpnf7Gyn5bha/lZx/cq+We3uMy9xj15XeP6x4wF3jf/pO7KMHAkU9mllm605xg==","mode":420,"size":139},".editorconfig":{"checkedAt":1678883671533,"integrity":"sha512-gD3iQtgC7ZgFS97pyZqR0FPjMNyRAfat8dipbSL28iiJ6B1MP5dDeDYeEnP5sYMTz8whQIk3E5vltk2kcyJJEQ==","mode":420,"size":286},"test/.eslintrc":{"checkedAt":1678883671533,"integrity":"sha512-v5IsH6uTCvDHvMlaTsL68IsJBv2+hd41EmLYYdk6KWvIe4ml+GNul/mrg7boKordrD7T+MTG6QV6r1iVMp2+gA==","mode":420,"size":244},"LICENSE":{"checkedAt":1678883671533,"integrity":"sha512-d2fjYr50p8QKjqC0qhH5nWv3sgAsKHHicw91kVzLPCZ54cpPIRw8zJk+nn45Y6q/yJ/T/xdxK77zBLuAvFgmVg==","mode":420,"size":1071},".eslintrc":{"checkedAt":1678883671533,"integrity":"sha512-mm2lz+wOLk50jlVDYbnn4QFd0AJ7071RxpPmcF4q/5hl2vMvUwx/AFtt+I0cuysu7MFcLBtlXi+tIQQPerX+uQ==","mode":420,"size":214},"test/builtin.js":{"checkedAt":1678883671533,"integrity":"sha512-ab4/36TW5vgL3Twbzih2esEbUHmwWg4VabHbFOCLFP+fvntt1z1CfS+TGfvnNpPnLh8X+xkZZzE99nRtuH/toA==","mode":420,"size":1270},"auto.js":{"checkedAt":1678883671533,"integrity":"sha512-8Q3Im5cACiIFrMmxvLnJnA8SXOjAd1kh/R0UIDVnErDD1WUlJIDrNfaOcIB6rtjAXNhq/OdL1374JM/QcAJ1VQ==","mode":420,"size":36},"test/implementation.js":{"checkedAt":1678883671533,"integrity":"sha512-TwWeRAtdEStCHmRZWqVg2SpdBUMDw2xkphUf72BJ384Bqf3kqXNYNuyyoJkmqviG8qAX162aTxsdGey48f5gGw==","mode":420,"size":847},"implementation.js":{"checkedAt":1678883671533,"integrity":"sha512-1A6XVdV1iBeNDJkQYHpFkXvVXnYhfNsLQatYse4FibZSfdj7q48LR1M+AvOYZKMalniASTYBshX1/2L67XDnLw==","mode":420,"size":1038},"index.js":{"checkedAt":1678883671533,"integrity":"sha512-OKQ6UzR8FPWo/idorF/GxVBCSPMImLj4msCJQeONr/853J1l/5MeK3b4ZWK7BAtcKl++YXxCuun+tZyl9YLNBg==","mode":420,"size":620},"test/index.js":{"checkedAt":1678883671533,"integrity":"sha512-REAk4l43zXteNHrtO69/2ENWRmNhCIR31ybr7JGFs9qey97uicDyyA3+wJ9IePa0y/tS2pNwTxuzSGVT7+e6/g==","mode":420,"size":670},"test/native.js":{"checkedAt":1678883671537,"integrity":"sha512-PLGiaAZJRNXWi8JsEue22RmEtzgFEs8xnzEwoV/xI5SI3e5NSd7NYMjLZHhPnv9qsuKNq5hpLqv02Rw/JedyNA==","mode":420,"size":142},"polyfill.js":{"checkedAt":1678883671537,"integrity":"sha512-kTStaYakBGmW5mxkFd4ukNM2Ly8JMDlOCxJrGFcLZZKk/ry1A71GmpXXB+NXHzwU1SZ27auJ/RNzTEYGepZjFg==","mode":420,"size":269},"requirePromise.js":{"checkedAt":1678883671537,"integrity":"sha512-/OIPha2SSazKBkd0/I63LVaw5234KzqB0Fvc69yRvfbUeT3q7C3/ci+BZZ6urmBTq90JVOWAI/T2xBlEMq2XNg==","mode":420,"size":193},"shim.js":{"checkedAt":1678883671537,"integrity":"sha512-qXsQg1NLmXa9DLeTJHCxWTJ1O5RJCgyU5ShEudmMkYvZFKSEU4sdAYYtzyYZ2u3a6CE2XiG31+GZzA402tXGjg==","mode":420,"size":407},"test/shimmed.js":{"checkedAt":1678883671537,"integrity":"sha512-r4AHJb2/f9ycFEWLqD6FqSTsJlzBKG78heZKeDyvowl5aPYIaWdt5vx7LZkCslfm2Lh0HhREe7DcHiCwm9kTLQ==","mode":420,"size":163},"test/tests.js":{"checkedAt":1678883671537,"integrity":"sha512-Z8BgH6r6i5fzT/34L+7q6Jcjr5FI5NaDpWMILmU3RGClaravikZAedYXeOoAh04hUqMAekHtLjjYoJuuCHvNBg==","mode":420,"size":3332},"package.json":{"checkedAt":1678883671537,"integrity":"sha512-65BqN8aZbO3grRhjOSPLFnPi59F5rAWuLg14by2+NMhatxE/cFbjmicGh5D2yTUyepGoaufh1MkdggtF/FIcWA==","mode":420,"size":2455},"test/promise-shimmed.js":{"checkedAt":1678883671537,"integrity":"sha512-wmAziouXOttH9Wl8xpxvJxygzuk6HdmARJDvr0TMYzZ+1oA8t6IGIQEzMD0IkVeaOdrbwx1lU7dzimYlhBJuEQ==","mode":420,"size":75},"CHANGELOG.md":{"checkedAt":1678883671540,"integrity":"sha512-J/WsD+25+sDHLMWzQlJbLoXMYGYg6p0cI6FP8nQiMOB+3CCKV9gttSe36AbaJYIHTKUXwYUoTExqADZtbm+KUw==","mode":420,"size":10146},"README.md":{"checkedAt":1678883671540,"integrity":"sha512-zxypnOVqbrOWQk67nHhOHChLT3AUGzUXLJp9wUuKAVC8YRixFg3kLup8sjtcrfSwd0P+4Qiuy6P/xr6ITHzjSA==","mode":420,"size":2836}}}
|
||||
@@ -0,0 +1,183 @@
|
||||
# globby
|
||||
|
||||
> User-friendly glob matching
|
||||
|
||||
Based on [`fast-glob`](https://github.com/mrmlnc/fast-glob) but adds a bunch of useful features.
|
||||
|
||||
## Features
|
||||
|
||||
- Promise API
|
||||
- Multiple patterns
|
||||
- Negated patterns: `['foo*', '!foobar']`
|
||||
- Expands directories: `foo` → `foo/**/*`
|
||||
- Supports `.gitignore` and similar ignore config files
|
||||
- Supports `URL` as `cwd`
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install globby
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```
|
||||
├── unicorn
|
||||
├── cake
|
||||
└── rainbow
|
||||
```
|
||||
|
||||
```js
|
||||
import {globby} from 'globby';
|
||||
|
||||
const paths = await globby(['*', '!cake']);
|
||||
|
||||
console.log(paths);
|
||||
//=> ['unicorn', 'rainbow']
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
Note that glob patterns can only contain forward-slashes, not backward-slashes, so if you want to construct a glob pattern from path components, you need to use `path.posix.join()` instead of `path.join()`.
|
||||
|
||||
### globby(patterns, options?)
|
||||
|
||||
Returns a `Promise<string[]>` of matching paths.
|
||||
|
||||
#### patterns
|
||||
|
||||
Type: `string | string[]`
|
||||
|
||||
See supported `minimatch` [patterns](https://github.com/isaacs/minimatch#usage).
|
||||
|
||||
#### options
|
||||
|
||||
Type: `object`
|
||||
|
||||
See the [`fast-glob` options](https://github.com/mrmlnc/fast-glob#options-3) in addition to the ones below.
|
||||
|
||||
##### expandDirectories
|
||||
|
||||
Type: `boolean | string[] | object`\
|
||||
Default: `true`
|
||||
|
||||
If set to `true`, `globby` will automatically glob directories for you. If you define an `Array` it will only glob files that matches the patterns inside the `Array`. You can also define an `object` with `files` and `extensions` like below:
|
||||
|
||||
```js
|
||||
import {globby} from 'globby';
|
||||
|
||||
(async () => {
|
||||
const paths = await globby('images', {
|
||||
expandDirectories: {
|
||||
files: ['cat', 'unicorn', '*.jpg'],
|
||||
extensions: ['png']
|
||||
}
|
||||
});
|
||||
|
||||
console.log(paths);
|
||||
//=> ['cat.png', 'unicorn.png', 'cow.jpg', 'rainbow.jpg']
|
||||
})();
|
||||
```
|
||||
|
||||
Note that if you set this option to `false`, you won't get back matched directories unless you set `onlyFiles: false`.
|
||||
|
||||
##### gitignore
|
||||
|
||||
Type: `boolean`\
|
||||
Default: `false`
|
||||
|
||||
Respect ignore patterns in `.gitignore` files that apply to the globbed files.
|
||||
|
||||
##### ignoreFiles
|
||||
|
||||
Type: `string | string[]`\
|
||||
Default: `undefined`
|
||||
|
||||
Glob patterns to look for ignore files, which are then used to ignore globbed files.
|
||||
|
||||
This is a more generic form of the `gitignore` option, allowing you to find ignore files with a [compatible syntax](http://git-scm.com/docs/gitignore). For instance, this works with Babel's `.babelignore`, Prettier's `.prettierignore`, or ESLint's `.eslintignore` files.
|
||||
|
||||
### globbySync(patterns, options?)
|
||||
|
||||
Returns `string[]` of matching paths.
|
||||
|
||||
### globbyStream(patterns, options?)
|
||||
|
||||
Returns a [`stream.Readable`](https://nodejs.org/api/stream.html#stream_readable_streams) of matching paths.
|
||||
|
||||
Since Node.js 10, [readable streams are iterable](https://nodejs.org/api/stream.html#stream_readable_symbol_asynciterator), so you can loop over glob matches in a [`for await...of` loop](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for-await...of) like this:
|
||||
|
||||
```js
|
||||
import {globbyStream} from 'globby';
|
||||
|
||||
(async () => {
|
||||
for await (const path of globbyStream('*.tmp')) {
|
||||
console.log(path);
|
||||
}
|
||||
})();
|
||||
```
|
||||
|
||||
### generateGlobTasks(patterns, options?)
|
||||
|
||||
Returns an `Promise<object[]>` in the format `{patterns: string[], options: Object}`, which can be passed as arguments to [`fast-glob`](https://github.com/mrmlnc/fast-glob). This is useful for other globbing-related packages.
|
||||
|
||||
Note that you should avoid running the same tasks multiple times as they contain a file system cache. Instead, run this method each time to ensure file system changes are taken into consideration.
|
||||
|
||||
### generateGlobTasksSync(patterns, options?)
|
||||
|
||||
Returns an `object[]` in the format `{patterns: string[], options: Object}`, which can be passed as arguments to [`fast-glob`](https://github.com/mrmlnc/fast-glob). This is useful for other globbing-related packages.
|
||||
|
||||
Takes the same arguments as `generateGlobTasks`.
|
||||
|
||||
### isDynamicPattern(patterns, options?)
|
||||
|
||||
Returns a `boolean` of whether there are any special glob characters in the `patterns`.
|
||||
|
||||
Note that the options affect the results.
|
||||
|
||||
This function is backed by [`fast-glob`](https://github.com/mrmlnc/fast-glob#isdynamicpatternpattern-options).
|
||||
|
||||
### isGitIgnored(options?)
|
||||
|
||||
Returns a `Promise<(path: URL | string) => boolean>` indicating whether a given path is ignored via a `.gitignore` file.
|
||||
|
||||
Takes `cwd?: URL | string` as options.
|
||||
|
||||
```js
|
||||
import {isGitIgnored} from 'globby';
|
||||
|
||||
const isIgnored = await isGitIgnored();
|
||||
|
||||
console.log(isIgnored('some/file'));
|
||||
```
|
||||
|
||||
### isGitIgnoredSync(options?)
|
||||
|
||||
Returns a `(path: URL | string) => boolean` indicating whether a given path is ignored via a `.gitignore` file.
|
||||
|
||||
Takes `cwd?: URL | string` as options.
|
||||
|
||||
## Globbing patterns
|
||||
|
||||
Just a quick overview.
|
||||
|
||||
- `*` matches any number of characters, but not `/`
|
||||
- `?` matches a single character, but not `/`
|
||||
- `**` matches any number of characters, including `/`, as long as it's the only thing in a path part
|
||||
- `{}` allows for a comma-separated list of "or" expressions
|
||||
- `!` at the beginning of a pattern will negate the match
|
||||
|
||||
[Various patterns and expected matches.](https://github.com/sindresorhus/multimatch/blob/main/test/test.js)
|
||||
|
||||
## globby for enterprise
|
||||
|
||||
Available as part of the Tidelift Subscription.
|
||||
|
||||
The maintainers of globby and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-globby?utm_source=npm-globby&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)
|
||||
|
||||
## Related
|
||||
|
||||
- [multimatch](https://github.com/sindresorhus/multimatch) - Match against a list instead of the filesystem
|
||||
- [matcher](https://github.com/sindresorhus/matcher) - Simple wildcard matching
|
||||
- [del](https://github.com/sindresorhus/del) - Delete files and directories
|
||||
- [make-dir](https://github.com/sindresorhus/make-dir) - Make a directory and its parents if needed
|
||||
@@ -0,0 +1,60 @@
|
||||
# Changelog
|
||||
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [v1.0.2](https://github.com/inspect-js/has-bigints/compare/v1.0.1...v1.0.2) - 2022-04-19
|
||||
|
||||
### Commits
|
||||
|
||||
- [actions] reuse common workflows [`a655b7f`](https://github.com/inspect-js/has-bigints/commit/a655b7f7733ba2de078b3a59a704c2795440d08c)
|
||||
- [actions] use `node/install` instead of `node/run`; use `codecov` action [`730a2e5`](https://github.com/inspect-js/has-bigints/commit/730a2e53d3f5f82ac43a11cb9753b11445d06d58)
|
||||
- [readme] add github actions/codecov badges; update URLs [`9a83788`](https://github.com/inspect-js/has-bigints/commit/9a8378861917b41ebb360a9d8ab3d39aa33acf7b)
|
||||
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `safe-publish-latest`, `tape` [`b1edc52`](https://github.com/inspect-js/has-bigints/commit/b1edc522ef6c23556e55b9c81b65fe884d1e2cc4)
|
||||
- [actions] update codecov uploader [`cbb1bd0`](https://github.com/inspect-js/has-bigints/commit/cbb1bd0eff486070a19283238da6afd33ca73b4b)
|
||||
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `auto-changelog`, `tape` [`8717e6d`](https://github.com/inspect-js/has-bigints/commit/8717e6d6ae6b5010aea1fac5e48dfdfaf35d8c72)
|
||||
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `auto-changelog`, `safe-publish-latest`, `tape` [`5f70eab`](https://github.com/inspect-js/has-bigints/commit/5f70eab763118d40415f13e47446ea5c011fbe18)
|
||||
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `tape` [`a1446bc`](https://github.com/inspect-js/has-bigints/commit/a1446bc3e806ce3911c73d6fbdd981f461c41019)
|
||||
- [meta] use `prepublishOnly` script for npm 7+ [`f2dd197`](https://github.com/inspect-js/has-bigints/commit/f2dd19716a06ca7a971644761e864f0435db278e)
|
||||
- [actions] use checkout v3 [`1ba72f1`](https://github.com/inspect-js/has-bigints/commit/1ba72f19ada076791ff193aca9d8537388d67ddb)
|
||||
- [Refactor] use a global variable to get the original BigInt instead of a global property [`a7ccfac`](https://github.com/inspect-js/has-bigints/commit/a7ccfac0414e56dadd263fd07c0b5141388df502)
|
||||
- [actions] skip `npm ls` on older nodes [`62d31e7`](https://github.com/inspect-js/has-bigints/commit/62d31e79658b16391458d0728e0dacbee8694ebb)
|
||||
|
||||
## [v1.0.1](https://github.com/inspect-js/has-bigints/compare/v1.0.0...v1.0.1) - 2020-12-13
|
||||
|
||||
### Commits
|
||||
|
||||
- [Tests] use shared travis-ci configs [`46a0d6b`](https://github.com/inspect-js/has-bigints/commit/46a0d6be7ed83bd7f5ead11e4eab7fc91570a448)
|
||||
- [Tests] migrate tests to Github Actions [`91a38fa`](https://github.com/inspect-js/has-bigints/commit/91a38fa4b85a420b8cf4926b3799e6ceb60d8690)
|
||||
- [meta] do not publish github action workflow files [`69aacba`](https://github.com/inspect-js/has-bigints/commit/69aacba320c1221e7fee1c71bde600bce063f24b)
|
||||
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `auto-changelog`, `tape` [`64e2c08`](https://github.com/inspect-js/has-bigints/commit/64e2c0895b21ac91a137452fd2455932f62a2fc1)
|
||||
- [Tests] run `nyc` on all tests; use `tape` runner [`8009375`](https://github.com/inspect-js/has-bigints/commit/8009375e5ec9faca6bbc09441002af5c5e59ff20)
|
||||
- [actions] add automatic rebasing / merge commit blocking [`e599917`](https://github.com/inspect-js/has-bigints/commit/e599917fd1f751c9a6c0daac70acb243f8c3a01d)
|
||||
- [actions] add "Allow Edits" workflow [`bd0126e`](https://github.com/inspect-js/has-bigints/commit/bd0126eba2d67e9b9d588bced34413f507698154)
|
||||
- [readme] remove travis badge [`8e02a73`](https://github.com/inspect-js/has-bigints/commit/8e02a73db34827d24d2945f2db822973a0b49925)
|
||||
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `auto-changelog`, `safe-publish-latest` [`95859f2`](https://github.com/inspect-js/has-bigints/commit/95859f28f23f5733481c52a501063802cf64f75b)
|
||||
- [Dev Deps] update `auto-changelog`, `in-publish`, `tape` [`0588f41`](https://github.com/inspect-js/has-bigints/commit/0588f415c6cc01d6b34668680044e03b2998e03f)
|
||||
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `tape` [`5b024a6`](https://github.com/inspect-js/has-bigints/commit/5b024a664a8b7d2d2f750a4c11ce20c395b6f12a)
|
||||
- [meta] add `version` scripts [`4788d61`](https://github.com/inspect-js/has-bigints/commit/4788d61101c009e4e2c1b4d944c263de06192c6a)
|
||||
- [actions] switch Automatic Rebase workflow to `pull_request_target` event [`be0e0de`](https://github.com/inspect-js/has-bigints/commit/be0e0de08298dfe483c5d7a2675e5133abeabc53)
|
||||
- [Dev Deps] update `auto-changelog`; add `aud` [`13a8d1b`](https://github.com/inspect-js/has-bigints/commit/13a8d1bf1f661871d890bfa174de9514f016cdd9)
|
||||
- [actions] fix action name [`f873d9a`](https://github.com/inspect-js/has-bigints/commit/f873d9a2f10718662528a755b12c61202f4e4afa)
|
||||
- [meta] add `funding` field [`1b51f49`](https://github.com/inspect-js/has-bigints/commit/1b51f4921df1faf85d2679a0e4ba97ef015a73b7)
|
||||
- [Dev Deps] update `auto-changelog` [`2322461`](https://github.com/inspect-js/has-bigints/commit/2322461789810434c447439f155eb3ca23eb29fb)
|
||||
- [Tests] only audit prod deps [`aabdade`](https://github.com/inspect-js/has-bigints/commit/aabdadeaa1e126b91a2fbd82263cc49651ff5e7b)
|
||||
|
||||
## v1.0.0 - 2019-08-10
|
||||
|
||||
### Commits
|
||||
|
||||
- [Tests] add `.travis.yml` [`9730412`](https://github.com/inspect-js/has-bigints/commit/973041241dc172474bb9457aad41790fe54fec88)
|
||||
- Initial commit [`65f7c38`](https://github.com/inspect-js/has-bigints/commit/65f7c3889d9a98e214e26d650723cbfc49338463)
|
||||
- [Tests] add tests [`e374a78`](https://github.com/inspect-js/has-bigints/commit/e374a78033d457badcd47e06752fdec7f62e6c39)
|
||||
- readme [`5d39092`](https://github.com/inspect-js/has-bigints/commit/5d3909249da442867180fb747eef27543627d250)
|
||||
- npm init [`1be2e3d`](https://github.com/inspect-js/has-bigints/commit/1be2e3d69db6718901e6845cfc38a07cc46dfd96)
|
||||
- implementation [`b7bc812`](https://github.com/inspect-js/has-bigints/commit/b7bc8121db1fb1a827625c4cb0608935e3dcbe31)
|
||||
- [Tests] add linting [`04533be`](https://github.com/inspect-js/has-bigints/commit/04533bef57f60e322238f71f32ee3ae0c988bac4)
|
||||
- [meta] create FUNDING.yml [`cf824a7`](https://github.com/inspect-js/has-bigints/commit/cf824a7d02e867957d8db17ee0a4c70c8ee5ff23)
|
||||
- Only apps should have lockfiles [`64e8242`](https://github.com/inspect-js/has-bigints/commit/64e82429f1dca99f624dc971ff13516dee28d353)
|
||||
@@ -0,0 +1,14 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const sync_1 = require("../readers/sync");
|
||||
class SyncProvider {
|
||||
constructor(_root, _settings) {
|
||||
this._root = _root;
|
||||
this._settings = _settings;
|
||||
this._reader = new sync_1.default(this._root, this._settings);
|
||||
}
|
||||
read() {
|
||||
return this._reader.read();
|
||||
}
|
||||
}
|
||||
exports.default = SyncProvider;
|
||||
@@ -0,0 +1,5 @@
|
||||
import { OneDArray, TwoDArray } from '../types';
|
||||
export declare function oneDtoTwoD<T>(
|
||||
data: OneDArray<T> | TwoDArray<T>,
|
||||
): TwoDArray<T>;
|
||||
export declare function flatten<T>(arrays: TwoDArray<T>): OneDArray<T>;
|
||||
@@ -0,0 +1,9 @@
|
||||
import { Observable } from '../Observable';
|
||||
import { ObservableInputTuple, SchedulerLike } from '../types';
|
||||
export declare function merge<A extends readonly unknown[]>(...sources: [...ObservableInputTuple<A>]): Observable<A[number]>;
|
||||
export declare function merge<A extends readonly unknown[]>(...sourcesAndConcurrency: [...ObservableInputTuple<A>, number?]): Observable<A[number]>;
|
||||
/** @deprecated The `scheduler` parameter will be removed in v8. Use `scheduled` and `mergeAll`. Details: https://rxjs.dev/deprecations/scheduler-argument */
|
||||
export declare function merge<A extends readonly unknown[]>(...sourcesAndScheduler: [...ObservableInputTuple<A>, SchedulerLike?]): Observable<A[number]>;
|
||||
/** @deprecated The `scheduler` parameter will be removed in v8. Use `scheduled` and `mergeAll`. Details: https://rxjs.dev/deprecations/scheduler-argument */
|
||||
export declare function merge<A extends readonly unknown[]>(...sourcesAndConcurrencyAndScheduler: [...ObservableInputTuple<A>, number?, SchedulerLike?]): Observable<A[number]>;
|
||||
//# sourceMappingURL=merge.d.ts.map
|
||||
@@ -0,0 +1,36 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.scheduleIterable = void 0;
|
||||
var Observable_1 = require("../Observable");
|
||||
var iterator_1 = require("../symbol/iterator");
|
||||
var isFunction_1 = require("../util/isFunction");
|
||||
var executeSchedule_1 = require("../util/executeSchedule");
|
||||
function scheduleIterable(input, scheduler) {
|
||||
return new Observable_1.Observable(function (subscriber) {
|
||||
var iterator;
|
||||
executeSchedule_1.executeSchedule(subscriber, scheduler, function () {
|
||||
iterator = input[iterator_1.iterator]();
|
||||
executeSchedule_1.executeSchedule(subscriber, scheduler, function () {
|
||||
var _a;
|
||||
var value;
|
||||
var done;
|
||||
try {
|
||||
(_a = iterator.next(), value = _a.value, done = _a.done);
|
||||
}
|
||||
catch (err) {
|
||||
subscriber.error(err);
|
||||
return;
|
||||
}
|
||||
if (done) {
|
||||
subscriber.complete();
|
||||
}
|
||||
else {
|
||||
subscriber.next(value);
|
||||
}
|
||||
}, 0, true);
|
||||
});
|
||||
return function () { return isFunction_1.isFunction(iterator === null || iterator === void 0 ? void 0 : iterator.return) && iterator.return(); };
|
||||
});
|
||||
}
|
||||
exports.scheduleIterable = scheduleIterable;
|
||||
//# sourceMappingURL=scheduleIterable.js.map
|
||||
@@ -0,0 +1,82 @@
|
||||
{
|
||||
"name": "is-number",
|
||||
"description": "Returns true if a number or string value is a finite number. Useful for regex matches, parsing, user input, etc.",
|
||||
"version": "7.0.0",
|
||||
"homepage": "https://github.com/jonschlinkert/is-number",
|
||||
"author": "Jon Schlinkert (https://github.com/jonschlinkert)",
|
||||
"contributors": [
|
||||
"Jon Schlinkert (http://twitter.com/jonschlinkert)",
|
||||
"Olsten Larck (https://i.am.charlike.online)",
|
||||
"Rouven Weßling (www.rouvenwessling.de)"
|
||||
],
|
||||
"repository": "jonschlinkert/is-number",
|
||||
"bugs": {
|
||||
"url": "https://github.com/jonschlinkert/is-number/issues"
|
||||
},
|
||||
"license": "MIT",
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"main": "index.js",
|
||||
"engines": {
|
||||
"node": ">=0.12.0"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "mocha"
|
||||
},
|
||||
"devDependencies": {
|
||||
"ansi": "^0.3.1",
|
||||
"benchmark": "^2.1.4",
|
||||
"gulp-format-md": "^1.0.0",
|
||||
"mocha": "^3.5.3"
|
||||
},
|
||||
"keywords": [
|
||||
"cast",
|
||||
"check",
|
||||
"coerce",
|
||||
"coercion",
|
||||
"finite",
|
||||
"integer",
|
||||
"is",
|
||||
"isnan",
|
||||
"is-nan",
|
||||
"is-num",
|
||||
"is-number",
|
||||
"isnumber",
|
||||
"isfinite",
|
||||
"istype",
|
||||
"kind",
|
||||
"math",
|
||||
"nan",
|
||||
"num",
|
||||
"number",
|
||||
"numeric",
|
||||
"parseFloat",
|
||||
"parseInt",
|
||||
"test",
|
||||
"type",
|
||||
"typeof",
|
||||
"value"
|
||||
],
|
||||
"verb": {
|
||||
"toc": false,
|
||||
"layout": "default",
|
||||
"tasks": [
|
||||
"readme"
|
||||
],
|
||||
"related": {
|
||||
"list": [
|
||||
"is-plain-object",
|
||||
"is-primitive",
|
||||
"isobject",
|
||||
"kind-of"
|
||||
]
|
||||
},
|
||||
"plugins": [
|
||||
"gulp-format-md"
|
||||
],
|
||||
"lint": {
|
||||
"reflinks": true
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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,"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,"59":0,"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,"79":0,"80":0,"81":0,"82":0,"83":0,"84":0,"85":0,"86":0,"87":0.13239,"88":0.00457,"89":0,"90":0,"91":0.00457,"92":0,"93":0,"94":0,"95":0,"96":0,"97":0,"98":0,"99":0,"100":0,"101":0,"102":0.00457,"103":0,"104":0.00457,"105":0,"106":0.00457,"107":0.00457,"108":0.00913,"109":0.33325,"110":0.29216,"111":0,"112":0,"3.5":0,"3.6":0},D:{"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"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,"47":0,"48":0,"49":0.00457,"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.00457,"64":0,"65":0,"66":0,"67":0,"68":0,"69":0.00457,"70":0,"71":0,"72":0,"73":0.00457,"74":0,"75":0,"76":0.02739,"77":0.00457,"78":0.02739,"79":0.02283,"80":0,"81":0.02283,"83":0.02283,"84":0.00457,"85":0,"86":0.00457,"87":0.00457,"88":0.00913,"89":0,"90":0.00457,"91":0.00457,"92":0,"93":0.02283,"94":0,"95":0.00457,"96":0.02283,"97":0.03196,"98":0.00457,"99":0,"100":0.00913,"101":0.00457,"102":0.02283,"103":0.24651,"104":0.00913,"105":0.01826,"106":0.05478,"107":0.04109,"108":0.77149,"109":7.56877,"110":4.04459,"111":0.05935,"112":0.0137,"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.00913,"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,"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.00913,"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,"86":0,"87":0,"88":0,"89":0,"90":0,"91":0,"92":0,"93":0.01826,"94":0.23282,"95":0.29216,"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,"18":0.00913,"79":0,"80":0,"81":0,"83":0,"84":0,"85":0.00913,"86":0,"87":0,"88":0,"89":0,"90":0,"91":0,"92":0.00913,"93":0,"94":0,"95":0,"96":0,"97":0,"98":0,"99":0,"100":0,"101":0,"102":0,"103":0,"104":0,"105":0.00457,"106":0.00457,"107":0.02283,"108":0.05935,"109":1.12756,"110":1.26451},E:{"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0.05935,"14":0.02739,"15":0.00457,_:"0","3.1":0,"3.2":0,"5.1":0.00457,"6.1":0,"7.1":0,"9.1":0,"10.1":0,"11.1":0.00457,"12.1":0.00457,"13.1":0.06391,"14.1":0.05022,"15.1":0.00457,"15.2-15.3":0.00457,"15.4":0.05022,"15.5":0.04109,"15.6":0.27847,"16.0":0.00457,"16.1":0.05022,"16.2":0.24195,"16.3":0.17347,"16.4":0},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0,"5.0-5.1":0.00204,"6.0-6.1":0,"7.0-7.1":0.00611,"8.1-8.4":0,"9.0-9.2":0.20161,"9.3":0.12829,"10.0-10.2":0,"10.3":0.0448,"11.0-11.2":0.00611,"11.3-11.4":0.01833,"12.0-12.1":0,"12.2-12.5":0.26066,"13.0-13.1":0,"13.2":0,"13.3":0.01222,"13.4-13.7":0.02851,"14.0-14.4":0.77588,"14.5-14.8":0.36452,"15.0-15.1":0.10997,"15.2-15.3":0.11404,"15.4":0.13033,"15.5":0.28306,"15.6":1.74725,"16.0":2.19119,"16.1":4.48216,"16.2":5.26007,"16.3":2.67178,"16.4":0.01018},P:{"4":0.18843,"20":1.60163,"5.0-5.4":0,"6.2-6.4":0,"7.2-7.4":0.36639,"8.2":0,"9.2":0,"10.1":0,"11.1-11.2":0.06281,"12.0":0.01047,"13.0":0.04187,"14.0":0.02094,"15.0":0.12562,"16.0":0.04187,"17.0":0.07328,"18.0":0.10468,"19.0":2.74267},I:{"0":0,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0.14286,"4.4":0,"4.4.3-4.4.4":0.51429},K:{_:"0 10 11 12 11.1 11.5 12.1"},A:{"6":0,"7":0,"8":0,"9":0,"10":0.00913,"11":0.00457,"5.5":0},N:{"10":0,"11":0},S:{"2.5":0,_:"3.0-3.1"},J:{"7":0,"10":0},O:{"0":0.26088},H:{"0":0.24698},L:{"0":53.51952},R:{_:"0"},M:{"0":0.15762},Q:{"13.1":0}};
|
||||
@@ -0,0 +1,47 @@
|
||||
# windows-release
|
||||
|
||||
> Get the name of a Windows version from the release number: `5.1.2600` → `XP`
|
||||
|
||||
## Install
|
||||
|
||||
```sh
|
||||
npm install windows-release
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
import os from 'node:os';
|
||||
import windowsRelease from 'windows-release';
|
||||
|
||||
// On a Windows XP system
|
||||
|
||||
windowsRelease();
|
||||
//=> 'XP'
|
||||
|
||||
os.release();
|
||||
//=> '5.1.2600'
|
||||
|
||||
windowsRelease(os.release());
|
||||
//=> 'XP'
|
||||
|
||||
windowsRelease('4.9.3000');
|
||||
//=> 'ME'
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
### windowsRelease(release?)
|
||||
|
||||
#### release
|
||||
|
||||
Type: `string`
|
||||
|
||||
By default, the current OS is used, but you can supply a custom release number, which is the output of [`os.release()`](https://nodejs.org/api/os.html#os_os_release).
|
||||
|
||||
Note: Most Windows Server versions cannot be detected based on the release number alone. There is runtime detection in place to work around this, but it will only be used if no argument is supplied, or the supplied argument matches `os.release()`.
|
||||
|
||||
## Related
|
||||
|
||||
- [os-name](https://github.com/sindresorhus/os-name) - Get the name of the current operating system
|
||||
- [macos-release](https://github.com/sindresorhus/macos-release) - Get the name and version of a macOS release from the Darwin version
|
||||
@@ -0,0 +1,7 @@
|
||||
/**
|
||||
* https://tc39.es/ecma402/#sec-lookupsupportedlocales
|
||||
* @param availableLocales
|
||||
* @param requestedLocales
|
||||
*/
|
||||
export declare function LookupSupportedLocales(availableLocales: Set<string>, requestedLocales: string[]): string[];
|
||||
//# sourceMappingURL=LookupSupportedLocales.d.ts.map
|
||||
@@ -0,0 +1,51 @@
|
||||
import { OperatorFunction, ObservableInput, ObservedValueOf } from '../types';
|
||||
import { exhaustMap } from './exhaustMap';
|
||||
import { identity } from '../util/identity';
|
||||
|
||||
/**
|
||||
* Converts a higher-order Observable into a first-order Observable by dropping
|
||||
* inner Observables while the previous inner Observable has not yet completed.
|
||||
*
|
||||
* <span class="informal">Flattens an Observable-of-Observables by dropping the
|
||||
* next inner Observables while the current inner is still executing.</span>
|
||||
*
|
||||
* 
|
||||
*
|
||||
* `exhaustAll` subscribes to an Observable that emits Observables, also known as a
|
||||
* higher-order Observable. Each time it observes one of these emitted inner
|
||||
* Observables, the output Observable begins emitting the items emitted by that
|
||||
* inner Observable. So far, it behaves like {@link mergeAll}. However,
|
||||
* `exhaustAll` ignores every new inner Observable if the previous Observable has
|
||||
* not yet completed. Once that one completes, it will accept and flatten the
|
||||
* next inner Observable and repeat this process.
|
||||
*
|
||||
* ## Example
|
||||
*
|
||||
* Run a finite timer for each click, only if there is no currently active timer
|
||||
*
|
||||
* ```ts
|
||||
* import { fromEvent, map, interval, take, exhaustAll } from 'rxjs';
|
||||
*
|
||||
* const clicks = fromEvent(document, 'click');
|
||||
* const higherOrder = clicks.pipe(
|
||||
* map(() => interval(1000).pipe(take(5)))
|
||||
* );
|
||||
* const result = higherOrder.pipe(exhaustAll());
|
||||
* result.subscribe(x => console.log(x));
|
||||
* ```
|
||||
*
|
||||
* @see {@link combineLatestAll}
|
||||
* @see {@link concatAll}
|
||||
* @see {@link switchAll}
|
||||
* @see {@link switchMap}
|
||||
* @see {@link mergeAll}
|
||||
* @see {@link exhaustMap}
|
||||
* @see {@link zipAll}
|
||||
*
|
||||
* @return A function that returns an Observable that takes a source of
|
||||
* Observables and propagates the first Observable exclusively until it
|
||||
* completes before subscribing to the next.
|
||||
*/
|
||||
export function exhaustAll<O extends ObservableInput<any>>(): OperatorFunction<O, ObservedValueOf<O>> {
|
||||
return exhaustMap(identity);
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.captureError = exports.errorContext = void 0;
|
||||
var config_1 = require("../config");
|
||||
var context = null;
|
||||
function errorContext(cb) {
|
||||
if (config_1.config.useDeprecatedSynchronousErrorHandling) {
|
||||
var isRoot = !context;
|
||||
if (isRoot) {
|
||||
context = { errorThrown: false, error: null };
|
||||
}
|
||||
cb();
|
||||
if (isRoot) {
|
||||
var _a = context, errorThrown = _a.errorThrown, error = _a.error;
|
||||
context = null;
|
||||
if (errorThrown) {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
cb();
|
||||
}
|
||||
}
|
||||
exports.errorContext = errorContext;
|
||||
function captureError(err) {
|
||||
if (config_1.config.useDeprecatedSynchronousErrorHandling && context) {
|
||||
context.errorThrown = true;
|
||||
context.error = err;
|
||||
}
|
||||
}
|
||||
exports.captureError = captureError;
|
||||
//# sourceMappingURL=errorContext.js.map
|
||||
@@ -0,0 +1 @@
|
||||
module.exports = require('./flowRight');
|
||||
@@ -0,0 +1,23 @@
|
||||
var upperCase = require('upper-case')
|
||||
var noCase = require('no-case')
|
||||
|
||||
/**
|
||||
* Camel case a string.
|
||||
*
|
||||
* @param {string} value
|
||||
* @param {string} [locale]
|
||||
* @return {string}
|
||||
*/
|
||||
module.exports = function (value, locale, mergeNumbers) {
|
||||
var result = noCase(value, locale)
|
||||
|
||||
// Replace periods between numeric entities with an underscore.
|
||||
if (!mergeNumbers) {
|
||||
result = result.replace(/ (?=\d)/g, '_')
|
||||
}
|
||||
|
||||
// Replace spaces between words with an upper cased character.
|
||||
return result.replace(/ (.)/g, function (m, $1) {
|
||||
return upperCase($1, locale)
|
||||
})
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
'use strict';
|
||||
|
||||
var GetIntrinsic = require('get-intrinsic');
|
||||
|
||||
var $BigInt = GetIntrinsic('%BigInt%', true);
|
||||
var $pow = GetIntrinsic('%Math.pow%');
|
||||
|
||||
var ToBigInt = require('./ToBigInt');
|
||||
var BigIntRemainder = require('./BigInt/remainder');
|
||||
|
||||
var modBigInt = require('../helpers/modBigInt');
|
||||
|
||||
// BigInt(2**63), but node v10.4-v10.8 have a bug where you can't `BigInt(x)` anything larger than MAX_SAFE_INTEGER
|
||||
var twoSixtyThree = $BigInt && (BigInt($pow(2, 32)) * BigInt($pow(2, 31)));
|
||||
|
||||
// BigInt(2**64), but node v10.4-v10.8 have a bug where you can't `BigInt(x)` anything larger than MAX_SAFE_INTEGER
|
||||
var twoSixtyFour = $BigInt && (BigInt($pow(2, 32)) * BigInt($pow(2, 32)));
|
||||
|
||||
// https://262.ecma-international.org/11.0/#sec-tobigint64
|
||||
|
||||
module.exports = function ToBigInt64(argument) {
|
||||
var n = ToBigInt(argument);
|
||||
var int64bit = modBigInt(BigIntRemainder, n, twoSixtyFour);
|
||||
return int64bit >= twoSixtyThree ? int64bit - twoSixtyFour : int64bit;
|
||||
};
|
||||
@@ -0,0 +1,17 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.string = exports.stream = exports.pattern = exports.path = exports.fs = exports.errno = exports.array = void 0;
|
||||
const array = require("./array");
|
||||
exports.array = array;
|
||||
const errno = require("./errno");
|
||||
exports.errno = errno;
|
||||
const fs = require("./fs");
|
||||
exports.fs = fs;
|
||||
const path = require("./path");
|
||||
exports.path = path;
|
||||
const pattern = require("./pattern");
|
||||
exports.pattern = pattern;
|
||||
const stream = require("./stream");
|
||||
exports.stream = stream;
|
||||
const string = require("./string");
|
||||
exports.string = string;
|
||||
@@ -0,0 +1,8 @@
|
||||
"use strict";
|
||||
|
||||
var isObject = require("./is-object");
|
||||
|
||||
module.exports = function (value) {
|
||||
if (!isObject(value)) throw new TypeError(value + " is not an Object");
|
||||
return value;
|
||||
};
|
||||
@@ -0,0 +1,450 @@
|
||||
import * as Utils from './utils';
|
||||
import Exception from './exception';
|
||||
import {
|
||||
COMPILER_REVISION,
|
||||
createFrame,
|
||||
LAST_COMPATIBLE_COMPILER_REVISION,
|
||||
REVISION_CHANGES
|
||||
} from './base';
|
||||
import { moveHelperToHooks } from './helpers';
|
||||
import { wrapHelper } from './internal/wrapHelper';
|
||||
import {
|
||||
createProtoAccessControl,
|
||||
resultIsAllowed
|
||||
} from './internal/proto-access';
|
||||
|
||||
export function checkRevision(compilerInfo) {
|
||||
const compilerRevision = (compilerInfo && compilerInfo[0]) || 1,
|
||||
currentRevision = COMPILER_REVISION;
|
||||
|
||||
if (
|
||||
compilerRevision >= LAST_COMPATIBLE_COMPILER_REVISION &&
|
||||
compilerRevision <= COMPILER_REVISION
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (compilerRevision < LAST_COMPATIBLE_COMPILER_REVISION) {
|
||||
const runtimeVersions = REVISION_CHANGES[currentRevision],
|
||||
compilerVersions = REVISION_CHANGES[compilerRevision];
|
||||
throw new Exception(
|
||||
'Template was precompiled with an older version of Handlebars than the current runtime. ' +
|
||||
'Please update your precompiler to a newer version (' +
|
||||
runtimeVersions +
|
||||
') or downgrade your runtime to an older version (' +
|
||||
compilerVersions +
|
||||
').'
|
||||
);
|
||||
} else {
|
||||
// Use the embedded version info since the runtime doesn't know about this revision yet
|
||||
throw new Exception(
|
||||
'Template was precompiled with a newer version of Handlebars than the current runtime. ' +
|
||||
'Please update your runtime to a newer version (' +
|
||||
compilerInfo[1] +
|
||||
').'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export function template(templateSpec, env) {
|
||||
/* istanbul ignore next */
|
||||
if (!env) {
|
||||
throw new Exception('No environment passed to template');
|
||||
}
|
||||
if (!templateSpec || !templateSpec.main) {
|
||||
throw new Exception('Unknown template object: ' + typeof templateSpec);
|
||||
}
|
||||
|
||||
templateSpec.main.decorator = templateSpec.main_d;
|
||||
|
||||
// Note: Using env.VM references rather than local var references throughout this section to allow
|
||||
// for external users to override these as pseudo-supported APIs.
|
||||
env.VM.checkRevision(templateSpec.compiler);
|
||||
|
||||
// backwards compatibility for precompiled templates with compiler-version 7 (<4.3.0)
|
||||
const templateWasPrecompiledWithCompilerV7 =
|
||||
templateSpec.compiler && templateSpec.compiler[0] === 7;
|
||||
|
||||
function invokePartialWrapper(partial, context, options) {
|
||||
if (options.hash) {
|
||||
context = Utils.extend({}, context, options.hash);
|
||||
if (options.ids) {
|
||||
options.ids[0] = true;
|
||||
}
|
||||
}
|
||||
partial = env.VM.resolvePartial.call(this, partial, context, options);
|
||||
|
||||
let extendedOptions = Utils.extend({}, options, {
|
||||
hooks: this.hooks,
|
||||
protoAccessControl: this.protoAccessControl
|
||||
});
|
||||
|
||||
let result = env.VM.invokePartial.call(
|
||||
this,
|
||||
partial,
|
||||
context,
|
||||
extendedOptions
|
||||
);
|
||||
|
||||
if (result == null && env.compile) {
|
||||
options.partials[options.name] = env.compile(
|
||||
partial,
|
||||
templateSpec.compilerOptions,
|
||||
env
|
||||
);
|
||||
result = options.partials[options.name](context, extendedOptions);
|
||||
}
|
||||
if (result != null) {
|
||||
if (options.indent) {
|
||||
let lines = result.split('\n');
|
||||
for (let i = 0, l = lines.length; i < l; i++) {
|
||||
if (!lines[i] && i + 1 === l) {
|
||||
break;
|
||||
}
|
||||
|
||||
lines[i] = options.indent + lines[i];
|
||||
}
|
||||
result = lines.join('\n');
|
||||
}
|
||||
return result;
|
||||
} else {
|
||||
throw new Exception(
|
||||
'The partial ' +
|
||||
options.name +
|
||||
' could not be compiled when running in runtime-only mode'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// Just add water
|
||||
let container = {
|
||||
strict: function(obj, name, loc) {
|
||||
if (!obj || !(name in obj)) {
|
||||
throw new Exception('"' + name + '" not defined in ' + obj, {
|
||||
loc: loc
|
||||
});
|
||||
}
|
||||
return container.lookupProperty(obj, name);
|
||||
},
|
||||
lookupProperty: function(parent, propertyName) {
|
||||
let result = parent[propertyName];
|
||||
if (result == null) {
|
||||
return result;
|
||||
}
|
||||
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
|
||||
return result;
|
||||
}
|
||||
|
||||
if (resultIsAllowed(result, container.protoAccessControl, propertyName)) {
|
||||
return result;
|
||||
}
|
||||
return undefined;
|
||||
},
|
||||
lookup: function(depths, name) {
|
||||
const len = depths.length;
|
||||
for (let i = 0; i < len; i++) {
|
||||
let result = depths[i] && container.lookupProperty(depths[i], name);
|
||||
if (result != null) {
|
||||
return depths[i][name];
|
||||
}
|
||||
}
|
||||
},
|
||||
lambda: function(current, context) {
|
||||
return typeof current === 'function' ? current.call(context) : current;
|
||||
},
|
||||
|
||||
escapeExpression: Utils.escapeExpression,
|
||||
invokePartial: invokePartialWrapper,
|
||||
|
||||
fn: function(i) {
|
||||
let ret = templateSpec[i];
|
||||
ret.decorator = templateSpec[i + '_d'];
|
||||
return ret;
|
||||
},
|
||||
|
||||
programs: [],
|
||||
program: function(i, data, declaredBlockParams, blockParams, depths) {
|
||||
let programWrapper = this.programs[i],
|
||||
fn = this.fn(i);
|
||||
if (data || depths || blockParams || declaredBlockParams) {
|
||||
programWrapper = wrapProgram(
|
||||
this,
|
||||
i,
|
||||
fn,
|
||||
data,
|
||||
declaredBlockParams,
|
||||
blockParams,
|
||||
depths
|
||||
);
|
||||
} else if (!programWrapper) {
|
||||
programWrapper = this.programs[i] = wrapProgram(this, i, fn);
|
||||
}
|
||||
return programWrapper;
|
||||
},
|
||||
|
||||
data: function(value, depth) {
|
||||
while (value && depth--) {
|
||||
value = value._parent;
|
||||
}
|
||||
return value;
|
||||
},
|
||||
mergeIfNeeded: function(param, common) {
|
||||
let obj = param || common;
|
||||
|
||||
if (param && common && param !== common) {
|
||||
obj = Utils.extend({}, common, param);
|
||||
}
|
||||
|
||||
return obj;
|
||||
},
|
||||
// An empty object to use as replacement for null-contexts
|
||||
nullContext: Object.seal({}),
|
||||
|
||||
noop: env.VM.noop,
|
||||
compilerInfo: templateSpec.compiler
|
||||
};
|
||||
|
||||
function ret(context, options = {}) {
|
||||
let data = options.data;
|
||||
|
||||
ret._setup(options);
|
||||
if (!options.partial && templateSpec.useData) {
|
||||
data = initData(context, data);
|
||||
}
|
||||
let depths,
|
||||
blockParams = templateSpec.useBlockParams ? [] : undefined;
|
||||
if (templateSpec.useDepths) {
|
||||
if (options.depths) {
|
||||
depths =
|
||||
context != options.depths[0]
|
||||
? [context].concat(options.depths)
|
||||
: options.depths;
|
||||
} else {
|
||||
depths = [context];
|
||||
}
|
||||
}
|
||||
|
||||
function main(context /*, options*/) {
|
||||
return (
|
||||
'' +
|
||||
templateSpec.main(
|
||||
container,
|
||||
context,
|
||||
container.helpers,
|
||||
container.partials,
|
||||
data,
|
||||
blockParams,
|
||||
depths
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
main = executeDecorators(
|
||||
templateSpec.main,
|
||||
main,
|
||||
container,
|
||||
options.depths || [],
|
||||
data,
|
||||
blockParams
|
||||
);
|
||||
return main(context, options);
|
||||
}
|
||||
|
||||
ret.isTop = true;
|
||||
|
||||
ret._setup = function(options) {
|
||||
if (!options.partial) {
|
||||
let mergedHelpers = Utils.extend({}, env.helpers, options.helpers);
|
||||
wrapHelpersToPassLookupProperty(mergedHelpers, container);
|
||||
container.helpers = mergedHelpers;
|
||||
|
||||
if (templateSpec.usePartial) {
|
||||
// Use mergeIfNeeded here to prevent compiling global partials multiple times
|
||||
container.partials = container.mergeIfNeeded(
|
||||
options.partials,
|
||||
env.partials
|
||||
);
|
||||
}
|
||||
if (templateSpec.usePartial || templateSpec.useDecorators) {
|
||||
container.decorators = Utils.extend(
|
||||
{},
|
||||
env.decorators,
|
||||
options.decorators
|
||||
);
|
||||
}
|
||||
|
||||
container.hooks = {};
|
||||
container.protoAccessControl = createProtoAccessControl(options);
|
||||
|
||||
let keepHelperInHelpers =
|
||||
options.allowCallsToHelperMissing ||
|
||||
templateWasPrecompiledWithCompilerV7;
|
||||
moveHelperToHooks(container, 'helperMissing', keepHelperInHelpers);
|
||||
moveHelperToHooks(container, 'blockHelperMissing', keepHelperInHelpers);
|
||||
} else {
|
||||
container.protoAccessControl = options.protoAccessControl; // internal option
|
||||
container.helpers = options.helpers;
|
||||
container.partials = options.partials;
|
||||
container.decorators = options.decorators;
|
||||
container.hooks = options.hooks;
|
||||
}
|
||||
};
|
||||
|
||||
ret._child = function(i, data, blockParams, depths) {
|
||||
if (templateSpec.useBlockParams && !blockParams) {
|
||||
throw new Exception('must pass block params');
|
||||
}
|
||||
if (templateSpec.useDepths && !depths) {
|
||||
throw new Exception('must pass parent depths');
|
||||
}
|
||||
|
||||
return wrapProgram(
|
||||
container,
|
||||
i,
|
||||
templateSpec[i],
|
||||
data,
|
||||
0,
|
||||
blockParams,
|
||||
depths
|
||||
);
|
||||
};
|
||||
return ret;
|
||||
}
|
||||
|
||||
export function wrapProgram(
|
||||
container,
|
||||
i,
|
||||
fn,
|
||||
data,
|
||||
declaredBlockParams,
|
||||
blockParams,
|
||||
depths
|
||||
) {
|
||||
function prog(context, options = {}) {
|
||||
let currentDepths = depths;
|
||||
if (
|
||||
depths &&
|
||||
context != depths[0] &&
|
||||
!(context === container.nullContext && depths[0] === null)
|
||||
) {
|
||||
currentDepths = [context].concat(depths);
|
||||
}
|
||||
|
||||
return fn(
|
||||
container,
|
||||
context,
|
||||
container.helpers,
|
||||
container.partials,
|
||||
options.data || data,
|
||||
blockParams && [options.blockParams].concat(blockParams),
|
||||
currentDepths
|
||||
);
|
||||
}
|
||||
|
||||
prog = executeDecorators(fn, prog, container, depths, data, blockParams);
|
||||
|
||||
prog.program = i;
|
||||
prog.depth = depths ? depths.length : 0;
|
||||
prog.blockParams = declaredBlockParams || 0;
|
||||
return prog;
|
||||
}
|
||||
|
||||
/**
|
||||
* This is currently part of the official API, therefore implementation details should not be changed.
|
||||
*/
|
||||
export function resolvePartial(partial, context, options) {
|
||||
if (!partial) {
|
||||
if (options.name === '@partial-block') {
|
||||
partial = options.data['partial-block'];
|
||||
} else {
|
||||
partial = options.partials[options.name];
|
||||
}
|
||||
} else if (!partial.call && !options.name) {
|
||||
// This is a dynamic partial that returned a string
|
||||
options.name = partial;
|
||||
partial = options.partials[partial];
|
||||
}
|
||||
return partial;
|
||||
}
|
||||
|
||||
export function invokePartial(partial, context, options) {
|
||||
// Use the current closure context to save the partial-block if this partial
|
||||
const currentPartialBlock = options.data && options.data['partial-block'];
|
||||
options.partial = true;
|
||||
if (options.ids) {
|
||||
options.data.contextPath = options.ids[0] || options.data.contextPath;
|
||||
}
|
||||
|
||||
let partialBlock;
|
||||
if (options.fn && options.fn !== noop) {
|
||||
options.data = createFrame(options.data);
|
||||
// Wrapper function to get access to currentPartialBlock from the closure
|
||||
let fn = options.fn;
|
||||
partialBlock = options.data['partial-block'] = function partialBlockWrapper(
|
||||
context,
|
||||
options = {}
|
||||
) {
|
||||
// Restore the partial-block from the closure for the execution of the block
|
||||
// i.e. the part inside the block of the partial call.
|
||||
options.data = createFrame(options.data);
|
||||
options.data['partial-block'] = currentPartialBlock;
|
||||
return fn(context, options);
|
||||
};
|
||||
if (fn.partials) {
|
||||
options.partials = Utils.extend({}, options.partials, fn.partials);
|
||||
}
|
||||
}
|
||||
|
||||
if (partial === undefined && partialBlock) {
|
||||
partial = partialBlock;
|
||||
}
|
||||
|
||||
if (partial === undefined) {
|
||||
throw new Exception('The partial ' + options.name + ' could not be found');
|
||||
} else if (partial instanceof Function) {
|
||||
return partial(context, options);
|
||||
}
|
||||
}
|
||||
|
||||
export function noop() {
|
||||
return '';
|
||||
}
|
||||
|
||||
function initData(context, data) {
|
||||
if (!data || !('root' in data)) {
|
||||
data = data ? createFrame(data) : {};
|
||||
data.root = context;
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
||||
function executeDecorators(fn, prog, container, depths, data, blockParams) {
|
||||
if (fn.decorator) {
|
||||
let props = {};
|
||||
prog = fn.decorator(
|
||||
prog,
|
||||
props,
|
||||
container,
|
||||
depths && depths[0],
|
||||
data,
|
||||
blockParams,
|
||||
depths
|
||||
);
|
||||
Utils.extend(prog, props);
|
||||
}
|
||||
return prog;
|
||||
}
|
||||
|
||||
function wrapHelpersToPassLookupProperty(mergedHelpers, container) {
|
||||
Object.keys(mergedHelpers).forEach(helperName => {
|
||||
let helper = mergedHelpers[helperName];
|
||||
mergedHelpers[helperName] = passLookupPropertyOption(helper, container);
|
||||
});
|
||||
}
|
||||
|
||||
function passLookupPropertyOption(helper, container) {
|
||||
const lookupProperty = container.lookupProperty;
|
||||
return wrapHelper(helper, options => {
|
||||
return Utils.extend({ lookupProperty }, options);
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
vows = require 'vows'
|
||||
assert = require 'assert'
|
||||
Netmask = require('../lib/netmask').Netmask
|
||||
|
||||
shouldFailWithError = (msg) ->
|
||||
context =
|
||||
topic: ->
|
||||
try
|
||||
return new Netmask(@context.name)
|
||||
catch e
|
||||
return e
|
||||
'should fail': (e) ->
|
||||
assert.ok isError(e), "is an Error object #{e}"
|
||||
"with error `#{msg}'": (e) ->
|
||||
assert.ok e.message?.toLowerCase().indexOf(msg.toLowerCase()) > -1, "'#{e.message}' =~ #{msg}"
|
||||
|
||||
return context
|
||||
|
||||
isError = (e) ->
|
||||
return typeof e == 'object' and Object.prototype.toString.call(e) == '[object Error]'
|
||||
|
||||
vows.describe('IPs with bytes greater than 255')
|
||||
.addBatch
|
||||
'209.256.68.22/255.255.224.0': shouldFailWithError 'Invalid net'
|
||||
'209.180.68.22/256.255.224.0': shouldFailWithError 'Invalid mask'
|
||||
'209.500.70.33/19': shouldFailWithError 'Invalid net'
|
||||
'140.999.82': shouldFailWithError 'Invalid net'
|
||||
'899.174': shouldFailWithError 'Invalid net'
|
||||
'209.157.65536/19': shouldFailWithError 'Invalid net'
|
||||
'209.300.64.0.10': shouldFailWithError 'Invalid net'
|
||||
'garbage': shouldFailWithError 'Invalid net'
|
||||
.export(module)
|
||||
|
||||
|
||||
vows.describe('Invalid IP format')
|
||||
.addBatch
|
||||
' 1.2.3.4': shouldFailWithError 'Invalid net'
|
||||
' 1.2.3.4': shouldFailWithError 'Invalid net'
|
||||
'1. 2.3.4': shouldFailWithError 'Invalid net'
|
||||
'1.2. 3.4': shouldFailWithError 'Invalid net'
|
||||
'1.2.3. 4': shouldFailWithError 'Invalid net'
|
||||
'1.2.3.4 ': shouldFailWithError 'Invalid net'
|
||||
'1 .2.3.4': shouldFailWithError 'Invalid net'
|
||||
'018.0.0.0': shouldFailWithError 'Invalid net'
|
||||
'08.0.0.0': shouldFailWithError 'Invalid net'
|
||||
'0xfg.0.0.0': shouldFailWithError 'Invalid net'
|
||||
.export(module)
|
||||
|
||||
vows.describe('Ranges that are a power-of-two big, but are not legal blocks')
|
||||
.addBatch
|
||||
'218.0.0.0/221.255.255.255': shouldFailWithError 'Invalid mask'
|
||||
'218.0.0.4/218.0.0.11': shouldFailWithError 'Invalid mask'
|
||||
.export(module)
|
||||
@@ -0,0 +1,12 @@
|
||||
#!/bin/sh
|
||||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||
|
||||
case `uname` in
|
||||
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
|
||||
esac
|
||||
|
||||
if [ -x "$basedir/node" ]; then
|
||||
exec "$basedir/node" "$basedir/../../bin/esbuild" "$@"
|
||||
else
|
||||
exec node "$basedir/../../bin/esbuild" "$@"
|
||||
fi
|
||||
@@ -0,0 +1,12 @@
|
||||
const getType = (value) => (Object.prototype.toString.call(value).slice(8, -1).toLowerCase());
|
||||
export function isPlainObject(value) {
|
||||
if (getType(value) !== "object") {
|
||||
return false;
|
||||
}
|
||||
const pp = Object.getPrototypeOf(value);
|
||||
if (pp === null || pp === undefined) {
|
||||
return true;
|
||||
}
|
||||
const Ctor = pp.constructor && pp.constructor.toString();
|
||||
return Ctor === Object.toString();
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
"use strict";
|
||||
function noop() { }
|
||||
function once(emitter, name) {
|
||||
const o = once.spread(emitter, name);
|
||||
const r = o.then((args) => args[0]);
|
||||
r.cancel = o.cancel;
|
||||
return r;
|
||||
}
|
||||
(function (once) {
|
||||
function spread(emitter, name) {
|
||||
let c = null;
|
||||
const p = new Promise((resolve, reject) => {
|
||||
function cancel() {
|
||||
emitter.removeListener(name, onEvent);
|
||||
emitter.removeListener('error', onError);
|
||||
p.cancel = noop;
|
||||
}
|
||||
function onEvent(...args) {
|
||||
cancel();
|
||||
resolve(args);
|
||||
}
|
||||
function onError(err) {
|
||||
cancel();
|
||||
reject(err);
|
||||
}
|
||||
c = cancel;
|
||||
emitter.on(name, onEvent);
|
||||
emitter.on('error', onError);
|
||||
});
|
||||
if (!c) {
|
||||
throw new TypeError('Could not get `cancel()` function');
|
||||
}
|
||||
p.cancel = c;
|
||||
return p;
|
||||
}
|
||||
once.spread = spread;
|
||||
})(once || (once = {}));
|
||||
module.exports = once;
|
||||
//# sourceMappingURL=index.js.map
|
||||
@@ -0,0 +1,6 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.exhaust = void 0;
|
||||
var exhaustAll_1 = require("./exhaustAll");
|
||||
exports.exhaust = exhaustAll_1.exhaustAll;
|
||||
//# sourceMappingURL=exhaust.js.map
|
||||
@@ -0,0 +1,4 @@
|
||||
export function createObject(keys, values) {
|
||||
return keys.reduce(function (result, key, i) { return ((result[key] = values[i]), result); }, {});
|
||||
}
|
||||
//# sourceMappingURL=createObject.js.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"number.d.ts","sourceRoot":"","sources":["../../../../../../packages/icu-skeleton-parser/number.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,mBAAmB,EAAC,MAAM,4BAA4B,CAAA;AAG9D,MAAM,WAAW,2BAA4B,SAAQ,mBAAmB;IACtE,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AACD,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,MAAM,EAAE,CAAA;CAClB;AAED,wBAAgB,6BAA6B,CAC3C,QAAQ,EAAE,MAAM,GACf,mBAAmB,EAAE,CA0BvB;AAiID;;GAEG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,mBAAmB,EAAE,GAC5B,2BAA2B,CAuL7B"}
|
||||
@@ -0,0 +1,20 @@
|
||||
"use strict";
|
||||
|
||||
var assert = require("chai").assert
|
||||
, ensureArray = require("../../array/ensure");
|
||||
|
||||
describe("array/ensure", function () {
|
||||
it("Should return input value", function () {
|
||||
var value = [];
|
||||
assert.equal(ensureArray(value), value);
|
||||
});
|
||||
it("Should crash on invalid value", function () {
|
||||
try {
|
||||
ensureArray(null);
|
||||
throw new Error("Unexpected");
|
||||
} catch (error) {
|
||||
assert.equal(error.name, "TypeError");
|
||||
assert(error.message.includes("is not an array object"));
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,17 @@
|
||||
define(['exports', 'module'], function (exports, module) {
|
||||
'use strict';
|
||||
|
||||
module.exports = function (Handlebars) {
|
||||
/* istanbul ignore next */
|
||||
var root = typeof global !== 'undefined' ? global : window,
|
||||
$Handlebars = root.Handlebars;
|
||||
/* istanbul ignore next */
|
||||
Handlebars.noConflict = function () {
|
||||
if (root.Handlebars === Handlebars) {
|
||||
root.Handlebars = $Handlebars;
|
||||
}
|
||||
return Handlebars;
|
||||
};
|
||||
};
|
||||
});
|
||||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL2xpYi9oYW5kbGViYXJzL25vLWNvbmZsaWN0LmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OzttQkFBZSxVQUFTLFVBQVUsRUFBRTs7QUFFbEMsUUFBSSxJQUFJLEdBQUcsT0FBTyxNQUFNLEtBQUssV0FBVyxHQUFHLE1BQU0sR0FBRyxNQUFNO1FBQ3hELFdBQVcsR0FBRyxJQUFJLENBQUMsVUFBVSxDQUFDOztBQUVoQyxjQUFVLENBQUMsVUFBVSxHQUFHLFlBQVc7QUFDakMsVUFBSSxJQUFJLENBQUMsVUFBVSxLQUFLLFVBQVUsRUFBRTtBQUNsQyxZQUFJLENBQUMsVUFBVSxHQUFHLFdBQVcsQ0FBQztPQUMvQjtBQUNELGFBQU8sVUFBVSxDQUFDO0tBQ25CLENBQUM7R0FDSCIsImZpbGUiOiJuby1jb25mbGljdC5qcyIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCBkZWZhdWx0IGZ1bmN0aW9uKEhhbmRsZWJhcnMpIHtcbiAgLyogaXN0YW5idWwgaWdub3JlIG5leHQgKi9cbiAgbGV0IHJvb3QgPSB0eXBlb2YgZ2xvYmFsICE9PSAndW5kZWZpbmVkJyA/IGdsb2JhbCA6IHdpbmRvdyxcbiAgICAkSGFuZGxlYmFycyA9IHJvb3QuSGFuZGxlYmFycztcbiAgLyogaXN0YW5idWwgaWdub3JlIG5leHQgKi9cbiAgSGFuZGxlYmFycy5ub0NvbmZsaWN0ID0gZnVuY3Rpb24oKSB7XG4gICAgaWYgKHJvb3QuSGFuZGxlYmFycyA9PT0gSGFuZGxlYmFycykge1xuICAgICAgcm9vdC5IYW5kbGViYXJzID0gJEhhbmRsZWJhcnM7XG4gICAgfVxuICAgIHJldHVybiBIYW5kbGViYXJzO1xuICB9O1xufVxuIl19
|
||||
@@ -0,0 +1,23 @@
|
||||
"use strict";
|
||||
|
||||
var isValue = require("../value/is")
|
||||
, isObject = require("../object/is");
|
||||
|
||||
var objectToString = Object.prototype.toString;
|
||||
|
||||
module.exports = function (value) {
|
||||
if (!isValue(value)) return null;
|
||||
if (isObject(value)) {
|
||||
// Reject Object.prototype.toString coercion
|
||||
var valueToString = value.toString;
|
||||
if (typeof valueToString !== "function") return null;
|
||||
if (valueToString === objectToString) return null;
|
||||
// Note: It can be object coming from other realm, still as there's no ES3 and CSP compliant
|
||||
// way to resolve its realm's Object.prototype.toString it's left as not addressed edge case
|
||||
}
|
||||
try {
|
||||
return "" + value; // Ensure implicit coercion
|
||||
} catch (error) {
|
||||
return null;
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,39 @@
|
||||
# defaults
|
||||
|
||||
> A simple one level options merge utility
|
||||
|
||||
## Install
|
||||
|
||||
```sh
|
||||
npm install defaults
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const defaults = require('defaults');
|
||||
|
||||
const handle = (options, fn) => {
|
||||
options = defaults(options, {
|
||||
timeout: 100
|
||||
});
|
||||
|
||||
setTimeout(() => {
|
||||
fn(options);
|
||||
}, options.timeout);
|
||||
}
|
||||
|
||||
handle({timeout: 1000}, () => {
|
||||
// We're here 1000 ms later
|
||||
});
|
||||
|
||||
handle({timeout: 10000}, () => {
|
||||
// We're here 10s later
|
||||
});
|
||||
```
|
||||
|
||||
## Summary
|
||||
|
||||
this module exports a function that takes 2 arguments: `options` and `defaults`. When called, it overrides all of `undefined` properties in `options` with the clones of properties defined in `defaults`
|
||||
|
||||
Sidecases: if called with a falsy `options` value, options will be initialized to a new object before being merged onto.
|
||||
Reference in New Issue
Block a user