update
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2015-2017 Evgeny Poberezkin
|
||||
|
||||
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,83 @@
|
||||
/**
|
||||
* @fileoverview Configuration applied when a user configuration extends from
|
||||
* eslint:recommended.
|
||||
* @author Nicholas C. Zakas
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
|
||||
/* eslint sort-keys: ["error", "asc"] -- Long, so make more readable */
|
||||
|
||||
/*
|
||||
* IMPORTANT!
|
||||
*
|
||||
* We cannot add a "name" property to this object because it's still used in eslintrc
|
||||
* which doesn't support the "name" property. If we add a "name" property, it will
|
||||
* cause an error.
|
||||
*/
|
||||
|
||||
module.exports = Object.freeze({
|
||||
rules: Object.freeze({
|
||||
"constructor-super": "error",
|
||||
"for-direction": "error",
|
||||
"getter-return": "error",
|
||||
"no-async-promise-executor": "error",
|
||||
"no-case-declarations": "error",
|
||||
"no-class-assign": "error",
|
||||
"no-compare-neg-zero": "error",
|
||||
"no-cond-assign": "error",
|
||||
"no-const-assign": "error",
|
||||
"no-constant-binary-expression": "error",
|
||||
"no-constant-condition": "error",
|
||||
"no-control-regex": "error",
|
||||
"no-debugger": "error",
|
||||
"no-delete-var": "error",
|
||||
"no-dupe-args": "error",
|
||||
"no-dupe-class-members": "error",
|
||||
"no-dupe-else-if": "error",
|
||||
"no-dupe-keys": "error",
|
||||
"no-duplicate-case": "error",
|
||||
"no-empty": "error",
|
||||
"no-empty-character-class": "error",
|
||||
"no-empty-pattern": "error",
|
||||
"no-empty-static-block": "error",
|
||||
"no-ex-assign": "error",
|
||||
"no-extra-boolean-cast": "error",
|
||||
"no-fallthrough": "error",
|
||||
"no-func-assign": "error",
|
||||
"no-global-assign": "error",
|
||||
"no-import-assign": "error",
|
||||
"no-invalid-regexp": "error",
|
||||
"no-irregular-whitespace": "error",
|
||||
"no-loss-of-precision": "error",
|
||||
"no-misleading-character-class": "error",
|
||||
"no-new-native-nonconstructor": "error",
|
||||
"no-nonoctal-decimal-escape": "error",
|
||||
"no-obj-calls": "error",
|
||||
"no-octal": "error",
|
||||
"no-prototype-builtins": "error",
|
||||
"no-redeclare": "error",
|
||||
"no-regex-spaces": "error",
|
||||
"no-self-assign": "error",
|
||||
"no-setter-return": "error",
|
||||
"no-shadow-restricted-names": "error",
|
||||
"no-sparse-arrays": "error",
|
||||
"no-this-before-super": "error",
|
||||
"no-undef": "error",
|
||||
"no-unexpected-multiline": "error",
|
||||
"no-unreachable": "error",
|
||||
"no-unsafe-finally": "error",
|
||||
"no-unsafe-negation": "error",
|
||||
"no-unsafe-optional-chaining": "error",
|
||||
"no-unused-labels": "error",
|
||||
"no-unused-private-class-members": "error",
|
||||
"no-unused-vars": "error",
|
||||
"no-useless-backreference": "error",
|
||||
"no-useless-catch": "error",
|
||||
"no-useless-escape": "error",
|
||||
"no-with": "error",
|
||||
"require-yield": "error",
|
||||
"use-isnan": "error",
|
||||
"valid-typeof": "error",
|
||||
}),
|
||||
});
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"names":["setFunctionName","fn","name","prefix","description","Object","defineProperty","configurable","value","_"],"sources":["../../src/helpers/setFunctionName.ts"],"sourcesContent":["/* @minVersion 7.23.6 */\n\n// https://tc39.es/ecma262/#sec-setfunctionname\nexport default function setFunctionName<T extends Function>(\n fn: T,\n name: symbol | string,\n prefix?: string,\n): T {\n if (typeof name === \"symbol\") {\n // Here `undefined` is possible, we check for it in the next line.\n name = name.description!;\n name = name ? \"[\" + name + \"]\" : \"\";\n }\n // In some older browsers .name was non-configurable, here we catch any\n // errors thrown by defineProperty.\n try {\n Object.defineProperty(fn, \"name\", {\n configurable: true,\n value: prefix ? prefix + \" \" + name : name,\n });\n } catch (_) {}\n return fn;\n}\n"],"mappings":";;;;;;AAGe,SAASA,eAAeA,CACrCC,EAAK,EACLC,IAAqB,EACrBC,MAAe,EACZ;EACH,IAAI,OAAOD,IAAI,KAAK,QAAQ,EAAE;IAE5BA,IAAI,GAAGA,IAAI,CAACE,WAAY;IACxBF,IAAI,GAAGA,IAAI,GAAG,GAAG,GAAGA,IAAI,GAAG,GAAG,GAAG,EAAE;EACrC;EAGA,IAAI;IACFG,MAAM,CAACC,cAAc,CAACL,EAAE,EAAE,MAAM,EAAE;MAChCM,YAAY,EAAE,IAAI;MAClBC,KAAK,EAAEL,MAAM,GAAGA,MAAM,GAAG,GAAG,GAAGD,IAAI,GAAGA;IACxC,CAAC,CAAC;EACJ,CAAC,CAAC,OAAOO,CAAC,EAAE,CAAC;EACb,OAAOR,EAAE;AACX","ignoreList":[]}
|
||||
@@ -0,0 +1,16 @@
|
||||
import { AnyRouter, Constrain, InferFrom, InferMaskFrom, InferMaskTo, InferSelected, InferShouldThrow, InferStrict, InferTo, RegisteredRouter } from '@tanstack/router-core';
|
||||
import { LinkComponentProps } from './link.cjs';
|
||||
import { UseParamsOptions } from './useParams.cjs';
|
||||
import { UseSearchOptions } from './useSearch.cjs';
|
||||
export type ValidateLinkOptions<TRouter extends AnyRouter = RegisteredRouter, TOptions = unknown, TDefaultFrom extends string = string, TComp = 'a'> = Constrain<TOptions, LinkComponentProps<TComp, TRouter, InferFrom<TOptions, TDefaultFrom>, InferTo<TOptions>, InferMaskFrom<TOptions>, InferMaskTo<TOptions>>>;
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export type InferStructuralSharing<TOptions> = TOptions extends {
|
||||
structuralSharing: infer TStructuralSharing;
|
||||
} ? TStructuralSharing : unknown;
|
||||
export type ValidateUseSearchOptions<TOptions, TRouter extends AnyRouter = RegisteredRouter> = Constrain<TOptions, UseSearchOptions<TRouter, InferFrom<TOptions>, InferStrict<TOptions>, InferShouldThrow<TOptions>, InferSelected<TOptions>, InferStructuralSharing<TOptions>>>;
|
||||
export type ValidateUseParamsOptions<TOptions, TRouter extends AnyRouter = RegisteredRouter> = Constrain<TOptions, UseParamsOptions<TRouter, InferFrom<TOptions>, InferStrict<TOptions>, InferShouldThrow<TOptions>, InferSelected<TOptions>, InferSelected<TOptions>>>;
|
||||
export type ValidateLinkOptionsArray<TRouter extends AnyRouter = RegisteredRouter, TOptions extends ReadonlyArray<any> = ReadonlyArray<unknown>, TDefaultFrom extends string = string, TComp = 'a'> = {
|
||||
[K in keyof TOptions]: ValidateLinkOptions<TRouter, TOptions[K], TDefaultFrom, TComp>;
|
||||
};
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"2":"K D E F A B mC"},B:{"2":"0 9 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 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"},C:{"1":"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","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 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":"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","2":"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 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:{"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":"6 7 8 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","2":"0 F B C G N O P QB 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 4C 5C 6C 7C FC kC 8C GC","4":"4","16":"1 2 3 5"},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:{"2":"LC J I XD YD ZD aD lC bD cD"},J:{"2":"D A"},K:{"2":"A B C H FC kC GC"},L:{"2":"I"},M:{"2":"EC"},N:{"2":"A B"},O:{"2":"HC"},P:{"1":"J dD eD fD gD hD TC","2":"1 2 3 4 5 6 7 8 iD jD kD lD mD IC JC KC nD"},Q:{"2":"oD"},R:{"2":"pD"},S:{"1":"qD","2":"rD"}},B:6,C:"HTTP Public Key Pinning",D:true};
|
||||
@@ -0,0 +1,81 @@
|
||||
{
|
||||
"name": "@babel/core",
|
||||
"version": "7.26.10",
|
||||
"description": "Babel compiler core.",
|
||||
"main": "./lib/index.js",
|
||||
"author": "The Babel Team (https://babel.dev/team)",
|
||||
"license": "MIT",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/babel/babel.git",
|
||||
"directory": "packages/babel-core"
|
||||
},
|
||||
"homepage": "https://babel.dev/docs/en/next/babel-core",
|
||||
"bugs": "https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22pkg%3A%20core%22+is%3Aopen",
|
||||
"keywords": [
|
||||
"6to5",
|
||||
"babel",
|
||||
"classes",
|
||||
"const",
|
||||
"es6",
|
||||
"harmony",
|
||||
"let",
|
||||
"modules",
|
||||
"transpile",
|
||||
"transpiler",
|
||||
"var",
|
||||
"babel-core",
|
||||
"compiler"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/babel"
|
||||
},
|
||||
"browser": {
|
||||
"./lib/config/files/index.js": "./lib/config/files/index-browser.js",
|
||||
"./lib/config/resolve-targets.js": "./lib/config/resolve-targets-browser.js",
|
||||
"./lib/transform-file.js": "./lib/transform-file-browser.js",
|
||||
"./src/config/files/index.ts": "./src/config/files/index-browser.ts",
|
||||
"./src/config/resolve-targets.ts": "./src/config/resolve-targets-browser.ts",
|
||||
"./src/transform-file.ts": "./src/transform-file-browser.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@ampproject/remapping": "^2.2.0",
|
||||
"@babel/code-frame": "^7.26.2",
|
||||
"@babel/generator": "^7.26.10",
|
||||
"@babel/helper-compilation-targets": "^7.26.5",
|
||||
"@babel/helper-module-transforms": "^7.26.0",
|
||||
"@babel/helpers": "^7.26.10",
|
||||
"@babel/parser": "^7.26.10",
|
||||
"@babel/template": "^7.26.9",
|
||||
"@babel/traverse": "^7.26.10",
|
||||
"@babel/types": "^7.26.10",
|
||||
"convert-source-map": "^2.0.0",
|
||||
"debug": "^4.1.0",
|
||||
"gensync": "^1.0.0-beta.2",
|
||||
"json5": "^2.2.3",
|
||||
"semver": "^6.3.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/helper-transform-fixture-test-runner": "^7.26.5",
|
||||
"@babel/plugin-syntax-flow": "^7.26.0",
|
||||
"@babel/plugin-transform-flow-strip-types": "^7.26.5",
|
||||
"@babel/plugin-transform-modules-commonjs": "^7.26.3",
|
||||
"@babel/preset-env": "^7.26.9",
|
||||
"@babel/preset-typescript": "^7.26.0",
|
||||
"@jridgewell/trace-mapping": "^0.3.25",
|
||||
"@types/convert-source-map": "^2.0.0",
|
||||
"@types/debug": "^4.1.0",
|
||||
"@types/resolve": "^1.3.2",
|
||||
"@types/semver": "^5.4.0",
|
||||
"rimraf": "^3.0.0",
|
||||
"ts-node": "^11.0.0-beta.1"
|
||||
},
|
||||
"type": "commonjs"
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
/**
|
||||
* @license React
|
||||
* use-sync-external-store-shim.development.js
|
||||
*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
"production" !== process.env.NODE_ENV &&
|
||||
(function () {
|
||||
function is(x, y) {
|
||||
return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);
|
||||
}
|
||||
function useSyncExternalStore$2(subscribe, getSnapshot) {
|
||||
didWarnOld18Alpha ||
|
||||
void 0 === React.startTransition ||
|
||||
((didWarnOld18Alpha = !0),
|
||||
console.error(
|
||||
"You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."
|
||||
));
|
||||
var value = getSnapshot();
|
||||
if (!didWarnUncachedGetSnapshot) {
|
||||
var cachedValue = getSnapshot();
|
||||
objectIs(value, cachedValue) ||
|
||||
(console.error(
|
||||
"The result of getSnapshot should be cached to avoid an infinite loop"
|
||||
),
|
||||
(didWarnUncachedGetSnapshot = !0));
|
||||
}
|
||||
cachedValue = useState({
|
||||
inst: { value: value, getSnapshot: getSnapshot }
|
||||
});
|
||||
var inst = cachedValue[0].inst,
|
||||
forceUpdate = cachedValue[1];
|
||||
useLayoutEffect(
|
||||
function () {
|
||||
inst.value = value;
|
||||
inst.getSnapshot = getSnapshot;
|
||||
checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });
|
||||
},
|
||||
[subscribe, value, getSnapshot]
|
||||
);
|
||||
useEffect(
|
||||
function () {
|
||||
checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });
|
||||
return subscribe(function () {
|
||||
checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });
|
||||
});
|
||||
},
|
||||
[subscribe]
|
||||
);
|
||||
useDebugValue(value);
|
||||
return value;
|
||||
}
|
||||
function checkIfSnapshotChanged(inst) {
|
||||
var latestGetSnapshot = inst.getSnapshot;
|
||||
inst = inst.value;
|
||||
try {
|
||||
var nextValue = latestGetSnapshot();
|
||||
return !objectIs(inst, nextValue);
|
||||
} catch (error) {
|
||||
return !0;
|
||||
}
|
||||
}
|
||||
function useSyncExternalStore$1(subscribe, getSnapshot) {
|
||||
return getSnapshot();
|
||||
}
|
||||
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
|
||||
"function" ===
|
||||
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart &&
|
||||
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
||||
var React = require("react"),
|
||||
objectIs = "function" === typeof Object.is ? Object.is : is,
|
||||
useState = React.useState,
|
||||
useEffect = React.useEffect,
|
||||
useLayoutEffect = React.useLayoutEffect,
|
||||
useDebugValue = React.useDebugValue,
|
||||
didWarnOld18Alpha = !1,
|
||||
didWarnUncachedGetSnapshot = !1,
|
||||
shim =
|
||||
"undefined" === typeof window ||
|
||||
"undefined" === typeof window.document ||
|
||||
"undefined" === typeof window.document.createElement
|
||||
? useSyncExternalStore$1
|
||||
: useSyncExternalStore$2;
|
||||
exports.useSyncExternalStore =
|
||||
void 0 !== React.useSyncExternalStore ? React.useSyncExternalStore : shim;
|
||||
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
|
||||
"function" ===
|
||||
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
|
||||
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
||||
})();
|
||||
@@ -0,0 +1,433 @@
|
||||
const reduxImpl = (reducer, initial) => (set, _get, api) => {
|
||||
api.dispatch = (action) => {
|
||||
set((state) => reducer(state, action), false, action);
|
||||
return action;
|
||||
};
|
||||
api.dispatchFromDevtools = true;
|
||||
return { dispatch: (...a) => api.dispatch(...a), ...initial };
|
||||
};
|
||||
const redux = reduxImpl;
|
||||
|
||||
const trackedConnections = /* @__PURE__ */ new Map();
|
||||
const getTrackedConnectionState = (name) => {
|
||||
const api = trackedConnections.get(name);
|
||||
if (!api) return {};
|
||||
return Object.fromEntries(
|
||||
Object.entries(api.stores).map(([key, api2]) => [key, api2.getState()])
|
||||
);
|
||||
};
|
||||
const extractConnectionInformation = (store, extensionConnector, options) => {
|
||||
if (store === undefined) {
|
||||
return {
|
||||
type: "untracked",
|
||||
connection: extensionConnector.connect(options)
|
||||
};
|
||||
}
|
||||
const existingConnection = trackedConnections.get(options.name);
|
||||
if (existingConnection) {
|
||||
return { type: "tracked", store, ...existingConnection };
|
||||
}
|
||||
const newConnection = {
|
||||
connection: extensionConnector.connect(options),
|
||||
stores: {}
|
||||
};
|
||||
trackedConnections.set(options.name, newConnection);
|
||||
return { type: "tracked", store, ...newConnection };
|
||||
};
|
||||
const devtoolsImpl = (fn, devtoolsOptions = {}) => (set, get, api) => {
|
||||
const { enabled, anonymousActionType, store, ...options } = devtoolsOptions;
|
||||
let extensionConnector;
|
||||
try {
|
||||
extensionConnector = (enabled != null ? enabled : (import.meta.env ? import.meta.env.MODE : void 0) !== "production") && window.__REDUX_DEVTOOLS_EXTENSION__;
|
||||
} catch (e) {
|
||||
}
|
||||
if (!extensionConnector) {
|
||||
return fn(set, get, api);
|
||||
}
|
||||
const { connection, ...connectionInformation } = extractConnectionInformation(store, extensionConnector, options);
|
||||
let isRecording = true;
|
||||
api.setState = (state, replace, nameOrAction) => {
|
||||
const r = set(state, replace);
|
||||
if (!isRecording) return r;
|
||||
const action = nameOrAction === undefined ? { type: anonymousActionType || "anonymous" } : typeof nameOrAction === "string" ? { type: nameOrAction } : nameOrAction;
|
||||
if (store === undefined) {
|
||||
connection == null ? undefined : connection.send(action, get());
|
||||
return r;
|
||||
}
|
||||
connection == null ? undefined : connection.send(
|
||||
{
|
||||
...action,
|
||||
type: `${store}/${action.type}`
|
||||
},
|
||||
{
|
||||
...getTrackedConnectionState(options.name),
|
||||
[store]: api.getState()
|
||||
}
|
||||
);
|
||||
return r;
|
||||
};
|
||||
const setStateFromDevtools = (...a) => {
|
||||
const originalIsRecording = isRecording;
|
||||
isRecording = false;
|
||||
set(...a);
|
||||
isRecording = originalIsRecording;
|
||||
};
|
||||
const initialState = fn(api.setState, get, api);
|
||||
if (connectionInformation.type === "untracked") {
|
||||
connection == null ? undefined : connection.init(initialState);
|
||||
} else {
|
||||
connectionInformation.stores[connectionInformation.store] = api;
|
||||
connection == null ? undefined : connection.init(
|
||||
Object.fromEntries(
|
||||
Object.entries(connectionInformation.stores).map(([key, store2]) => [
|
||||
key,
|
||||
key === connectionInformation.store ? initialState : store2.getState()
|
||||
])
|
||||
)
|
||||
);
|
||||
}
|
||||
if (api.dispatchFromDevtools && typeof api.dispatch === "function") {
|
||||
let didWarnAboutReservedActionType = false;
|
||||
const originalDispatch = api.dispatch;
|
||||
api.dispatch = (...a) => {
|
||||
if ((import.meta.env ? import.meta.env.MODE : undefined) !== "production" && a[0].type === "__setState" && !didWarnAboutReservedActionType) {
|
||||
console.warn(
|
||||
'[zustand devtools middleware] "__setState" action type is reserved to set state from the devtools. Avoid using it.'
|
||||
);
|
||||
didWarnAboutReservedActionType = true;
|
||||
}
|
||||
originalDispatch(...a);
|
||||
};
|
||||
}
|
||||
connection.subscribe((message) => {
|
||||
var _a;
|
||||
switch (message.type) {
|
||||
case "ACTION":
|
||||
if (typeof message.payload !== "string") {
|
||||
console.error(
|
||||
"[zustand devtools middleware] Unsupported action format"
|
||||
);
|
||||
return;
|
||||
}
|
||||
return parseJsonThen(
|
||||
message.payload,
|
||||
(action) => {
|
||||
if (action.type === "__setState") {
|
||||
if (store === undefined) {
|
||||
setStateFromDevtools(action.state);
|
||||
return;
|
||||
}
|
||||
if (Object.keys(action.state).length !== 1) {
|
||||
console.error(
|
||||
`
|
||||
[zustand devtools middleware] Unsupported __setState action format.
|
||||
When using 'store' option in devtools(), the 'state' should have only one key, which is a value of 'store' that was passed in devtools(),
|
||||
and value of this only key should be a state object. Example: { "type": "__setState", "state": { "abc123Store": { "foo": "bar" } } }
|
||||
`
|
||||
);
|
||||
}
|
||||
const stateFromDevtools = action.state[store];
|
||||
if (stateFromDevtools === undefined || stateFromDevtools === null) {
|
||||
return;
|
||||
}
|
||||
if (JSON.stringify(api.getState()) !== JSON.stringify(stateFromDevtools)) {
|
||||
setStateFromDevtools(stateFromDevtools);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (!api.dispatchFromDevtools) return;
|
||||
if (typeof api.dispatch !== "function") return;
|
||||
api.dispatch(action);
|
||||
}
|
||||
);
|
||||
case "DISPATCH":
|
||||
switch (message.payload.type) {
|
||||
case "RESET":
|
||||
setStateFromDevtools(initialState);
|
||||
if (store === undefined) {
|
||||
return connection == null ? undefined : connection.init(api.getState());
|
||||
}
|
||||
return connection == null ? undefined : connection.init(getTrackedConnectionState(options.name));
|
||||
case "COMMIT":
|
||||
if (store === undefined) {
|
||||
connection == null ? undefined : connection.init(api.getState());
|
||||
return;
|
||||
}
|
||||
return connection == null ? undefined : connection.init(getTrackedConnectionState(options.name));
|
||||
case "ROLLBACK":
|
||||
return parseJsonThen(message.state, (state) => {
|
||||
if (store === undefined) {
|
||||
setStateFromDevtools(state);
|
||||
connection == null ? undefined : connection.init(api.getState());
|
||||
return;
|
||||
}
|
||||
setStateFromDevtools(state[store]);
|
||||
connection == null ? undefined : connection.init(getTrackedConnectionState(options.name));
|
||||
});
|
||||
case "JUMP_TO_STATE":
|
||||
case "JUMP_TO_ACTION":
|
||||
return parseJsonThen(message.state, (state) => {
|
||||
if (store === undefined) {
|
||||
setStateFromDevtools(state);
|
||||
return;
|
||||
}
|
||||
if (JSON.stringify(api.getState()) !== JSON.stringify(state[store])) {
|
||||
setStateFromDevtools(state[store]);
|
||||
}
|
||||
});
|
||||
case "IMPORT_STATE": {
|
||||
const { nextLiftedState } = message.payload;
|
||||
const lastComputedState = (_a = nextLiftedState.computedStates.slice(-1)[0]) == null ? undefined : _a.state;
|
||||
if (!lastComputedState) return;
|
||||
if (store === undefined) {
|
||||
setStateFromDevtools(lastComputedState);
|
||||
} else {
|
||||
setStateFromDevtools(lastComputedState[store]);
|
||||
}
|
||||
connection == null ? undefined : connection.send(
|
||||
null,
|
||||
// FIXME no-any
|
||||
nextLiftedState
|
||||
);
|
||||
return;
|
||||
}
|
||||
case "PAUSE_RECORDING":
|
||||
return isRecording = !isRecording;
|
||||
}
|
||||
return;
|
||||
}
|
||||
});
|
||||
return initialState;
|
||||
};
|
||||
const devtools = devtoolsImpl;
|
||||
const parseJsonThen = (stringified, f) => {
|
||||
let parsed;
|
||||
try {
|
||||
parsed = JSON.parse(stringified);
|
||||
} catch (e) {
|
||||
console.error(
|
||||
"[zustand devtools middleware] Could not parse the received json",
|
||||
e
|
||||
);
|
||||
}
|
||||
if (parsed !== undefined) f(parsed);
|
||||
};
|
||||
|
||||
const subscribeWithSelectorImpl = (fn) => (set, get, api) => {
|
||||
const origSubscribe = api.subscribe;
|
||||
api.subscribe = (selector, optListener, options) => {
|
||||
let listener = selector;
|
||||
if (optListener) {
|
||||
const equalityFn = (options == null ? undefined : options.equalityFn) || Object.is;
|
||||
let currentSlice = selector(api.getState());
|
||||
listener = (state) => {
|
||||
const nextSlice = selector(state);
|
||||
if (!equalityFn(currentSlice, nextSlice)) {
|
||||
const previousSlice = currentSlice;
|
||||
optListener(currentSlice = nextSlice, previousSlice);
|
||||
}
|
||||
};
|
||||
if (options == null ? undefined : options.fireImmediately) {
|
||||
optListener(currentSlice, currentSlice);
|
||||
}
|
||||
}
|
||||
return origSubscribe(listener);
|
||||
};
|
||||
const initialState = fn(set, get, api);
|
||||
return initialState;
|
||||
};
|
||||
const subscribeWithSelector = subscribeWithSelectorImpl;
|
||||
|
||||
const combine = (initialState, create) => (...a) => Object.assign({}, initialState, create(...a));
|
||||
|
||||
function createJSONStorage(getStorage, options) {
|
||||
let storage;
|
||||
try {
|
||||
storage = getStorage();
|
||||
} catch (e) {
|
||||
return;
|
||||
}
|
||||
const persistStorage = {
|
||||
getItem: (name) => {
|
||||
var _a;
|
||||
const parse = (str2) => {
|
||||
if (str2 === null) {
|
||||
return null;
|
||||
}
|
||||
return JSON.parse(str2, options == null ? undefined : options.reviver);
|
||||
};
|
||||
const str = (_a = storage.getItem(name)) != null ? _a : null;
|
||||
if (str instanceof Promise) {
|
||||
return str.then(parse);
|
||||
}
|
||||
return parse(str);
|
||||
},
|
||||
setItem: (name, newValue) => storage.setItem(
|
||||
name,
|
||||
JSON.stringify(newValue, options == null ? undefined : options.replacer)
|
||||
),
|
||||
removeItem: (name) => storage.removeItem(name)
|
||||
};
|
||||
return persistStorage;
|
||||
}
|
||||
const toThenable = (fn) => (input) => {
|
||||
try {
|
||||
const result = fn(input);
|
||||
if (result instanceof Promise) {
|
||||
return result;
|
||||
}
|
||||
return {
|
||||
then(onFulfilled) {
|
||||
return toThenable(onFulfilled)(result);
|
||||
},
|
||||
catch(_onRejected) {
|
||||
return this;
|
||||
}
|
||||
};
|
||||
} catch (e) {
|
||||
return {
|
||||
then(_onFulfilled) {
|
||||
return this;
|
||||
},
|
||||
catch(onRejected) {
|
||||
return toThenable(onRejected)(e);
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
const persistImpl = (config, baseOptions) => (set, get, api) => {
|
||||
let options = {
|
||||
storage: createJSONStorage(() => localStorage),
|
||||
partialize: (state) => state,
|
||||
version: 0,
|
||||
merge: (persistedState, currentState) => ({
|
||||
...currentState,
|
||||
...persistedState
|
||||
}),
|
||||
...baseOptions
|
||||
};
|
||||
let hasHydrated = false;
|
||||
const hydrationListeners = /* @__PURE__ */ new Set();
|
||||
const finishHydrationListeners = /* @__PURE__ */ new Set();
|
||||
let storage = options.storage;
|
||||
if (!storage) {
|
||||
return config(
|
||||
(...args) => {
|
||||
console.warn(
|
||||
`[zustand persist middleware] Unable to update item '${options.name}', the given storage is currently unavailable.`
|
||||
);
|
||||
set(...args);
|
||||
},
|
||||
get,
|
||||
api
|
||||
);
|
||||
}
|
||||
const setItem = () => {
|
||||
const state = options.partialize({ ...get() });
|
||||
return storage.setItem(options.name, {
|
||||
state,
|
||||
version: options.version
|
||||
});
|
||||
};
|
||||
const savedSetState = api.setState;
|
||||
api.setState = (state, replace) => {
|
||||
savedSetState(state, replace);
|
||||
void setItem();
|
||||
};
|
||||
const configResult = config(
|
||||
(...args) => {
|
||||
set(...args);
|
||||
void setItem();
|
||||
},
|
||||
get,
|
||||
api
|
||||
);
|
||||
api.getInitialState = () => configResult;
|
||||
let stateFromStorage;
|
||||
const hydrate = () => {
|
||||
var _a, _b;
|
||||
if (!storage) return;
|
||||
hasHydrated = false;
|
||||
hydrationListeners.forEach((cb) => {
|
||||
var _a2;
|
||||
return cb((_a2 = get()) != null ? _a2 : configResult);
|
||||
});
|
||||
const postRehydrationCallback = ((_b = options.onRehydrateStorage) == null ? undefined : _b.call(options, (_a = get()) != null ? _a : configResult)) || undefined;
|
||||
return toThenable(storage.getItem.bind(storage))(options.name).then((deserializedStorageValue) => {
|
||||
if (deserializedStorageValue) {
|
||||
if (typeof deserializedStorageValue.version === "number" && deserializedStorageValue.version !== options.version) {
|
||||
if (options.migrate) {
|
||||
const migration = options.migrate(
|
||||
deserializedStorageValue.state,
|
||||
deserializedStorageValue.version
|
||||
);
|
||||
if (migration instanceof Promise) {
|
||||
return migration.then((result) => [true, result]);
|
||||
}
|
||||
return [true, migration];
|
||||
}
|
||||
console.error(
|
||||
`State loaded from storage couldn't be migrated since no migrate function was provided`
|
||||
);
|
||||
} else {
|
||||
return [false, deserializedStorageValue.state];
|
||||
}
|
||||
}
|
||||
return [false, undefined];
|
||||
}).then((migrationResult) => {
|
||||
var _a2;
|
||||
const [migrated, migratedState] = migrationResult;
|
||||
stateFromStorage = options.merge(
|
||||
migratedState,
|
||||
(_a2 = get()) != null ? _a2 : configResult
|
||||
);
|
||||
set(stateFromStorage, true);
|
||||
if (migrated) {
|
||||
return setItem();
|
||||
}
|
||||
}).then(() => {
|
||||
postRehydrationCallback == null ? undefined : postRehydrationCallback(stateFromStorage, undefined);
|
||||
stateFromStorage = get();
|
||||
hasHydrated = true;
|
||||
finishHydrationListeners.forEach((cb) => cb(stateFromStorage));
|
||||
}).catch((e) => {
|
||||
postRehydrationCallback == null ? undefined : postRehydrationCallback(undefined, e);
|
||||
});
|
||||
};
|
||||
api.persist = {
|
||||
setOptions: (newOptions) => {
|
||||
options = {
|
||||
...options,
|
||||
...newOptions
|
||||
};
|
||||
if (newOptions.storage) {
|
||||
storage = newOptions.storage;
|
||||
}
|
||||
},
|
||||
clearStorage: () => {
|
||||
storage == null ? undefined : storage.removeItem(options.name);
|
||||
},
|
||||
getOptions: () => options,
|
||||
rehydrate: () => hydrate(),
|
||||
hasHydrated: () => hasHydrated,
|
||||
onHydrate: (cb) => {
|
||||
hydrationListeners.add(cb);
|
||||
return () => {
|
||||
hydrationListeners.delete(cb);
|
||||
};
|
||||
},
|
||||
onFinishHydration: (cb) => {
|
||||
finishHydrationListeners.add(cb);
|
||||
return () => {
|
||||
finishHydrationListeners.delete(cb);
|
||||
};
|
||||
}
|
||||
};
|
||||
if (!options.skipHydration) {
|
||||
hydrate();
|
||||
}
|
||||
return stateFromStorage || configResult;
|
||||
};
|
||||
const persist = persistImpl;
|
||||
|
||||
export { combine, createJSONStorage, devtools, persist, redux, subscribeWithSelector };
|
||||
@@ -0,0 +1,59 @@
|
||||
# ms
|
||||
|
||||

|
||||
|
||||
Use this package to easily convert various time formats to milliseconds.
|
||||
|
||||
## Examples
|
||||
|
||||
```js
|
||||
ms('2 days') // 172800000
|
||||
ms('1d') // 86400000
|
||||
ms('10h') // 36000000
|
||||
ms('2.5 hrs') // 9000000
|
||||
ms('2h') // 7200000
|
||||
ms('1m') // 60000
|
||||
ms('5s') // 5000
|
||||
ms('1y') // 31557600000
|
||||
ms('100') // 100
|
||||
ms('-3 days') // -259200000
|
||||
ms('-1h') // -3600000
|
||||
ms('-200') // -200
|
||||
```
|
||||
|
||||
### Convert from Milliseconds
|
||||
|
||||
```js
|
||||
ms(60000) // "1m"
|
||||
ms(2 * 60000) // "2m"
|
||||
ms(-3 * 60000) // "-3m"
|
||||
ms(ms('10 hours')) // "10h"
|
||||
```
|
||||
|
||||
### Time Format Written-Out
|
||||
|
||||
```js
|
||||
ms(60000, { long: true }) // "1 minute"
|
||||
ms(2 * 60000, { long: true }) // "2 minutes"
|
||||
ms(-3 * 60000, { long: true }) // "-3 minutes"
|
||||
ms(ms('10 hours'), { long: true }) // "10 hours"
|
||||
```
|
||||
|
||||
## Features
|
||||
|
||||
- Works both in [Node.js](https://nodejs.org) and in the browser
|
||||
- If a number is supplied to `ms`, a string with a unit is returned
|
||||
- If a string that contains the number is supplied, it returns it as a number (e.g.: it returns `100` for `'100'`)
|
||||
- If you pass a string with a number and a valid unit, the number of equivalent milliseconds is returned
|
||||
|
||||
## Related Packages
|
||||
|
||||
- [ms.macro](https://github.com/knpwrs/ms.macro) - Run `ms` as a macro at build-time.
|
||||
|
||||
## Caught a Bug?
|
||||
|
||||
1. [Fork](https://help.github.com/articles/fork-a-repo/) this repository to your own GitHub account and then [clone](https://help.github.com/articles/cloning-a-repository/) it to your local device
|
||||
2. Link the package to the global module directory: `npm link`
|
||||
3. Within the module you want to test your local development instance of ms, just link it to the dependencies: `npm link ms`. Instead of the default one from npm, Node.js will now use your clone of ms!
|
||||
|
||||
As always, you can run the tests using: `npm test`
|
||||
@@ -0,0 +1,50 @@
|
||||
{
|
||||
"name": "@tanstack/store",
|
||||
"version": "0.7.0",
|
||||
"description": "Framework agnostic type-safe store w/ reactive framework adapters",
|
||||
"author": "Tanner Linsley",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/TanStack/store.git",
|
||||
"directory": "packages/store"
|
||||
},
|
||||
"homepage": "https://tanstack.com/store",
|
||||
"funding": {
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/tannerlinsley"
|
||||
},
|
||||
"keywords": [
|
||||
"store",
|
||||
"typescript"
|
||||
],
|
||||
"type": "module",
|
||||
"types": "dist/esm/index.d.ts",
|
||||
"main": "dist/cjs/index.cjs",
|
||||
"module": "dist/esm/index.js",
|
||||
"exports": {
|
||||
".": {
|
||||
"import": {
|
||||
"types": "./dist/esm/index.d.ts",
|
||||
"default": "./dist/esm/index.js"
|
||||
},
|
||||
"require": {
|
||||
"types": "./dist/cjs/index.d.cts",
|
||||
"default": "./dist/cjs/index.cjs"
|
||||
}
|
||||
},
|
||||
"./package.json": "./package.json"
|
||||
},
|
||||
"sideEffects": false,
|
||||
"files": [
|
||||
"dist",
|
||||
"src"
|
||||
],
|
||||
"devDependencies": {
|
||||
"@angular/core": "^19.0.5",
|
||||
"@preact/signals": "^1.3.0",
|
||||
"solid-js": "^1.9.3",
|
||||
"vue": "^3.5.13"
|
||||
},
|
||||
"scripts": {}
|
||||
}
|
||||
@@ -0,0 +1,119 @@
|
||||
import { jsx, jsxs } from "react/jsx-runtime";
|
||||
import * as React from "react";
|
||||
import warning from "tiny-warning";
|
||||
import { CatchBoundary, ErrorComponent } from "./CatchBoundary.js";
|
||||
import { useRouterState } from "./useRouterState.js";
|
||||
import { useRouter } from "./useRouter.js";
|
||||
import { Transitioner } from "./Transitioner.js";
|
||||
import { matchContext } from "./matchContext.js";
|
||||
import { Match } from "./Match.js";
|
||||
import { SafeFragment } from "./SafeFragment.js";
|
||||
function Matches() {
|
||||
const router = useRouter();
|
||||
const pendingElement = router.options.defaultPendingComponent ? /* @__PURE__ */ jsx(router.options.defaultPendingComponent, {}) : null;
|
||||
const ResolvedSuspense = router.isServer || typeof document !== "undefined" && router.clientSsr ? SafeFragment : React.Suspense;
|
||||
const inner = /* @__PURE__ */ jsxs(ResolvedSuspense, { fallback: pendingElement, children: [
|
||||
/* @__PURE__ */ jsx(Transitioner, {}),
|
||||
/* @__PURE__ */ jsx(MatchesInner, {})
|
||||
] });
|
||||
return router.options.InnerWrap ? /* @__PURE__ */ jsx(router.options.InnerWrap, { children: inner }) : inner;
|
||||
}
|
||||
function MatchesInner() {
|
||||
const matchId = useRouterState({
|
||||
select: (s) => {
|
||||
var _a;
|
||||
return (_a = s.matches[0]) == null ? void 0 : _a.id;
|
||||
}
|
||||
});
|
||||
const resetKey = useRouterState({
|
||||
select: (s) => s.loadedAt
|
||||
});
|
||||
return /* @__PURE__ */ jsx(matchContext.Provider, { value: matchId, children: /* @__PURE__ */ jsx(
|
||||
CatchBoundary,
|
||||
{
|
||||
getResetKey: () => resetKey,
|
||||
errorComponent: ErrorComponent,
|
||||
onCatch: (error) => {
|
||||
warning(
|
||||
false,
|
||||
`The following error wasn't caught by any route! At the very least, consider setting an 'errorComponent' in your RootRoute!`
|
||||
);
|
||||
warning(false, error.message || error.toString());
|
||||
},
|
||||
children: matchId ? /* @__PURE__ */ jsx(Match, { matchId }) : null
|
||||
}
|
||||
) });
|
||||
}
|
||||
function useMatchRoute() {
|
||||
const router = useRouter();
|
||||
useRouterState({
|
||||
select: (s) => {
|
||||
var _a;
|
||||
return [s.location.href, (_a = s.resolvedLocation) == null ? void 0 : _a.href, s.status];
|
||||
},
|
||||
structuralSharing: true
|
||||
});
|
||||
return React.useCallback(
|
||||
(opts) => {
|
||||
const { pending, caseSensitive, fuzzy, includeSearch, ...rest } = opts;
|
||||
return router.matchRoute(rest, {
|
||||
pending,
|
||||
caseSensitive,
|
||||
fuzzy,
|
||||
includeSearch
|
||||
});
|
||||
},
|
||||
[router]
|
||||
);
|
||||
}
|
||||
function MatchRoute(props) {
|
||||
const matchRoute = useMatchRoute();
|
||||
const params = matchRoute(props);
|
||||
if (typeof props.children === "function") {
|
||||
return props.children(params);
|
||||
}
|
||||
return params ? props.children : null;
|
||||
}
|
||||
function useMatches(opts) {
|
||||
return useRouterState({
|
||||
select: (state) => {
|
||||
const matches = state.matches;
|
||||
return (opts == null ? void 0 : opts.select) ? opts.select(matches) : matches;
|
||||
},
|
||||
structuralSharing: opts == null ? void 0 : opts.structuralSharing
|
||||
});
|
||||
}
|
||||
function useParentMatches(opts) {
|
||||
const contextMatchId = React.useContext(matchContext);
|
||||
return useMatches({
|
||||
select: (matches) => {
|
||||
matches = matches.slice(
|
||||
0,
|
||||
matches.findIndex((d) => d.id === contextMatchId)
|
||||
);
|
||||
return (opts == null ? void 0 : opts.select) ? opts.select(matches) : matches;
|
||||
},
|
||||
structuralSharing: opts == null ? void 0 : opts.structuralSharing
|
||||
});
|
||||
}
|
||||
function useChildMatches(opts) {
|
||||
const contextMatchId = React.useContext(matchContext);
|
||||
return useMatches({
|
||||
select: (matches) => {
|
||||
matches = matches.slice(
|
||||
matches.findIndex((d) => d.id === contextMatchId) + 1
|
||||
);
|
||||
return (opts == null ? void 0 : opts.select) ? opts.select(matches) : matches;
|
||||
},
|
||||
structuralSharing: opts == null ? void 0 : opts.structuralSharing
|
||||
});
|
||||
}
|
||||
export {
|
||||
MatchRoute,
|
||||
Matches,
|
||||
useChildMatches,
|
||||
useMatchRoute,
|
||||
useMatches,
|
||||
useParentMatches
|
||||
};
|
||||
//# sourceMappingURL=Matches.js.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"names":["_index","require","_cloneNode","_removePropertiesDeep","toKeyAlias","node","key","alias","kind","increment","isIdentifier","name","isStringLiteral","JSON","stringify","value","removePropertiesDeep","cloneNode","computed","static","uid","Number","MAX_SAFE_INTEGER"],"sources":["../../src/converters/toKeyAlias.ts"],"sourcesContent":["import {\n isIdentifier,\n isStringLiteral,\n} from \"../validators/generated/index.ts\";\nimport cloneNode from \"../clone/cloneNode.ts\";\nimport removePropertiesDeep from \"../modifications/removePropertiesDeep.ts\";\nimport type * as t from \"../index.ts\";\n\nexport default function toKeyAlias(\n node: t.Method | t.Property,\n key: t.Node = node.key,\n): string {\n let alias;\n\n // @ts-expect-error todo(flow->ts): maybe add node type check before checking `.kind`\n if (node.kind === \"method\") {\n return toKeyAlias.increment() + \"\";\n } else if (isIdentifier(key)) {\n alias = key.name;\n } else if (isStringLiteral(key)) {\n alias = JSON.stringify(key.value);\n } else {\n alias = JSON.stringify(removePropertiesDeep(cloneNode(key)));\n }\n\n // @ts-expect-error todo(flow->ts): maybe add node type check before checking `.computed`\n if (node.computed) {\n alias = `[${alias}]`;\n }\n\n // @ts-expect-error todo(flow->ts): maybe add node type check before checking `.static`\n if (node.static) {\n alias = `static:${alias}`;\n }\n\n return alias;\n}\n\ntoKeyAlias.uid = 0;\n\ntoKeyAlias.increment = function () {\n if (toKeyAlias.uid >= Number.MAX_SAFE_INTEGER) {\n return (toKeyAlias.uid = 0);\n } else {\n return toKeyAlias.uid++;\n }\n};\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAIA,IAAAC,UAAA,GAAAD,OAAA;AACA,IAAAE,qBAAA,GAAAF,OAAA;AAGe,SAASG,UAAUA,CAChCC,IAA2B,EAC3BC,GAAW,GAAGD,IAAI,CAACC,GAAG,EACd;EACR,IAAIC,KAAK;EAGT,IAAIF,IAAI,CAACG,IAAI,KAAK,QAAQ,EAAE;IAC1B,OAAOJ,UAAU,CAACK,SAAS,CAAC,CAAC,GAAG,EAAE;EACpC,CAAC,MAAM,IAAI,IAAAC,mBAAY,EAACJ,GAAG,CAAC,EAAE;IAC5BC,KAAK,GAAGD,GAAG,CAACK,IAAI;EAClB,CAAC,MAAM,IAAI,IAAAC,sBAAe,EAACN,GAAG,CAAC,EAAE;IAC/BC,KAAK,GAAGM,IAAI,CAACC,SAAS,CAACR,GAAG,CAACS,KAAK,CAAC;EACnC,CAAC,MAAM;IACLR,KAAK,GAAGM,IAAI,CAACC,SAAS,CAAC,IAAAE,6BAAoB,EAAC,IAAAC,kBAAS,EAACX,GAAG,CAAC,CAAC,CAAC;EAC9D;EAGA,IAAID,IAAI,CAACa,QAAQ,EAAE;IACjBX,KAAK,GAAG,IAAIA,KAAK,GAAG;EACtB;EAGA,IAAIF,IAAI,CAACc,MAAM,EAAE;IACfZ,KAAK,GAAG,UAAUA,KAAK,EAAE;EAC3B;EAEA,OAAOA,KAAK;AACd;AAEAH,UAAU,CAACgB,GAAG,GAAG,CAAC;AAElBhB,UAAU,CAACK,SAAS,GAAG,YAAY;EACjC,IAAIL,UAAU,CAACgB,GAAG,IAAIC,MAAM,CAACC,gBAAgB,EAAE;IAC7C,OAAQlB,UAAU,CAACgB,GAAG,GAAG,CAAC;EAC5B,CAAC,MAAM;IACL,OAAOhB,UAAU,CAACgB,GAAG,EAAE;EACzB;AACF,CAAC","ignoreList":[]}
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"names":["auxiliaryComment","message","blacklist","breakConfig","experimental","externalHelpers","extra","jsxPragma","loose","metadataUsedHelpers","modules","nonStandard","optional","sourceMapName","stage","whitelist","resolveModuleSource","version","metadata","sourceMapTarget"],"sources":["../../../src/config/validation/removed.ts"],"sourcesContent":["export default {\n auxiliaryComment: {\n message: \"Use `auxiliaryCommentBefore` or `auxiliaryCommentAfter`\",\n },\n blacklist: {\n message: \"Put the specific transforms you want in the `plugins` option\",\n },\n breakConfig: {\n message: \"This is not a necessary option in Babel 6\",\n },\n experimental: {\n message: \"Put the specific transforms you want in the `plugins` option\",\n },\n externalHelpers: {\n message:\n \"Use the `external-helpers` plugin instead. \" +\n \"Check out http://babeljs.io/docs/plugins/external-helpers/\",\n },\n extra: {\n message: \"\",\n },\n jsxPragma: {\n message:\n \"use the `pragma` option in the `react-jsx` plugin. \" +\n \"Check out http://babeljs.io/docs/plugins/transform-react-jsx/\",\n },\n loose: {\n message:\n \"Specify the `loose` option for the relevant plugin you are using \" +\n \"or use a preset that sets the option.\",\n },\n metadataUsedHelpers: {\n message: \"Not required anymore as this is enabled by default\",\n },\n modules: {\n message:\n \"Use the corresponding module transform plugin in the `plugins` option. \" +\n \"Check out http://babeljs.io/docs/plugins/#modules\",\n },\n nonStandard: {\n message:\n \"Use the `react-jsx` and `flow-strip-types` plugins to support JSX and Flow. \" +\n \"Also check out the react preset http://babeljs.io/docs/plugins/preset-react/\",\n },\n optional: {\n message: \"Put the specific transforms you want in the `plugins` option\",\n },\n sourceMapName: {\n message:\n \"The `sourceMapName` option has been removed because it makes more sense for the \" +\n \"tooling that calls Babel to assign `map.file` themselves.\",\n },\n stage: {\n message:\n \"Check out the corresponding stage-x presets http://babeljs.io/docs/plugins/#presets\",\n },\n whitelist: {\n message: \"Put the specific transforms you want in the `plugins` option\",\n },\n\n resolveModuleSource: {\n version: 6,\n message: \"Use `babel-plugin-module-resolver@3`'s 'resolvePath' options\",\n },\n metadata: {\n version: 6,\n message:\n \"Generated plugin metadata is always included in the output result\",\n },\n sourceMapTarget: {\n version: 6,\n message:\n \"The `sourceMapTarget` option has been removed because it makes more sense for the tooling \" +\n \"that calls Babel to assign `map.file` themselves.\",\n },\n} as { [name: string]: { version?: number; message: string } };\n"],"mappings":";;;;;;iCAAe;EACbA,gBAAgB,EAAE;IAChBC,OAAO,EAAE;EACX,CAAC;EACDC,SAAS,EAAE;IACTD,OAAO,EAAE;EACX,CAAC;EACDE,WAAW,EAAE;IACXF,OAAO,EAAE;EACX,CAAC;EACDG,YAAY,EAAE;IACZH,OAAO,EAAE;EACX,CAAC;EACDI,eAAe,EAAE;IACfJ,OAAO,EACL,6CAA6C,GAC7C;EACJ,CAAC;EACDK,KAAK,EAAE;IACLL,OAAO,EAAE;EACX,CAAC;EACDM,SAAS,EAAE;IACTN,OAAO,EACL,qDAAqD,GACrD;EACJ,CAAC;EACDO,KAAK,EAAE;IACLP,OAAO,EACL,mEAAmE,GACnE;EACJ,CAAC;EACDQ,mBAAmB,EAAE;IACnBR,OAAO,EAAE;EACX,CAAC;EACDS,OAAO,EAAE;IACPT,OAAO,EACL,yEAAyE,GACzE;EACJ,CAAC;EACDU,WAAW,EAAE;IACXV,OAAO,EACL,8EAA8E,GAC9E;EACJ,CAAC;EACDW,QAAQ,EAAE;IACRX,OAAO,EAAE;EACX,CAAC;EACDY,aAAa,EAAE;IACbZ,OAAO,EACL,kFAAkF,GAClF;EACJ,CAAC;EACDa,KAAK,EAAE;IACLb,OAAO,EACL;EACJ,CAAC;EACDc,SAAS,EAAE;IACTd,OAAO,EAAE;EACX,CAAC;EAEDe,mBAAmB,EAAE;IACnBC,OAAO,EAAE,CAAC;IACVhB,OAAO,EAAE;EACX,CAAC;EACDiB,QAAQ,EAAE;IACRD,OAAO,EAAE,CAAC;IACVhB,OAAO,EACL;EACJ,CAAC;EACDkB,eAAe,EAAE;IACfF,OAAO,EAAE,CAAC;IACVhB,OAAO,EACL,4FAA4F,GAC5F;EACJ;AACF,CAAC;AAAA","ignoreList":[]}
|
||||
@@ -0,0 +1,27 @@
|
||||
extends: eslint:recommended
|
||||
env:
|
||||
node: true
|
||||
browser: true
|
||||
rules:
|
||||
block-scoped-var: 2
|
||||
complexity: [2, 13]
|
||||
curly: [2, multi-or-nest, consistent]
|
||||
dot-location: [2, property]
|
||||
dot-notation: 2
|
||||
indent: [2, 2, SwitchCase: 1]
|
||||
linebreak-style: [2, unix]
|
||||
new-cap: 2
|
||||
no-console: [2, allow: [warn, error]]
|
||||
no-else-return: 2
|
||||
no-eq-null: 2
|
||||
no-fallthrough: 2
|
||||
no-invalid-this: 2
|
||||
no-return-assign: 2
|
||||
no-shadow: 1
|
||||
no-trailing-spaces: 2
|
||||
no-use-before-define: [2, nofunc]
|
||||
quotes: [2, single, avoid-escape]
|
||||
semi: [2, always]
|
||||
strict: [2, global]
|
||||
valid-jsdoc: [2, requireReturn: false]
|
||||
no-control-regex: 0
|
||||
@@ -0,0 +1,96 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = isReferenced;
|
||||
function isReferenced(node, parent, grandparent) {
|
||||
switch (parent.type) {
|
||||
case "MemberExpression":
|
||||
case "OptionalMemberExpression":
|
||||
if (parent.property === node) {
|
||||
return !!parent.computed;
|
||||
}
|
||||
return parent.object === node;
|
||||
case "JSXMemberExpression":
|
||||
return parent.object === node;
|
||||
case "VariableDeclarator":
|
||||
return parent.init === node;
|
||||
case "ArrowFunctionExpression":
|
||||
return parent.body === node;
|
||||
case "PrivateName":
|
||||
return false;
|
||||
case "ClassMethod":
|
||||
case "ClassPrivateMethod":
|
||||
case "ObjectMethod":
|
||||
if (parent.key === node) {
|
||||
return !!parent.computed;
|
||||
}
|
||||
return false;
|
||||
case "ObjectProperty":
|
||||
if (parent.key === node) {
|
||||
return !!parent.computed;
|
||||
}
|
||||
return !grandparent || grandparent.type !== "ObjectPattern";
|
||||
case "ClassProperty":
|
||||
case "ClassAccessorProperty":
|
||||
if (parent.key === node) {
|
||||
return !!parent.computed;
|
||||
}
|
||||
return true;
|
||||
case "ClassPrivateProperty":
|
||||
return parent.key !== node;
|
||||
case "ClassDeclaration":
|
||||
case "ClassExpression":
|
||||
return parent.superClass === node;
|
||||
case "AssignmentExpression":
|
||||
return parent.right === node;
|
||||
case "AssignmentPattern":
|
||||
return parent.right === node;
|
||||
case "LabeledStatement":
|
||||
return false;
|
||||
case "CatchClause":
|
||||
return false;
|
||||
case "RestElement":
|
||||
return false;
|
||||
case "BreakStatement":
|
||||
case "ContinueStatement":
|
||||
return false;
|
||||
case "FunctionDeclaration":
|
||||
case "FunctionExpression":
|
||||
return false;
|
||||
case "ExportNamespaceSpecifier":
|
||||
case "ExportDefaultSpecifier":
|
||||
return false;
|
||||
case "ExportSpecifier":
|
||||
if (grandparent != null && grandparent.source) {
|
||||
return false;
|
||||
}
|
||||
return parent.local === node;
|
||||
case "ImportDefaultSpecifier":
|
||||
case "ImportNamespaceSpecifier":
|
||||
case "ImportSpecifier":
|
||||
return false;
|
||||
case "ImportAttribute":
|
||||
return false;
|
||||
case "JSXAttribute":
|
||||
return false;
|
||||
case "ObjectPattern":
|
||||
case "ArrayPattern":
|
||||
return false;
|
||||
case "MetaProperty":
|
||||
return false;
|
||||
case "ObjectTypeProperty":
|
||||
return parent.key !== node;
|
||||
case "TSEnumMember":
|
||||
return parent.id !== node;
|
||||
case "TSPropertySignature":
|
||||
if (parent.key === node) {
|
||||
return !!parent.computed;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=isReferenced.js.map
|
||||
@@ -0,0 +1,11 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = _initializerWarningHelper;
|
||||
function _initializerWarningHelper(descriptor, context) {
|
||||
throw new Error("Decorating class property failed. Please ensure that " + "transform-class-properties is enabled and runs after the decorators transform.");
|
||||
}
|
||||
|
||||
//# sourceMappingURL=initializerWarningHelper.js.map
|
||||
@@ -0,0 +1,10 @@
|
||||
const Range = require('../classes/range')
|
||||
const satisfies = (version, range, options) => {
|
||||
try {
|
||||
range = new Range(range, options)
|
||||
} catch (er) {
|
||||
return false
|
||||
}
|
||||
return range.test(version)
|
||||
}
|
||||
module.exports = satisfies
|
||||
Reference in New Issue
Block a user