update
This commit is contained in:
@@ -0,0 +1,93 @@
|
||||
import type { StateCreator, StoreMutatorIdentifier } from 'zustand/vanilla';
|
||||
export interface StateStorage {
|
||||
getItem: (name: string) => string | null | Promise<string | null>;
|
||||
setItem: (name: string, value: string) => unknown | Promise<unknown>;
|
||||
removeItem: (name: string) => unknown | Promise<unknown>;
|
||||
}
|
||||
export type StorageValue<S> = {
|
||||
state: S;
|
||||
version?: number;
|
||||
};
|
||||
export interface PersistStorage<S> {
|
||||
getItem: (name: string) => StorageValue<S> | null | Promise<StorageValue<S> | null>;
|
||||
setItem: (name: string, value: StorageValue<S>) => unknown | Promise<unknown>;
|
||||
removeItem: (name: string) => unknown | Promise<unknown>;
|
||||
}
|
||||
type JsonStorageOptions = {
|
||||
reviver?: (key: string, value: unknown) => unknown;
|
||||
replacer?: (key: string, value: unknown) => unknown;
|
||||
};
|
||||
export declare function createJSONStorage<S>(getStorage: () => StateStorage, options?: JsonStorageOptions): PersistStorage<S> | undefined;
|
||||
export interface PersistOptions<S, PersistedState = S> {
|
||||
/** Name of the storage (must be unique) */
|
||||
name: string;
|
||||
/**
|
||||
* Use a custom persist storage.
|
||||
*
|
||||
* Combining `createJSONStorage` helps creating a persist storage
|
||||
* with JSON.parse and JSON.stringify.
|
||||
*
|
||||
* @default createJSONStorage(() => localStorage)
|
||||
*/
|
||||
storage?: PersistStorage<PersistedState> | undefined;
|
||||
/**
|
||||
* Filter the persisted value.
|
||||
*
|
||||
* @params state The state's value
|
||||
*/
|
||||
partialize?: (state: S) => PersistedState;
|
||||
/**
|
||||
* A function returning another (optional) function.
|
||||
* The main function will be called before the state rehydration.
|
||||
* The returned function will be called after the state rehydration or when an error occurred.
|
||||
*/
|
||||
onRehydrateStorage?: (state: S) => ((state?: S, error?: unknown) => void) | void;
|
||||
/**
|
||||
* If the stored state's version mismatch the one specified here, the storage will not be used.
|
||||
* This is useful when adding a breaking change to your store.
|
||||
*/
|
||||
version?: number;
|
||||
/**
|
||||
* A function to perform persisted state migration.
|
||||
* This function will be called when persisted state versions mismatch with the one specified here.
|
||||
*/
|
||||
migrate?: (persistedState: unknown, version: number) => PersistedState | Promise<PersistedState>;
|
||||
/**
|
||||
* A function to perform custom hydration merges when combining the stored state with the current one.
|
||||
* By default, this function does a shallow merge.
|
||||
*/
|
||||
merge?: (persistedState: unknown, currentState: S) => S;
|
||||
/**
|
||||
* An optional boolean that will prevent the persist middleware from triggering hydration on initialization,
|
||||
* This allows you to call `rehydrate()` at a specific point in your apps rendering life-cycle.
|
||||
*
|
||||
* This is useful in SSR application.
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
skipHydration?: boolean;
|
||||
}
|
||||
type PersistListener<S> = (state: S) => void;
|
||||
type StorePersist<S, Ps> = {
|
||||
persist: {
|
||||
setOptions: (options: Partial<PersistOptions<S, Ps>>) => void;
|
||||
clearStorage: () => void;
|
||||
rehydrate: () => Promise<void> | void;
|
||||
hasHydrated: () => boolean;
|
||||
onHydrate: (fn: PersistListener<S>) => () => void;
|
||||
onFinishHydration: (fn: PersistListener<S>) => () => void;
|
||||
getOptions: () => Partial<PersistOptions<S, Ps>>;
|
||||
};
|
||||
};
|
||||
type Persist = <T, Mps extends [StoreMutatorIdentifier, unknown][] = [], Mcs extends [StoreMutatorIdentifier, unknown][] = [], U = T>(initializer: StateCreator<T, [...Mps, ['zustand/persist', unknown]], Mcs>, options: PersistOptions<T, U>) => StateCreator<T, Mps, [['zustand/persist', U], ...Mcs]>;
|
||||
declare module '../vanilla' {
|
||||
interface StoreMutators<S, A> {
|
||||
'zustand/persist': WithPersist<S, A>;
|
||||
}
|
||||
}
|
||||
type Write<T, U> = Omit<T, keyof U> & U;
|
||||
type WithPersist<S, A> = S extends {
|
||||
getState: () => infer T;
|
||||
} ? Write<S, StorePersist<T, A>> : never;
|
||||
export declare const persist: Persist;
|
||||
export {};
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={C:{"64":0.00461,"105":0.01382,"115":0.01382,"127":0.00461,"128":0.01382,"129":0.00461,"133":0.00461,"134":0.01842,"135":0.30854,"136":1.15586,_:"2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 106 107 108 109 110 111 112 113 114 116 117 118 119 120 121 122 123 124 125 126 130 131 132 137 138 139 140 3.5 3.6"},D:{"39":0.00921,"40":0.00461,"41":0.00461,"42":0.00461,"43":0.00461,"44":0.00461,"45":0.00461,"46":0.00461,"47":0.00461,"48":0.00461,"49":0.00461,"50":0.00461,"52":0.00461,"53":0.00461,"54":0.00461,"55":0.00461,"56":0.00461,"57":0.00461,"58":0.00461,"59":0.00461,"60":0.00461,"62":0.01842,"67":0.00461,"73":0.00921,"75":0.00461,"76":0.00461,"79":0.02303,"80":0.02763,"83":0.01382,"85":0.00461,"87":0.04605,"89":0.00461,"91":0.00921,"93":0.00461,"94":0.01842,"95":0.00461,"102":0.01842,"103":0.03224,"105":0.00461,"107":0.00461,"108":0.00461,"109":0.38682,"110":0.00461,"113":0.00921,"114":0.00461,"116":0.03224,"119":0.00921,"120":0.00461,"121":0.04605,"122":0.03224,"123":0.00921,"124":0.00461,"125":0.05066,"126":0.03684,"127":0.01842,"128":0.07829,"129":0.00921,"130":0.0875,"131":0.76904,"132":0.47432,"133":8.26598,"134":13.2578,"135":0.01382,"136":0.00461,_:"4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 51 61 63 64 65 66 68 69 70 71 72 74 77 78 81 84 86 88 90 92 96 97 98 99 100 101 104 106 111 112 115 117 118 137 138"},F:{"95":0.01382,"116":0.74141,"117":0.78746,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 60 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"105":0.00461,"109":0.03684,"124":0.00461,"128":0.00921,"129":0.00921,"131":0.02303,"132":0.05526,"133":3.43533,"134":7.84692,_:"12 13 14 15 16 17 18 79 80 81 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 106 107 108 110 111 112 113 114 115 116 117 118 119 120 121 122 123 125 126 127 130"},E:{"13":0.00461,"14":0.00461,_:"0 4 5 6 7 8 9 10 11 12 15 3.1 3.2 5.1 6.1 7.1 9.1 10.1 11.1 12.1 15.1 15.2-15.3 15.5","13.1":0.01382,"14.1":0.15197,"15.4":0.00461,"15.6":0.09671,"16.0":0.00461,"16.1":0.41445,"16.2":0.05066,"16.3":0.06908,"16.4":0.03224,"16.5":0.01382,"16.6":0.17039,"17.0":0.00461,"17.1":0.4605,"17.2":0.00921,"17.3":0.02763,"17.4":0.05066,"17.5":0.24407,"17.6":0.20262,"18.0":0.02763,"18.1":0.33156,"18.2":0.07829,"18.3":3.0347,"18.4":0.01382},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00271,"5.0-5.1":0,"6.0-6.1":0.00812,"7.0-7.1":0.00541,"8.1-8.4":0,"9.0-9.2":0.00406,"9.3":0.01895,"10.0-10.2":0.00135,"10.3":0.03113,"11.0-11.2":0.14348,"11.3-11.4":0.00948,"12.0-12.1":0.00541,"12.2-12.5":0.13401,"13.0-13.1":0.00271,"13.2":0.00406,"13.3":0.00541,"13.4-13.7":0.01895,"14.0-14.4":0.04738,"14.5-14.8":0.05685,"15.0-15.1":0.03113,"15.2-15.3":0.03113,"15.4":0.0379,"15.5":0.04332,"15.6-15.8":0.53332,"16.0":0.0758,"16.1":0.15566,"16.2":0.08122,"16.3":0.14077,"16.4":0.03113,"16.5":0.05821,"16.6-16.7":0.63213,"17.0":0.0379,"17.1":0.06768,"17.2":0.05144,"17.3":0.07174,"17.4":0.14348,"17.5":0.31945,"17.6-17.7":0.92722,"18.0":0.25989,"18.1":0.85006,"18.2":0.38036,"18.3":7.94973,"18.4":0.11776},P:{"4":0.04433,"20":0.01108,"21":0.02216,"22":0.05541,"23":0.01108,"24":0.03324,"25":0.06649,"26":0.32137,"27":4.23318,"5.0-5.4":0.01108,_:"6.2-6.4 8.2 9.2 10.1 11.1-11.2 12.0 13.0 14.0 15.0 16.0 18.0","7.2-7.4":0.05541,"17.0":0.04433,"19.0":0.01108},I:{"0":0.50607,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0.00015,"4.4":0,"4.4.3-4.4.4":0.00056},K:{"0":0.41542,_:"10 11 12 11.1 11.5 12.1"},A:{_:"6 7 8 9 10 11 5.5"},S:{_:"2.5 3.0-3.1"},J:{_:"7 10"},N:{_:"10 11"},R:{_:"0"},M:{"0":1.78035},Q:{_:"14.9"},O:{"0":0.05935},H:{"0":0},L:{"0":34.03202}};
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"2":"K D E F A B mC"},B:{"1":"0 9 n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB I","2":"C L M G N O P Q H R S T U V W X Y Z a b c d e f g h i j k l m"},C:{"2":"0 1 2 3 4 5 6 7 8 9 nC LC J PB K D E F A B C L M G N O P QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB MC wB NC xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC Q H R OC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB I PC EC QC RC oC pC qC rC"},D:{"1":"0 9 n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB I PC EC QC RC","2":"1 2 3 4 5 6 7 8 J PB K D E F A B C L M G N O P QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB MC wB NC xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC Q H R S T U V W X Y Z a b c d e f g h i j k l m"},E:{"2":"J PB K D E F A B C L M G sC SC tC uC vC wC TC FC GC xC yC zC UC VC HC 0C IC WC XC YC ZC aC 1C JC bC cC dC eC fC 2C KC gC hC iC jC 3C"},F:{"1":"0 Z a b c d e f g h i j k l m n o p q r s t u v w x y z","2":"1 2 3 4 5 6 7 8 F B C G N O P QB RB SB TB UB VB WB XB YB ZB 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 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC Q H R OC S T U V W X Y 4C 5C 6C 7C FC kC 8C GC"},G:{"2":"E SC 9C lC AD BD CD DD ED FD GD HD ID JD KD LD MD ND OD PD QD RD SD UC VC HC TD IC WC XC YC ZC aC UD JC bC cC dC eC fC VD KC gC hC iC jC"},H:{"2":"WD"},I:{"1":"I","2":"LC J XD YD ZD aD lC bD cD"},J:{"2":"D A"},K:{"1":"H","2":"A B C FC kC GC"},L:{"1":"I"},M:{"2":"EC"},N:{"2":"A B"},O:{"2":"HC"},P:{"2":"1 2 3 4 5 6 7 8 J dD eD fD gD hD TC iD jD kD lD mD IC JC KC nD"},Q:{"2":"oD"},R:{"2":"pD"},S:{"2":"qD rD"}},B:7,C:"Subresource Loading with Web Bundles",D:false};
|
||||
@@ -0,0 +1,78 @@
|
||||
var AND_REGEXP = /^\s+and\s+(.*)/i
|
||||
var OR_REGEXP = /^(?:,\s*|\s+or\s+)(.*)/i
|
||||
|
||||
function flatten(array) {
|
||||
if (!Array.isArray(array)) return [array]
|
||||
return array.reduce(function (a, b) {
|
||||
return a.concat(flatten(b))
|
||||
}, [])
|
||||
}
|
||||
|
||||
function find(string, predicate) {
|
||||
for (var max = string.length, n = 1; n <= max; n++) {
|
||||
var parsed = string.substr(-n, n)
|
||||
if (predicate(parsed, n, max)) {
|
||||
return string.slice(0, -n)
|
||||
}
|
||||
}
|
||||
return ''
|
||||
}
|
||||
|
||||
function matchQuery(all, query) {
|
||||
var node = { query: query }
|
||||
if (query.indexOf('not ') === 0) {
|
||||
node.not = true
|
||||
query = query.slice(4)
|
||||
}
|
||||
|
||||
for (var name in all) {
|
||||
var type = all[name]
|
||||
var match = query.match(type.regexp)
|
||||
if (match) {
|
||||
node.type = name
|
||||
for (var i = 0; i < type.matches.length; i++) {
|
||||
node[type.matches[i]] = match[i + 1]
|
||||
}
|
||||
return node
|
||||
}
|
||||
}
|
||||
|
||||
node.type = 'unknown'
|
||||
return node
|
||||
}
|
||||
|
||||
function matchBlock(all, string, qs) {
|
||||
var node
|
||||
return find(string, function (parsed, n, max) {
|
||||
if (AND_REGEXP.test(parsed)) {
|
||||
node = matchQuery(all, parsed.match(AND_REGEXP)[1])
|
||||
node.compose = 'and'
|
||||
qs.unshift(node)
|
||||
return true
|
||||
} else if (OR_REGEXP.test(parsed)) {
|
||||
node = matchQuery(all, parsed.match(OR_REGEXP)[1])
|
||||
node.compose = 'or'
|
||||
qs.unshift(node)
|
||||
return true
|
||||
} else if (n === max) {
|
||||
node = matchQuery(all, parsed.trim())
|
||||
node.compose = 'or'
|
||||
qs.unshift(node)
|
||||
return true
|
||||
}
|
||||
return false
|
||||
})
|
||||
}
|
||||
|
||||
module.exports = function parse(all, queries) {
|
||||
if (!Array.isArray(queries)) queries = [queries]
|
||||
return flatten(
|
||||
queries.map(function (block) {
|
||||
var qs = []
|
||||
do {
|
||||
block = matchBlock(all, block, qs)
|
||||
} while (block)
|
||||
return qs
|
||||
})
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
{
|
||||
"name": "file-entry-cache",
|
||||
"version": "8.0.0",
|
||||
"description": "Super simple cache for file metadata, useful for process that work o a given series of files and that only need to repeat the job on the changed ones since the previous run of the process",
|
||||
"repository": "jaredwray/file-entry-cache",
|
||||
"license": "MIT",
|
||||
"author": {
|
||||
"name": "Jared Wray",
|
||||
"url": "https://jaredwray.com"
|
||||
},
|
||||
"main": "cache.js",
|
||||
"files": [
|
||||
"cache.js"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=16.0.0"
|
||||
},
|
||||
"scripts": {
|
||||
"eslint": "eslint --cache --cache-location=node_modules/.cache/ 'cache.js' 'test/**/*.js' 'perf.js'",
|
||||
"autofix": "npm run eslint -- --fix",
|
||||
"clean": "rimraf ./node_modules ./package-lock.json ./yarn.lock",
|
||||
"test": "npm run eslint --silent && c8 mocha -R spec test/specs",
|
||||
"test:ci": "npm run eslint --silent && c8 --reporter=lcov mocha -R spec test/specs",
|
||||
"perf": "node perf.js"
|
||||
},
|
||||
"prepush": [
|
||||
"npm run eslint --silent"
|
||||
],
|
||||
"precommit": [
|
||||
"npm run eslint --silent"
|
||||
],
|
||||
"keywords": [
|
||||
"file cache",
|
||||
"task cache files",
|
||||
"file cache",
|
||||
"key par",
|
||||
"key value",
|
||||
"cache"
|
||||
],
|
||||
"devDependencies": {
|
||||
"c8": "^8.0.1",
|
||||
"chai": "^4.3.10",
|
||||
"eslint": "^8.56.0",
|
||||
"eslint-config-prettier": "^9.1.0",
|
||||
"eslint-plugin-mocha": "^10.2.0",
|
||||
"eslint-plugin-prettier": "^5.0.1",
|
||||
"glob-expand": "^0.2.1",
|
||||
"mocha": "^10.2.0",
|
||||
"prettier": "^3.1.1",
|
||||
"rimraf": "^5.0.5",
|
||||
"write": "^2.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"flat-cache": "^4.0.0"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
/*
|
||||
MIT License http://www.opensource.org/licenses/mit-license.php
|
||||
Author Tobias Koppers @sokra
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
|
||||
/** @typedef {import("./Resolver")} Resolver */
|
||||
/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */
|
||||
/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */
|
||||
|
||||
module.exports = class ParsePlugin {
|
||||
/**
|
||||
* @param {string | ResolveStepHook} source source
|
||||
* @param {Partial<ResolveRequest>} requestOptions request options
|
||||
* @param {string | ResolveStepHook} target target
|
||||
*/
|
||||
constructor(source, requestOptions, target) {
|
||||
this.source = source;
|
||||
this.requestOptions = requestOptions;
|
||||
this.target = target;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Resolver} resolver the resolver
|
||||
* @returns {void}
|
||||
*/
|
||||
apply(resolver) {
|
||||
const target = resolver.ensureHook(this.target);
|
||||
resolver
|
||||
.getHook(this.source)
|
||||
.tapAsync("ParsePlugin", (request, resolveContext, callback) => {
|
||||
const parsed = resolver.parse(/** @type {string} */ (request.request));
|
||||
/** @type {ResolveRequest} */
|
||||
const obj = { ...request, ...parsed, ...this.requestOptions };
|
||||
if (request.query && !parsed.query) {
|
||||
obj.query = request.query;
|
||||
}
|
||||
if (request.fragment && !parsed.fragment) {
|
||||
obj.fragment = request.fragment;
|
||||
}
|
||||
if (parsed && resolveContext.log) {
|
||||
if (parsed.module) resolveContext.log("Parsed request is a module");
|
||||
if (parsed.directory)
|
||||
resolveContext.log("Parsed request is a directory");
|
||||
}
|
||||
// There is an edge-case where a request with # can be a path or a fragment -> try both
|
||||
if (obj.request && !obj.query && obj.fragment) {
|
||||
const directory = obj.fragment.endsWith("/");
|
||||
/** @type {ResolveRequest} */
|
||||
const alternative = {
|
||||
...obj,
|
||||
directory,
|
||||
request:
|
||||
obj.request +
|
||||
(obj.directory ? "/" : "") +
|
||||
(directory ? obj.fragment.slice(0, -1) : obj.fragment),
|
||||
fragment: ""
|
||||
};
|
||||
resolver.doResolve(
|
||||
target,
|
||||
alternative,
|
||||
null,
|
||||
resolveContext,
|
||||
(err, result) => {
|
||||
if (err) return callback(err);
|
||||
if (result) return callback(null, result);
|
||||
resolver.doResolve(target, obj, null, resolveContext, callback);
|
||||
}
|
||||
);
|
||||
return;
|
||||
}
|
||||
resolver.doResolve(target, obj, null, resolveContext, callback);
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"names":["_t","require","createFlowUnionType","createTSUnionType","createUnionTypeAnnotation","isFlowType","isTSType","createUnionType","types","every","v"],"sources":["../../../src/path/inference/util.ts"],"sourcesContent":["import {\n createFlowUnionType,\n createTSUnionType,\n createUnionTypeAnnotation,\n isFlowType,\n isTSType,\n} from \"@babel/types\";\nimport type * as t from \"@babel/types\";\n\nexport function createUnionType(\n types: (t.FlowType | t.TSType)[],\n): t.FlowType | t.TSType | undefined {\n if (process.env.BABEL_8_BREAKING) {\n if (types.every(v => isFlowType(v))) {\n return createFlowUnionType(types);\n }\n if (types.every(v => isTSType(v))) {\n return createTSUnionType(types);\n }\n } else {\n if (types.every(v => isFlowType(v))) {\n if (createFlowUnionType) {\n return createFlowUnionType(types);\n }\n\n return createUnionTypeAnnotation(types);\n } else if (types.every(v => isTSType(v))) {\n if (createTSUnionType) {\n return createTSUnionType(types);\n }\n }\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,EAAA,GAAAC,OAAA;AAMsB;EALpBC,mBAAmB;EACnBC,iBAAiB;EACjBC,yBAAyB;EACzBC,UAAU;EACVC;AAAQ,IAAAN,EAAA;AAIH,SAASO,eAAeA,CAC7BC,KAAgC,EACG;EAQ5B;IACL,IAAIA,KAAK,CAACC,KAAK,CAACC,CAAC,IAAIL,UAAU,CAACK,CAAC,CAAC,CAAC,EAAE;MACnC,IAAIR,mBAAmB,EAAE;QACvB,OAAOA,mBAAmB,CAACM,KAAK,CAAC;MACnC;MAEA,OAAOJ,yBAAyB,CAACI,KAAK,CAAC;IACzC,CAAC,MAAM,IAAIA,KAAK,CAACC,KAAK,CAACC,CAAC,IAAIJ,QAAQ,CAACI,CAAC,CAAC,CAAC,EAAE;MACxC,IAAIP,iBAAiB,EAAE;QACrB,OAAOA,iBAAiB,CAACK,KAAK,CAAC;MACjC;IACF;EACF;AACF","ignoreList":[]}
|
||||
@@ -0,0 +1,11 @@
|
||||
"use strict";
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.default = useDocumentContext;
|
||||
const react_1 = require("react");
|
||||
const DocumentContext_js_1 = __importDefault(require("../../DocumentContext.js"));
|
||||
function useDocumentContext() {
|
||||
return (0, react_1.useContext)(DocumentContext_js_1.default);
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
export default false
|
||||
@@ -0,0 +1,78 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "ROOT_CONFIG_FILENAMES", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _configuration.ROOT_CONFIG_FILENAMES;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "findConfigUpwards", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _configuration.findConfigUpwards;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "findPackageData", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _package.findPackageData;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "findRelativeConfig", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _configuration.findRelativeConfig;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "findRootConfig", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _configuration.findRootConfig;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "loadConfig", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _configuration.loadConfig;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "loadPlugin", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _plugins.loadPlugin;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "loadPreset", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _plugins.loadPreset;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "resolvePlugin", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _plugins.resolvePlugin;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "resolvePreset", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _plugins.resolvePreset;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "resolveShowConfigPath", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _configuration.resolveShowConfigPath;
|
||||
}
|
||||
});
|
||||
var _package = require("./package.js");
|
||||
var _configuration = require("./configuration.js");
|
||||
var _plugins = require("./plugins.js");
|
||||
({});
|
||||
0 && 0;
|
||||
|
||||
//# sourceMappingURL=index.js.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"names":["_using","stack","value","isAwait","Object","TypeError","dispose","Symbol","asyncDispose","for","push","v","d","a"],"sources":["../../src/helpers/using.js"],"sourcesContent":["/* @minVersion 7.22.0 */\n/* @onlyBabel7 */\n\nexport default function _using(stack, value, isAwait) {\n if (value === null || value === void 0) return value;\n if (Object(value) !== value) {\n throw new TypeError(\n \"using declarations can only be used with objects, functions, null, or undefined.\",\n );\n }\n // core-js-pure uses Symbol.for for polyfilling well-known symbols\n if (isAwait) {\n var dispose =\n value[Symbol.asyncDispose || Symbol.for(\"Symbol.asyncDispose\")];\n }\n if (dispose === null || dispose === void 0) {\n dispose = value[Symbol.dispose || Symbol.for(\"Symbol.dispose\")];\n }\n if (typeof dispose !== \"function\") {\n throw new TypeError(`Property [Symbol.dispose] is not a function.`);\n }\n stack.push({ v: value, d: dispose, a: isAwait });\n return value;\n}\n"],"mappings":";;;;;;AAGe,SAASA,MAAMA,CAACC,KAAK,EAAEC,KAAK,EAAEC,OAAO,EAAE;EACpD,IAAID,KAAK,KAAK,IAAI,IAAIA,KAAK,KAAK,KAAK,CAAC,EAAE,OAAOA,KAAK;EACpD,IAAIE,MAAM,CAACF,KAAK,CAAC,KAAKA,KAAK,EAAE;IAC3B,MAAM,IAAIG,SAAS,CACjB,kFACF,CAAC;EACH;EAEA,IAAIF,OAAO,EAAE;IACX,IAAIG,OAAO,GACTJ,KAAK,CAACK,MAAM,CAACC,YAAY,IAAID,MAAM,CAACE,GAAG,CAAC,qBAAqB,CAAC,CAAC;EACnE;EACA,IAAIH,OAAO,KAAK,IAAI,IAAIA,OAAO,KAAK,KAAK,CAAC,EAAE;IAC1CA,OAAO,GAAGJ,KAAK,CAACK,MAAM,CAACD,OAAO,IAAIC,MAAM,CAACE,GAAG,CAAC,gBAAgB,CAAC,CAAC;EACjE;EACA,IAAI,OAAOH,OAAO,KAAK,UAAU,EAAE;IACjC,MAAM,IAAID,SAAS,CAAC,8CAA8C,CAAC;EACrE;EACAJ,KAAK,CAACS,IAAI,CAAC;IAAEC,CAAC,EAAET,KAAK;IAAEU,CAAC,EAAEN,OAAO;IAAEO,CAAC,EAAEV;EAAQ,CAAC,CAAC;EAChD,OAAOD,KAAK;AACd","ignoreList":[]}
|
||||
@@ -0,0 +1,126 @@
|
||||
// Copyright Joyent, Inc. and other Node contributors.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||
// copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to permit
|
||||
// persons to whom the Software is furnished to do so, subject to the
|
||||
// following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included
|
||||
// in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
|
||||
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
||||
// USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
// a duplex stream is just a stream that is both readable and writable.
|
||||
// Since JS doesn't have multiple prototypal inheritance, this class
|
||||
// prototypally inherits from Readable, and then parasitically from
|
||||
// Writable.
|
||||
|
||||
'use strict';
|
||||
|
||||
/*<replacement>*/
|
||||
var objectKeys = Object.keys || function (obj) {
|
||||
var keys = [];
|
||||
for (var key in obj) keys.push(key);
|
||||
return keys;
|
||||
};
|
||||
/*</replacement>*/
|
||||
|
||||
module.exports = Duplex;
|
||||
var Readable = require('./_stream_readable');
|
||||
var Writable = require('./_stream_writable');
|
||||
require('inherits')(Duplex, Readable);
|
||||
{
|
||||
// Allow the keys array to be GC'ed.
|
||||
var keys = objectKeys(Writable.prototype);
|
||||
for (var v = 0; v < keys.length; v++) {
|
||||
var method = keys[v];
|
||||
if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method];
|
||||
}
|
||||
}
|
||||
function Duplex(options) {
|
||||
if (!(this instanceof Duplex)) return new Duplex(options);
|
||||
Readable.call(this, options);
|
||||
Writable.call(this, options);
|
||||
this.allowHalfOpen = true;
|
||||
if (options) {
|
||||
if (options.readable === false) this.readable = false;
|
||||
if (options.writable === false) this.writable = false;
|
||||
if (options.allowHalfOpen === false) {
|
||||
this.allowHalfOpen = false;
|
||||
this.once('end', onend);
|
||||
}
|
||||
}
|
||||
}
|
||||
Object.defineProperty(Duplex.prototype, 'writableHighWaterMark', {
|
||||
// making it explicit this property is not enumerable
|
||||
// because otherwise some prototype manipulation in
|
||||
// userland will fail
|
||||
enumerable: false,
|
||||
get: function get() {
|
||||
return this._writableState.highWaterMark;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(Duplex.prototype, 'writableBuffer', {
|
||||
// making it explicit this property is not enumerable
|
||||
// because otherwise some prototype manipulation in
|
||||
// userland will fail
|
||||
enumerable: false,
|
||||
get: function get() {
|
||||
return this._writableState && this._writableState.getBuffer();
|
||||
}
|
||||
});
|
||||
Object.defineProperty(Duplex.prototype, 'writableLength', {
|
||||
// making it explicit this property is not enumerable
|
||||
// because otherwise some prototype manipulation in
|
||||
// userland will fail
|
||||
enumerable: false,
|
||||
get: function get() {
|
||||
return this._writableState.length;
|
||||
}
|
||||
});
|
||||
|
||||
// the no-half-open enforcer
|
||||
function onend() {
|
||||
// If the writable side ended, then we're ok.
|
||||
if (this._writableState.ended) return;
|
||||
|
||||
// no more data can be written.
|
||||
// But allow more writes to happen in this tick.
|
||||
process.nextTick(onEndNT, this);
|
||||
}
|
||||
function onEndNT(self) {
|
||||
self.end();
|
||||
}
|
||||
Object.defineProperty(Duplex.prototype, 'destroyed', {
|
||||
// making it explicit this property is not enumerable
|
||||
// because otherwise some prototype manipulation in
|
||||
// userland will fail
|
||||
enumerable: false,
|
||||
get: function get() {
|
||||
if (this._readableState === undefined || this._writableState === undefined) {
|
||||
return false;
|
||||
}
|
||||
return this._readableState.destroyed && this._writableState.destroyed;
|
||||
},
|
||||
set: function set(value) {
|
||||
// we ignore the value if the stream
|
||||
// has not been initialized yet
|
||||
if (this._readableState === undefined || this._writableState === undefined) {
|
||||
return;
|
||||
}
|
||||
|
||||
// backward compatibility, the user is explicitly
|
||||
// managing destroyed
|
||||
this._readableState.destroyed = value;
|
||||
this._writableState.destroyed = value;
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,30 @@
|
||||
{
|
||||
"name": "@types/cookie",
|
||||
"version": "0.6.0",
|
||||
"description": "TypeScript definitions for cookie",
|
||||
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/cookie",
|
||||
"license": "MIT",
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Pine Mizune",
|
||||
"githubUsername": "pine",
|
||||
"url": "https://github.com/pine"
|
||||
},
|
||||
{
|
||||
"name": "Piotr Błażejewicz",
|
||||
"githubUsername": "peterblazejewicz",
|
||||
"url": "https://github.com/peterblazejewicz"
|
||||
}
|
||||
],
|
||||
"main": "",
|
||||
"types": "index.d.ts",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
|
||||
"directory": "types/cookie"
|
||||
},
|
||||
"scripts": {},
|
||||
"dependencies": {},
|
||||
"typesPublisherContentHash": "0fbdf9c886fb40c8dc7677b8b7d0f9e02ac5235e163d90244a4fb9004736a575",
|
||||
"typeScriptVersion": "4.5"
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"644":"K D E F mC","772":"A B"},B:{"1":"0 9 P Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB I","260":"C L M G N O"},C:{"1":"0 1 2 3 4 5 6 7 8 9 J PB K D E F A B C L M G N O P QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB MC wB NC xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC Q H R OC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB I PC EC QC RC oC pC qC rC","8":"nC LC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 J PB K D E F A B C L M G N O P QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB MC wB NC xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB I PC EC QC RC"},E:{"1":"J PB K D E F A B C L M G sC SC tC uC vC wC TC FC GC xC yC zC UC VC HC 0C IC WC XC YC ZC aC 1C JC bC cC dC eC fC 2C KC gC hC iC jC 3C"},F:{"1":"0 1 2 3 4 5 6 7 8 C G N O P QB RB SB TB UB VB WB XB YB ZB 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 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC Q H R OC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z GC","8":"F B 4C 5C 6C 7C FC kC 8C"},G:{"1":"SD UC VC HC TD IC WC XC YC ZC aC UD JC bC cC dC eC fC VD KC gC hC iC jC","2":"E SC 9C lC AD BD CD DD ED FD GD HD ID JD KD LD MD ND OD PD QD RD"},H:{"2":"WD"},I:{"2":"LC J XD YD ZD aD lC bD cD","1025":"I"},J:{"2":"D A"},K:{"1":"GC","8":"A B C FC kC","1025":"H"},L:{"1025":"I"},M:{"2":"EC"},N:{"1":"A B"},O:{"1025":"HC"},P:{"2":"1 2 3 4 5 6 7 8 J dD eD fD gD hD TC iD jD kD lD mD IC JC KC nD"},Q:{"1":"oD"},R:{"2":"pD"},S:{"2":"qD rD"}},B:1,C:"Drag and Drop",D:true};
|
||||
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) Luke Edwards <luke.edwards05@gmail.com> (lukeed.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={C:{"2":0.00166,"53":0.14904,"68":0.00166,"78":0.01987,"80":0.00166,"91":0.00166,"94":0.00166,"101":0.00166,"102":0.00497,"103":0.00166,"113":0.00166,"115":0.09274,"119":0.00166,"126":0.00166,"127":0.02153,"128":0.12586,"131":0.01159,"132":0.00662,"133":0.00662,"134":0.01159,"135":0.77998,"136":2.26541,"137":0.00331,_:"3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 54 55 56 57 58 59 60 61 62 63 64 65 66 67 69 70 71 72 73 74 75 76 77 79 81 82 83 84 85 86 87 88 89 90 92 93 95 96 97 98 99 100 104 105 106 107 108 109 110 111 112 114 116 117 118 120 121 122 123 124 125 129 130 138 139 140 3.5 3.6"},D:{"39":0.00166,"42":0.00166,"43":0.00166,"44":0.00166,"45":0.00166,"46":0.00166,"47":0.00166,"49":0.00497,"50":0.00166,"51":0.00166,"53":0.00166,"54":0.00166,"55":0.00166,"56":0.00166,"59":0.00166,"68":0.01159,"77":0.00166,"79":0.00497,"81":0.01159,"85":0.00166,"87":0.00662,"92":0.00828,"93":0.00331,"94":0.02318,"100":0.00662,"103":0.01325,"104":0.00497,"106":0.00166,"107":0.00166,"108":0.00166,"109":0.17719,"111":0.00497,"113":0.00166,"114":0.00166,"115":0.00166,"116":0.04637,"117":0.00994,"118":0.00166,"120":0.00331,"121":0.05299,"122":0.00662,"123":0.00497,"125":0.00828,"126":0.02318,"127":0.0149,"128":0.06624,"129":0.36266,"130":0.00828,"131":0.08942,"132":0.15898,"133":1.89778,"134":4.10854,"135":0.00166,_:"4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 40 41 48 52 57 58 60 61 62 63 64 65 66 67 69 70 71 72 73 74 75 76 78 80 83 84 86 88 89 90 91 95 96 97 98 99 101 102 105 110 112 119 124 136 137 138"},F:{"95":0.00662,"114":0.01987,"115":0.00331,"116":0.05299,"117":0.48852,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 60 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"18":0.00166,"85":0.00166,"92":0.00166,"100":0.01987,"102":0.00166,"107":0.00331,"109":0.00994,"112":0.00331,"114":0.00497,"117":0.00166,"119":0.25999,"120":0.00662,"121":0.00166,"122":0.00662,"123":0.00331,"124":0.00331,"125":0.16394,"126":0.00331,"127":0.00331,"128":0.00331,"129":0.00828,"130":0.02484,"131":0.06458,"132":0.02484,"133":0.80316,"134":1.64275,_:"12 13 14 15 16 17 79 80 81 83 84 86 87 88 89 90 91 93 94 95 96 97 98 99 101 103 104 105 106 108 110 111 113 115 116 118"},E:{"13":0.00166,"14":0.00166,"15":0.01159,_:"0 4 5 6 7 8 9 10 11 12 3.1 3.2 5.1 6.1 7.1 9.1 10.1 11.1","12.1":0.00497,"13.1":0.03809,"14.1":0.0149,"15.1":0.00166,"15.2-15.3":0.00331,"15.4":0.00331,"15.5":0.00662,"15.6":0.10433,"16.0":0.01325,"16.1":0.03312,"16.2":0.00497,"16.3":0.11592,"16.4":0.00828,"16.5":0.00166,"16.6":0.16891,"17.0":0.00166,"17.1":0.05134,"17.2":0.01325,"17.3":0.01159,"17.4":0.0149,"17.5":0.0414,"17.6":0.17719,"18.0":0.01656,"18.1":0.0563,"18.2":0.0265,"18.3":0.59616,"18.4":0.0149},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00138,"5.0-5.1":0,"6.0-6.1":0.00413,"7.0-7.1":0.00275,"8.1-8.4":0,"9.0-9.2":0.00206,"9.3":0.00963,"10.0-10.2":0.00069,"10.3":0.01581,"11.0-11.2":0.07288,"11.3-11.4":0.00481,"12.0-12.1":0.00275,"12.2-12.5":0.06807,"13.0-13.1":0.00138,"13.2":0.00206,"13.3":0.00275,"13.4-13.7":0.00963,"14.0-14.4":0.02406,"14.5-14.8":0.02888,"15.0-15.1":0.01581,"15.2-15.3":0.01581,"15.4":0.01925,"15.5":0.022,"15.6-15.8":0.27089,"16.0":0.0385,"16.1":0.07907,"16.2":0.04125,"16.3":0.0715,"16.4":0.01581,"16.5":0.02956,"16.6-16.7":0.32108,"17.0":0.01925,"17.1":0.03438,"17.2":0.02613,"17.3":0.03644,"17.4":0.07288,"17.5":0.16226,"17.6-17.7":0.47097,"18.0":0.13201,"18.1":0.43178,"18.2":0.1932,"18.3":4.03796,"18.4":0.05982},P:{"4":0.02098,"23":0.03147,"24":0.03147,"25":0.03147,"26":0.03147,"27":1.22749,_:"20 21 22 5.0-5.4 6.2-6.4 8.2 9.2 10.1 11.1-11.2 12.0 13.0 14.0 15.0 16.0 17.0 18.0 19.0","7.2-7.4":0.05246},I:{"0":0.09992,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0.00003,"4.4":0,"4.4.3-4.4.4":0.00011},K:{"0":0.15019,_:"10 11 12 11.1 11.5 12.1"},A:{_:"6 7 8 9 10 11 5.5"},S:{_:"2.5 3.0-3.1"},J:{_:"7 10"},N:{_:"10 11"},R:{_:"0"},M:{"0":0.25866},Q:{_:"14.9"},O:{_:"0"},H:{"0":0},L:{"0":74.86388}};
|
||||
@@ -0,0 +1,85 @@
|
||||
let crypto = require('crypto')
|
||||
|
||||
let { urlAlphabet } = require('./url-alphabet/index.cjs')
|
||||
|
||||
// It is best to make fewer, larger requests to the crypto module to
|
||||
// avoid system call overhead. So, random numbers are generated in a
|
||||
// pool. The pool is a Buffer that is larger than the initial random
|
||||
// request size by this multiplier. The pool is enlarged if subsequent
|
||||
// requests exceed the maximum buffer size.
|
||||
const POOL_SIZE_MULTIPLIER = 128
|
||||
let pool, poolOffset
|
||||
|
||||
let fillPool = bytes => {
|
||||
if (!pool || pool.length < bytes) {
|
||||
pool = Buffer.allocUnsafe(bytes * POOL_SIZE_MULTIPLIER)
|
||||
crypto.randomFillSync(pool)
|
||||
poolOffset = 0
|
||||
} else if (poolOffset + bytes > pool.length) {
|
||||
crypto.randomFillSync(pool)
|
||||
poolOffset = 0
|
||||
}
|
||||
poolOffset += bytes
|
||||
}
|
||||
|
||||
let random = bytes => {
|
||||
// `|=` convert `bytes` to number to prevent `valueOf` abusing and pool pollution
|
||||
fillPool((bytes |= 0))
|
||||
return pool.subarray(poolOffset - bytes, poolOffset)
|
||||
}
|
||||
|
||||
let customRandom = (alphabet, defaultSize, getRandom) => {
|
||||
// First, a bitmask is necessary to generate the ID. The bitmask makes bytes
|
||||
// values closer to the alphabet size. The bitmask calculates the closest
|
||||
// `2^31 - 1` number, which exceeds the alphabet size.
|
||||
// For example, the bitmask for the alphabet size 30 is 31 (00011111).
|
||||
let mask = (2 << (31 - Math.clz32((alphabet.length - 1) | 1))) - 1
|
||||
// Though, the bitmask solution is not perfect since the bytes exceeding
|
||||
// the alphabet size are refused. Therefore, to reliably generate the ID,
|
||||
// the random bytes redundancy has to be satisfied.
|
||||
|
||||
// Note: every hardware random generator call is performance expensive,
|
||||
// because the system call for entropy collection takes a lot of time.
|
||||
// So, to avoid additional system calls, extra bytes are requested in advance.
|
||||
|
||||
// Next, a step determines how many random bytes to generate.
|
||||
// The number of random bytes gets decided upon the ID size, mask,
|
||||
// alphabet size, and magic number 1.6 (using 1.6 peaks at performance
|
||||
// according to benchmarks).
|
||||
let step = Math.ceil((1.6 * mask * defaultSize) / alphabet.length)
|
||||
|
||||
return (size = defaultSize) => {
|
||||
let id = ''
|
||||
while (true) {
|
||||
let bytes = getRandom(step)
|
||||
// A compact alternative for `for (let i = 0; i < step; i++)`.
|
||||
let i = step
|
||||
while (i--) {
|
||||
// Adding `|| ''` refuses a random byte that exceeds the alphabet size.
|
||||
id += alphabet[bytes[i] & mask] || ''
|
||||
if (id.length === size) return id
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let customAlphabet = (alphabet, size = 21) =>
|
||||
customRandom(alphabet, size, random)
|
||||
|
||||
let nanoid = (size = 21) => {
|
||||
// `|=` convert `size` to number to prevent `valueOf` abusing and pool pollution
|
||||
fillPool((size |= 0))
|
||||
let id = ''
|
||||
// We are reading directly from the random pool to avoid creating new array
|
||||
for (let i = poolOffset - size; i < poolOffset; i++) {
|
||||
// It is incorrect to use bytes exceeding the alphabet size.
|
||||
// The following mask reduces the random byte in the 0-255 value
|
||||
// range to the 0-63 value range. Therefore, adding hacks, such
|
||||
// as empty string fallback or magic numbers, is unneccessary because
|
||||
// the bitmask trims bytes down to the alphabet size.
|
||||
id += urlAlphabet[pool[i] & 63]
|
||||
}
|
||||
return id
|
||||
}
|
||||
|
||||
module.exports = { nanoid, customAlphabet, customRandom, urlAlphabet, random }
|
||||
@@ -0,0 +1,14 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = _classPrivateFieldGet;
|
||||
var _classApplyDescriptorGet = require("classApplyDescriptorGet");
|
||||
var _classPrivateFieldGet2 = require("classPrivateFieldGet2");
|
||||
function _classPrivateFieldGet(receiver, privateMap) {
|
||||
var descriptor = _classPrivateFieldGet2(privateMap, receiver);
|
||||
return _classApplyDescriptorGet(receiver, descriptor);
|
||||
}
|
||||
|
||||
//# sourceMappingURL=classPrivateFieldGet.js.map
|
||||
Binary file not shown.
@@ -0,0 +1 @@
|
||||
module.exports={C:{"24":0.00326,"25":0.00651,"26":0.01953,"27":0.00326,"31":0.00326,"36":0.00326,"51":0.00326,"52":0.01628,"66":0.00326,"68":0.00326,"78":0.00326,"100":0.00326,"108":0.00326,"109":0.00326,"110":0.00326,"111":0.00326,"113":0.00326,"115":0.11393,"119":0.00326,"123":0.00326,"125":0.00326,"127":0.00326,"128":0.01302,"130":0.00326,"131":0.00326,"133":0.00977,"134":0.01302,"135":0.19205,"136":0.64124,"137":0.00326,_:"2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 28 29 30 32 33 34 35 37 38 39 40 41 42 43 44 45 46 47 48 49 50 53 54 55 56 57 58 59 60 61 62 63 64 65 67 69 70 71 72 73 74 75 76 77 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 101 102 103 104 105 106 107 112 114 116 117 118 120 121 122 124 126 129 132 138 139 140 3.5 3.6"},D:{"31":0.0293,"32":0.00651,"38":0.00651,"40":0.00326,"41":0.00326,"48":0.00326,"49":0.00326,"51":0.00326,"55":0.00326,"56":0.00651,"57":0.00326,"58":0.00326,"64":0.00326,"65":0.00651,"69":0.00326,"74":0.00326,"76":0.00326,"78":0.00326,"79":0.03255,"80":0.00651,"81":0.00326,"83":0.00326,"84":0.00326,"85":0.00326,"86":0.00977,"87":0.03255,"88":0.00326,"89":0.00326,"90":0.00651,"91":0.03906,"92":0.00651,"94":0.00651,"96":0.00326,"97":0.00326,"98":0.00326,"99":0.00326,"100":0.00326,"101":0.00651,"102":0.00977,"103":0.01628,"104":0.01302,"105":0.00326,"106":0.01953,"107":0.01628,"108":0.04883,"109":0.64449,"110":0.00977,"111":0.01302,"112":0.00977,"113":0.01302,"114":0.01953,"115":0.00651,"116":0.05208,"117":0.00651,"118":0.00977,"119":0.0293,"120":0.03255,"121":0.0293,"122":0.05534,"123":0.02279,"124":0.04883,"125":0.03906,"126":0.03581,"127":0.05859,"128":0.08463,"129":0.03255,"130":0.12044,"131":0.30272,"132":0.43943,"133":7.32375,"134":13.87281,"135":0.01953,"136":0.00326,_:"4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 33 34 35 36 37 39 42 43 44 45 46 47 50 52 53 54 59 60 61 62 63 66 67 68 70 71 72 73 75 77 93 95 137 138"},F:{"46":0.00326,"87":0.01302,"88":0.00977,"94":0.00326,"95":0.01302,"114":0.00651,"116":0.12695,"117":0.53382,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 47 48 49 50 51 52 53 54 55 56 57 58 60 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 89 90 91 92 93 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 115 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"18":0.00977,"91":0.00326,"92":0.00326,"102":0.00326,"103":0.00326,"104":0.00326,"106":0.00326,"109":0.0293,"110":0.00326,"111":0.00326,"112":0.00326,"114":0.00326,"119":0.00326,"120":0.00326,"121":0.00326,"122":0.00326,"125":0.00326,"126":0.00651,"127":0.00326,"128":0.00977,"129":0.00651,"130":0.00977,"131":0.03255,"132":0.05208,"133":0.78446,"134":1.7577,_:"12 13 14 15 16 17 79 80 81 83 84 85 86 87 88 89 90 93 94 95 96 97 98 99 100 101 105 107 108 113 115 116 117 118 123 124"},E:{"7":0.00326,"8":0.09765,"14":0.00651,"15":0.00326,_:"0 4 5 6 9 10 11 12 13 3.1 3.2 7.1 10.1 11.1 12.1","5.1":0.00651,"6.1":0.00651,"9.1":0.00326,"13.1":0.00651,"14.1":0.02604,"15.1":0.00326,"15.2-15.3":0.01302,"15.4":0.00326,"15.5":0.01302,"15.6":0.07161,"16.0":0.00651,"16.1":0.01628,"16.2":0.00651,"16.3":0.02604,"16.4":0.00326,"16.5":0.01302,"16.6":0.09765,"17.0":0.00326,"17.1":0.07812,"17.2":0.00651,"17.3":0.00977,"17.4":0.01953,"17.5":0.03581,"17.6":0.13997,"18.0":0.01302,"18.1":0.04883,"18.2":0.02279,"18.3":0.56312,"18.4":0.00651},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00284,"5.0-5.1":0,"6.0-6.1":0.00852,"7.0-7.1":0.00568,"8.1-8.4":0,"9.0-9.2":0.00426,"9.3":0.01989,"10.0-10.2":0.00142,"10.3":0.03268,"11.0-11.2":0.1506,"11.3-11.4":0.00994,"12.0-12.1":0.00568,"12.2-12.5":0.14065,"13.0-13.1":0.00284,"13.2":0.00426,"13.3":0.00568,"13.4-13.7":0.01989,"14.0-14.4":0.04972,"14.5-14.8":0.05967,"15.0-15.1":0.03268,"15.2-15.3":0.03268,"15.4":0.03978,"15.5":0.04546,"15.6-15.8":0.55976,"16.0":0.07956,"16.1":0.16338,"16.2":0.08524,"16.3":0.14775,"16.4":0.03268,"16.5":0.06109,"16.6-16.7":0.66347,"17.0":0.03978,"17.1":0.07104,"17.2":0.05399,"17.3":0.0753,"17.4":0.1506,"17.5":0.33529,"17.6-17.7":0.97318,"18.0":0.27278,"18.1":0.8922,"18.2":0.39922,"18.3":8.34382,"18.4":0.1236},P:{"4":0.03078,"20":0.03078,"21":0.04104,"22":0.07181,"23":0.13337,"24":0.09233,"25":0.12311,"26":0.21544,"27":6.76067,_:"5.0-5.4 6.2-6.4 8.2 9.2 10.1 12.0","7.2-7.4":0.01026,"11.1-11.2":0.03078,"13.0":0.01026,"14.0":0.01026,"15.0":0.01026,"16.0":0.02052,"17.0":0.02052,"18.0":0.01026,"19.0":0.03078},I:{"0":0.0202,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0.00001,"4.4":0,"4.4.3-4.4.4":0.00002},K:{"0":0.32055,_:"10 11 12 11.1 11.5 12.1"},A:{"9":0.00326,"10":0.00651,"11":0.04557,_:"6 7 8 5.5"},S:{_:"2.5 3.0-3.1"},J:{_:"7 10"},N:{_:"10 11"},R:{_:"0"},M:{"0":0.29008},Q:{"14.9":0.00675},O:{"0":0.03373},H:{"0":0.01},L:{"0":46.11233}};
|
||||
Reference in New Issue
Block a user