update
This commit is contained in:
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"2":"K D E F A B mC"},B:{"1":"0 9 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","2":"C L M G N O P"},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 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","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","194":"vB MC wB NC xB yB zB 0B 1B"},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 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","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 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:{"1":"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:{"1":"pD"},S:{"2":"qD rD"}},B:4,C:"Orientation Sensor",D:true};
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"2":"K D E F A B mC"},B:{"1":"0 9 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","2":"C L M G N O P"},C:{"1":"0 9 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","2":"nC LC J PB K D E F A B C L M G N qC rC","4":"1 O P QB","194":"2 3 4 5 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 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"},D:{"1":"0 9 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","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","66":"tB uB vB MC wB NC xB yB zB 0B"},E:{"1":"L M G 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","2":"J PB K D E F A B C sC SC tC uC vC wC TC FC"},F:{"1":"0 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","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 4C 5C 6C 7C FC kC 8C GC","66":"gB hB iB jB kB lB mB nB oB pB"},G:{"1":"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","2":"E SC 9C lC AD BD CD DD ED FD GD HD ID JD KD"},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:{"1":"EC"},N:{"2":"A B"},O:{"1":"HC"},P:{"1":"1 2 3 4 5 6 7 8 hD TC iD jD kD lD mD IC JC KC nD","2":"J dD eD fD gD"},Q:{"1":"oD"},R:{"1":"pD"},S:{"194":"qD rD"}},B:1,C:"inputmode attribute",D:true};
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"names":["id","_classPrivateFieldKey","name"],"sources":["../../src/helpers/classPrivateFieldLooseKey.ts"],"sourcesContent":["/* @minVersion 7.0.0-beta.0 */\n\nvar id = 0;\nexport default function _classPrivateFieldKey(name: string) {\n return \"__private_\" + id++ + \"_\" + name;\n}\n"],"mappings":";;;;;;AAEA,IAAIA,EAAE,GAAG,CAAC;AACK,SAASC,qBAAqBA,CAACC,IAAY,EAAE;EAC1D,OAAO,YAAY,GAAGF,EAAE,EAAE,GAAG,GAAG,GAAGE,IAAI;AACzC","ignoreList":[]}
|
||||
@@ -0,0 +1,61 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
var _helperPluginUtils = require("@babel/helper-plugin-utils");
|
||||
var _core = require("@babel/core");
|
||||
const TRACE_ID = "__self";
|
||||
function getThisFunctionParent(path) {
|
||||
let scope = path.scope;
|
||||
do {
|
||||
const {
|
||||
path
|
||||
} = scope;
|
||||
if (path.isFunctionParent() && !path.isArrowFunctionExpression()) {
|
||||
return path;
|
||||
}
|
||||
} while (scope = scope.parent);
|
||||
return null;
|
||||
}
|
||||
function isDerivedClass(classPath) {
|
||||
return classPath.node.superClass !== null;
|
||||
}
|
||||
function isThisAllowed(path) {
|
||||
const parentMethodOrFunction = getThisFunctionParent(path);
|
||||
if (parentMethodOrFunction === null) {
|
||||
return true;
|
||||
}
|
||||
if (!parentMethodOrFunction.isMethod()) {
|
||||
return true;
|
||||
}
|
||||
if (parentMethodOrFunction.node.kind !== "constructor") {
|
||||
return true;
|
||||
}
|
||||
return !isDerivedClass(parentMethodOrFunction.parentPath.parentPath);
|
||||
}
|
||||
var _default = exports.default = (0, _helperPluginUtils.declare)(api => {
|
||||
api.assertVersion(7);
|
||||
const visitor = {
|
||||
JSXOpeningElement(path) {
|
||||
if (!isThisAllowed(path)) {
|
||||
return;
|
||||
}
|
||||
const node = path.node;
|
||||
const id = _core.types.jsxIdentifier(TRACE_ID);
|
||||
const trace = _core.types.thisExpression();
|
||||
node.attributes.push(_core.types.jsxAttribute(id, _core.types.jsxExpressionContainer(trace)));
|
||||
}
|
||||
};
|
||||
return {
|
||||
name: "transform-react-jsx-self",
|
||||
visitor: {
|
||||
Program(path) {
|
||||
path.traverse(visitor);
|
||||
}
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
//# sourceMappingURL=index.js.map
|
||||
@@ -0,0 +1,12 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = inheritLeadingComments;
|
||||
var _inherit = require("../utils/inherit.js");
|
||||
function inheritLeadingComments(child, parent) {
|
||||
(0, _inherit.default)("leadingComments", child, parent);
|
||||
}
|
||||
|
||||
//# sourceMappingURL=inheritLeadingComments.js.map
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"2":"K D E F A B mC"},B:{"1":"0 9 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","2":"C L M G N O P"},C:{"1":"0 9 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","2":"1 2 3 4 5 6 7 8 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 qC rC"},D:{"1":"0 9 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","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"},E:{"1":"G 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","2":"J PB K D E F A B C L M sC SC tC uC vC wC TC FC GC xC"},F:{"1":"0 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","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 4C 5C 6C 7C FC kC 8C GC"},G:{"1":"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","2":"E SC 9C lC AD BD CD DD ED FD GD HD ID JD KD LD MD ND OD PD QD"},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:{"1":"EC"},N:{"2":"A B"},O:{"1":"HC"},P:{"1":"1 2 3 4 5 6 7 8 iD jD kD lD mD IC JC KC nD","2":"J dD eD fD gD hD TC"},Q:{"16":"oD"},R:{"16":"pD"},S:{"2":"qD","16":"rD"}},B:5,C:"WebAssembly Threads and Atomics",D:true};
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"names":["_classApplyDescriptorDestructureSet","require","_classPrivateFieldGet","_classPrivateFieldDestructureSet","receiver","privateMap","descriptor","classPrivateFieldGet2","classApplyDescriptorDestructureSet"],"sources":["../../src/helpers/classPrivateFieldDestructureSet.js"],"sourcesContent":["/* @minVersion 7.4.4 */\n/* @onlyBabel7 */\n\nimport classApplyDescriptorDestructureSet from \"classApplyDescriptorDestructureSet\";\nimport classPrivateFieldGet2 from \"classPrivateFieldGet2\";\nexport default function _classPrivateFieldDestructureSet(receiver, privateMap) {\n var descriptor = classPrivateFieldGet2(privateMap, receiver);\n return classApplyDescriptorDestructureSet(receiver, descriptor);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,mCAAA,GAAAC,OAAA;AACA,IAAAC,qBAAA,GAAAD,OAAA;AACe,SAASE,gCAAgCA,CAACC,QAAQ,EAAEC,UAAU,EAAE;EAC7E,IAAIC,UAAU,GAAGC,qBAAqB,CAACF,UAAU,EAAED,QAAQ,CAAC;EAC5D,OAAOI,mCAAkC,CAACJ,QAAQ,EAAEE,UAAU,CAAC;AACjE","ignoreList":[]}
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"2":"K D E mC","164":"F A","260":"B"},B:{"1":"0 9 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","260":"C L M G N"},C:{"1":"0 9 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","2":"nC LC J PB K D E qC rC","516":"1 2 3 4 5 6 7 8 F A B C L M G N O P QB RB SB TB UB"},D:{"1":"0 4 5 6 7 8 9 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","2":"1 2 3 J PB K D E F A B C L M G N O P QB"},E:{"1":"K A B C tC wC TC FC","2":"J PB L M G sC SC 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","1028":"D E F uC vC"},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","2":"F B 4C 5C 6C 7C FC kC 8C"},G:{"1":"ED FD GD HD ID JD KD","2":"SC 9C lC AD BD 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","1028":"E CD DD"},H:{"1":"WD"},I:{"1":"I bD cD","2":"LC J XD YD ZD aD lC"},J:{"16":"D","1028":"A"},K:{"1":"H GC","16":"A B C FC kC"},L:{"1":"I"},M:{"1":"EC"},N:{"164":"A","260":"B"},O:{"1":"HC"},P:{"1":"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:{"1":"pD"},S:{"1":"qD rD"}},B:7,C:"Do Not Track API",D:true};
|
||||
@@ -0,0 +1,22 @@
|
||||
/*
|
||||
@license
|
||||
Rollup.js v4.39.0
|
||||
Wed, 02 Apr 2025 04:49:00 GMT - commit 5c001245779063abac3899aa9d25294ab003581b
|
||||
|
||||
https://github.com/rollup/rollup
|
||||
|
||||
Released under the MIT License.
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
||||
|
||||
require('./native.js');
|
||||
const parseAst_js = require('./shared/parseAst.js');
|
||||
require('node:path');
|
||||
|
||||
|
||||
|
||||
exports.parseAst = parseAst_js.parseAst;
|
||||
exports.parseAstAsync = parseAst_js.parseAstAsync;
|
||||
//# sourceMappingURL=parseAst.js.map
|
||||
@@ -0,0 +1,125 @@
|
||||
# locate-path [](https://travis-ci.com/github/sindresorhus/locate-path)
|
||||
|
||||
> Get the first path that exists on disk of multiple paths
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install locate-path
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
Here we find the first file that exists on disk, in array order.
|
||||
|
||||
```js
|
||||
const locatePath = require('locate-path');
|
||||
|
||||
const files = [
|
||||
'unicorn.png',
|
||||
'rainbow.png', // Only this one actually exists on disk
|
||||
'pony.png'
|
||||
];
|
||||
|
||||
(async () => {
|
||||
console(await locatePath(files));
|
||||
//=> 'rainbow'
|
||||
})();
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
### locatePath(paths, options?)
|
||||
|
||||
Returns a `Promise<string>` for the first path that exists or `undefined` if none exists.
|
||||
|
||||
#### paths
|
||||
|
||||
Type: `Iterable<string>`
|
||||
|
||||
Paths to check.
|
||||
|
||||
#### options
|
||||
|
||||
Type: `object`
|
||||
|
||||
##### concurrency
|
||||
|
||||
Type: `number`\
|
||||
Default: `Infinity`\
|
||||
Minimum: `1`
|
||||
|
||||
Number of concurrently pending promises.
|
||||
|
||||
##### preserveOrder
|
||||
|
||||
Type: `boolean`\
|
||||
Default: `true`
|
||||
|
||||
Preserve `paths` order when searching.
|
||||
|
||||
Disable this to improve performance if you don't care about the order.
|
||||
|
||||
##### cwd
|
||||
|
||||
Type: `string`\
|
||||
Default: `process.cwd()`
|
||||
|
||||
Current working directory.
|
||||
|
||||
##### type
|
||||
|
||||
Type: `string`\
|
||||
Default: `'file'`\
|
||||
Values: `'file' | 'directory'`
|
||||
|
||||
The type of paths that can match.
|
||||
|
||||
##### allowSymlinks
|
||||
|
||||
Type: `boolean`\
|
||||
Default: `true`
|
||||
|
||||
Allow symbolic links to match if they point to the chosen path type.
|
||||
|
||||
### locatePath.sync(paths, options?)
|
||||
|
||||
Returns the first path that exists or `undefined` if none exists.
|
||||
|
||||
#### paths
|
||||
|
||||
Type: `Iterable<string>`
|
||||
|
||||
Paths to check.
|
||||
|
||||
#### options
|
||||
|
||||
Type: `object`
|
||||
|
||||
##### cwd
|
||||
|
||||
Same as above.
|
||||
|
||||
##### type
|
||||
|
||||
Same as above.
|
||||
|
||||
##### allowSymlinks
|
||||
|
||||
Same as above.
|
||||
|
||||
## Related
|
||||
|
||||
- [path-exists](https://github.com/sindresorhus/path-exists) - Check if a path exists
|
||||
|
||||
---
|
||||
|
||||
<div align="center">
|
||||
<b>
|
||||
<a href="https://tidelift.com/subscription/pkg/npm-locate-path?utm_source=npm-locate-path&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
|
||||
</b>
|
||||
<br>
|
||||
<sub>
|
||||
Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
|
||||
</sub>
|
||||
</div>
|
||||
@@ -0,0 +1,29 @@
|
||||
'use strict';
|
||||
|
||||
var React = require('react');
|
||||
var useSyncExternalStoreExports = require('use-sync-external-store/shim/with-selector');
|
||||
var vanilla = require('zustand/vanilla');
|
||||
|
||||
const { useSyncExternalStoreWithSelector } = useSyncExternalStoreExports;
|
||||
const identity = (arg) => arg;
|
||||
function useStoreWithEqualityFn(api, selector = identity, equalityFn) {
|
||||
const slice = useSyncExternalStoreWithSelector(
|
||||
api.subscribe,
|
||||
api.getState,
|
||||
api.getInitialState,
|
||||
selector,
|
||||
equalityFn
|
||||
);
|
||||
React.useDebugValue(slice);
|
||||
return slice;
|
||||
}
|
||||
const createWithEqualityFnImpl = (createState, defaultEqualityFn) => {
|
||||
const api = vanilla.createStore(createState);
|
||||
const useBoundStoreWithEqualityFn = (selector, equalityFn = defaultEqualityFn) => useStoreWithEqualityFn(api, selector, equalityFn);
|
||||
Object.assign(useBoundStoreWithEqualityFn, api);
|
||||
return useBoundStoreWithEqualityFn;
|
||||
};
|
||||
const createWithEqualityFn = (createState, defaultEqualityFn) => createState ? createWithEqualityFnImpl(createState, defaultEqualityFn) : createWithEqualityFnImpl;
|
||||
|
||||
exports.createWithEqualityFn = createWithEqualityFn;
|
||||
exports.useStoreWithEqualityFn = useStoreWithEqualityFn;
|
||||
@@ -0,0 +1,115 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
||||
const React = require("react");
|
||||
const routerCore = require("@tanstack/router-core");
|
||||
const utils = require("./utils.cjs");
|
||||
const useRouter = require("./useRouter.cjs");
|
||||
const useRouterState = require("./useRouterState.cjs");
|
||||
function _interopNamespaceDefault(e) {
|
||||
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
||||
if (e) {
|
||||
for (const k in e) {
|
||||
if (k !== "default") {
|
||||
const d = Object.getOwnPropertyDescriptor(e, k);
|
||||
Object.defineProperty(n, k, d.get ? d : {
|
||||
enumerable: true,
|
||||
get: () => e[k]
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
n.default = e;
|
||||
return Object.freeze(n);
|
||||
}
|
||||
const React__namespace = /* @__PURE__ */ _interopNamespaceDefault(React);
|
||||
function Transitioner() {
|
||||
const router = useRouter.useRouter();
|
||||
const mountLoadForRouter = React__namespace.useRef({ router, mounted: false });
|
||||
const isLoading = useRouterState.useRouterState({
|
||||
select: ({ isLoading: isLoading2 }) => isLoading2
|
||||
});
|
||||
const [isTransitioning, setIsTransitioning] = React__namespace.useState(false);
|
||||
const hasPendingMatches = useRouterState.useRouterState({
|
||||
select: (s) => s.matches.some((d) => d.status === "pending"),
|
||||
structuralSharing: true
|
||||
});
|
||||
const previousIsLoading = utils.usePrevious(isLoading);
|
||||
const isAnyPending = isLoading || isTransitioning || hasPendingMatches;
|
||||
const previousIsAnyPending = utils.usePrevious(isAnyPending);
|
||||
const isPagePending = isLoading || hasPendingMatches;
|
||||
const previousIsPagePending = utils.usePrevious(isPagePending);
|
||||
if (!router.isServer) {
|
||||
router.startTransition = (fn) => {
|
||||
setIsTransitioning(true);
|
||||
React__namespace.startTransition(() => {
|
||||
fn();
|
||||
setIsTransitioning(false);
|
||||
});
|
||||
};
|
||||
}
|
||||
React__namespace.useEffect(() => {
|
||||
const unsub = router.history.subscribe(router.load);
|
||||
const nextLocation = router.buildLocation({
|
||||
to: router.latestLocation.pathname,
|
||||
search: true,
|
||||
params: true,
|
||||
hash: true,
|
||||
state: true,
|
||||
_includeValidateSearch: true
|
||||
});
|
||||
if (routerCore.trimPathRight(router.latestLocation.href) !== routerCore.trimPathRight(nextLocation.href)) {
|
||||
router.commitLocation({ ...nextLocation, replace: true });
|
||||
}
|
||||
return () => {
|
||||
unsub();
|
||||
};
|
||||
}, [router, router.history]);
|
||||
utils.useLayoutEffect(() => {
|
||||
if (typeof window !== "undefined" && router.clientSsr || mountLoadForRouter.current.router === router && mountLoadForRouter.current.mounted) {
|
||||
return;
|
||||
}
|
||||
mountLoadForRouter.current = { router, mounted: true };
|
||||
const tryLoad = async () => {
|
||||
try {
|
||||
await router.load();
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
}
|
||||
};
|
||||
tryLoad();
|
||||
}, [router]);
|
||||
utils.useLayoutEffect(() => {
|
||||
if (previousIsLoading && !isLoading) {
|
||||
router.emit({
|
||||
type: "onLoad",
|
||||
// When the new URL has committed, when the new matches have been loaded into state.matches
|
||||
...routerCore.getLocationChangeInfo(router.state)
|
||||
});
|
||||
}
|
||||
}, [previousIsLoading, router, isLoading]);
|
||||
utils.useLayoutEffect(() => {
|
||||
if (previousIsPagePending && !isPagePending) {
|
||||
router.emit({
|
||||
type: "onBeforeRouteMount",
|
||||
...routerCore.getLocationChangeInfo(router.state)
|
||||
});
|
||||
}
|
||||
}, [isPagePending, previousIsPagePending, router]);
|
||||
utils.useLayoutEffect(() => {
|
||||
if (previousIsAnyPending && !isAnyPending) {
|
||||
router.emit({
|
||||
type: "onResolved",
|
||||
...routerCore.getLocationChangeInfo(router.state)
|
||||
});
|
||||
router.__store.setState((s) => ({
|
||||
...s,
|
||||
status: "idle",
|
||||
resolvedLocation: s.location
|
||||
}));
|
||||
routerCore.handleHashScroll(router);
|
||||
}
|
||||
}, [isAnyPending, previousIsAnyPending, router]);
|
||||
return null;
|
||||
}
|
||||
exports.Transitioner = Transitioner;
|
||||
//# sourceMappingURL=Transitioner.cjs.map
|
||||
@@ -0,0 +1,394 @@
|
||||
/**
|
||||
* @fileoverview Rule to flag non-quoted property names in object literals.
|
||||
* @author Mathias Bynens <http://mathiasbynens.be/>
|
||||
* @deprecated in ESLint v8.53.0
|
||||
*/
|
||||
"use strict";
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Requirements
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
const espree = require("espree");
|
||||
const astUtils = require("./utils/ast-utils");
|
||||
const keywords = require("./utils/keywords");
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Rule Definition
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
/** @type {import('../shared/types').Rule} */
|
||||
module.exports = {
|
||||
meta: {
|
||||
deprecated: {
|
||||
message: "Formatting rules are being moved out of ESLint core.",
|
||||
url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
|
||||
deprecatedSince: "8.53.0",
|
||||
availableUntil: "10.0.0",
|
||||
replacedBy: [
|
||||
{
|
||||
message:
|
||||
"ESLint Stylistic now maintains deprecated stylistic core rules.",
|
||||
url: "https://eslint.style/guide/migration",
|
||||
plugin: {
|
||||
name: "@stylistic/eslint-plugin-js",
|
||||
url: "https://eslint.style/packages/js",
|
||||
},
|
||||
rule: {
|
||||
name: "quote-props",
|
||||
url: "https://eslint.style/rules/js/quote-props",
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
type: "suggestion",
|
||||
|
||||
docs: {
|
||||
description: "Require quotes around object literal property names",
|
||||
recommended: false,
|
||||
url: "https://eslint.org/docs/latest/rules/quote-props",
|
||||
},
|
||||
|
||||
schema: {
|
||||
anyOf: [
|
||||
{
|
||||
type: "array",
|
||||
items: [
|
||||
{
|
||||
enum: [
|
||||
"always",
|
||||
"as-needed",
|
||||
"consistent",
|
||||
"consistent-as-needed",
|
||||
],
|
||||
},
|
||||
],
|
||||
minItems: 0,
|
||||
maxItems: 1,
|
||||
},
|
||||
{
|
||||
type: "array",
|
||||
items: [
|
||||
{
|
||||
enum: [
|
||||
"always",
|
||||
"as-needed",
|
||||
"consistent",
|
||||
"consistent-as-needed",
|
||||
],
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
keywords: {
|
||||
type: "boolean",
|
||||
},
|
||||
unnecessary: {
|
||||
type: "boolean",
|
||||
},
|
||||
numbers: {
|
||||
type: "boolean",
|
||||
},
|
||||
},
|
||||
additionalProperties: false,
|
||||
},
|
||||
],
|
||||
minItems: 0,
|
||||
maxItems: 2,
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
fixable: "code",
|
||||
messages: {
|
||||
requireQuotesDueToReservedWord:
|
||||
"Properties should be quoted as '{{property}}' is a reserved word.",
|
||||
inconsistentlyQuotedProperty:
|
||||
"Inconsistently quoted property '{{key}}' found.",
|
||||
unnecessarilyQuotedProperty:
|
||||
"Unnecessarily quoted property '{{property}}' found.",
|
||||
unquotedReservedProperty:
|
||||
"Unquoted reserved word '{{property}}' used as key.",
|
||||
unquotedNumericProperty:
|
||||
"Unquoted number literal '{{property}}' used as key.",
|
||||
unquotedPropertyFound: "Unquoted property '{{property}}' found.",
|
||||
redundantQuoting:
|
||||
"Properties shouldn't be quoted as all quotes are redundant.",
|
||||
},
|
||||
},
|
||||
|
||||
create(context) {
|
||||
const MODE = context.options[0],
|
||||
KEYWORDS = context.options[1] && context.options[1].keywords,
|
||||
CHECK_UNNECESSARY =
|
||||
!context.options[1] || context.options[1].unnecessary !== false,
|
||||
NUMBERS = context.options[1] && context.options[1].numbers,
|
||||
sourceCode = context.sourceCode;
|
||||
|
||||
/**
|
||||
* Checks whether a certain string constitutes an ES3 token
|
||||
* @param {string} tokenStr The string to be checked.
|
||||
* @returns {boolean} `true` if it is an ES3 token.
|
||||
*/
|
||||
function isKeyword(tokenStr) {
|
||||
return keywords.includes(tokenStr);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if an espree-tokenized key has redundant quotes (i.e. whether quotes are unnecessary)
|
||||
* @param {string} rawKey The raw key value from the source
|
||||
* @param {espreeTokens} tokens The espree-tokenized node key
|
||||
* @param {boolean} [skipNumberLiterals=false] Indicates whether number literals should be checked
|
||||
* @returns {boolean} Whether or not a key has redundant quotes.
|
||||
* @private
|
||||
*/
|
||||
function areQuotesRedundant(rawKey, tokens, skipNumberLiterals) {
|
||||
return (
|
||||
tokens.length === 1 &&
|
||||
tokens[0].start === 0 &&
|
||||
tokens[0].end === rawKey.length &&
|
||||
(["Identifier", "Keyword", "Null", "Boolean"].includes(
|
||||
tokens[0].type,
|
||||
) ||
|
||||
(tokens[0].type === "Numeric" &&
|
||||
!skipNumberLiterals &&
|
||||
String(+tokens[0].value) === tokens[0].value))
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a string representation of a property node with quotes removed
|
||||
* @param {ASTNode} key Key AST Node, which may or may not be quoted
|
||||
* @returns {string} A replacement string for this property
|
||||
*/
|
||||
function getUnquotedKey(key) {
|
||||
return key.type === "Identifier" ? key.name : key.value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a string representation of a property node with quotes added
|
||||
* @param {ASTNode} key Key AST Node, which may or may not be quoted
|
||||
* @returns {string} A replacement string for this property
|
||||
*/
|
||||
function getQuotedKey(key) {
|
||||
if (key.type === "Literal" && typeof key.value === "string") {
|
||||
// If the key is already a string literal, don't replace the quotes with double quotes.
|
||||
return sourceCode.getText(key);
|
||||
}
|
||||
|
||||
// Otherwise, the key is either an identifier or a number literal.
|
||||
return `"${key.type === "Identifier" ? key.name : key.value}"`;
|
||||
}
|
||||
|
||||
/**
|
||||
* Ensures that a property's key is quoted only when necessary
|
||||
* @param {ASTNode} node Property AST node
|
||||
* @returns {void}
|
||||
*/
|
||||
function checkUnnecessaryQuotes(node) {
|
||||
const key = node.key;
|
||||
|
||||
if (node.method || node.computed || node.shorthand) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (key.type === "Literal" && typeof key.value === "string") {
|
||||
let tokens;
|
||||
|
||||
try {
|
||||
tokens = espree.tokenize(key.value);
|
||||
} catch {
|
||||
return;
|
||||
}
|
||||
|
||||
if (tokens.length !== 1) {
|
||||
return;
|
||||
}
|
||||
|
||||
const isKeywordToken = isKeyword(tokens[0].value);
|
||||
|
||||
if (isKeywordToken && KEYWORDS) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (
|
||||
CHECK_UNNECESSARY &&
|
||||
areQuotesRedundant(key.value, tokens, NUMBERS)
|
||||
) {
|
||||
context.report({
|
||||
node,
|
||||
messageId: "unnecessarilyQuotedProperty",
|
||||
data: { property: key.value },
|
||||
fix: fixer =>
|
||||
fixer.replaceText(key, getUnquotedKey(key)),
|
||||
});
|
||||
}
|
||||
} else if (
|
||||
KEYWORDS &&
|
||||
key.type === "Identifier" &&
|
||||
isKeyword(key.name)
|
||||
) {
|
||||
context.report({
|
||||
node,
|
||||
messageId: "unquotedReservedProperty",
|
||||
data: { property: key.name },
|
||||
fix: fixer => fixer.replaceText(key, getQuotedKey(key)),
|
||||
});
|
||||
} else if (
|
||||
NUMBERS &&
|
||||
key.type === "Literal" &&
|
||||
astUtils.isNumericLiteral(key)
|
||||
) {
|
||||
context.report({
|
||||
node,
|
||||
messageId: "unquotedNumericProperty",
|
||||
data: { property: key.value },
|
||||
fix: fixer => fixer.replaceText(key, getQuotedKey(key)),
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Ensures that a property's key is quoted
|
||||
* @param {ASTNode} node Property AST node
|
||||
* @returns {void}
|
||||
*/
|
||||
function checkOmittedQuotes(node) {
|
||||
const key = node.key;
|
||||
|
||||
if (
|
||||
!node.method &&
|
||||
!node.computed &&
|
||||
!node.shorthand &&
|
||||
!(key.type === "Literal" && typeof key.value === "string")
|
||||
) {
|
||||
context.report({
|
||||
node,
|
||||
messageId: "unquotedPropertyFound",
|
||||
data: { property: key.name || key.value },
|
||||
fix: fixer => fixer.replaceText(key, getQuotedKey(key)),
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Ensures that an object's keys are consistently quoted, optionally checks for redundancy of quotes
|
||||
* @param {ASTNode} node Property AST node
|
||||
* @param {boolean} checkQuotesRedundancy Whether to check quotes' redundancy
|
||||
* @returns {void}
|
||||
*/
|
||||
function checkConsistency(node, checkQuotesRedundancy) {
|
||||
const quotedProps = [],
|
||||
unquotedProps = [];
|
||||
let keywordKeyName = null,
|
||||
necessaryQuotes = false;
|
||||
|
||||
node.properties.forEach(property => {
|
||||
const key = property.key;
|
||||
|
||||
if (
|
||||
!key ||
|
||||
property.method ||
|
||||
property.computed ||
|
||||
property.shorthand
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (key.type === "Literal" && typeof key.value === "string") {
|
||||
quotedProps.push(property);
|
||||
|
||||
if (checkQuotesRedundancy) {
|
||||
let tokens;
|
||||
|
||||
try {
|
||||
tokens = espree.tokenize(key.value);
|
||||
} catch {
|
||||
necessaryQuotes = true;
|
||||
return;
|
||||
}
|
||||
|
||||
necessaryQuotes =
|
||||
necessaryQuotes ||
|
||||
!areQuotesRedundant(key.value, tokens) ||
|
||||
(KEYWORDS && isKeyword(tokens[0].value));
|
||||
}
|
||||
} else if (
|
||||
KEYWORDS &&
|
||||
checkQuotesRedundancy &&
|
||||
key.type === "Identifier" &&
|
||||
isKeyword(key.name)
|
||||
) {
|
||||
unquotedProps.push(property);
|
||||
necessaryQuotes = true;
|
||||
keywordKeyName = key.name;
|
||||
} else {
|
||||
unquotedProps.push(property);
|
||||
}
|
||||
});
|
||||
|
||||
if (
|
||||
checkQuotesRedundancy &&
|
||||
quotedProps.length &&
|
||||
!necessaryQuotes
|
||||
) {
|
||||
quotedProps.forEach(property => {
|
||||
context.report({
|
||||
node: property,
|
||||
messageId: "redundantQuoting",
|
||||
fix: fixer =>
|
||||
fixer.replaceText(
|
||||
property.key,
|
||||
getUnquotedKey(property.key),
|
||||
),
|
||||
});
|
||||
});
|
||||
} else if (unquotedProps.length && keywordKeyName) {
|
||||
unquotedProps.forEach(property => {
|
||||
context.report({
|
||||
node: property,
|
||||
messageId: "requireQuotesDueToReservedWord",
|
||||
data: { property: keywordKeyName },
|
||||
fix: fixer =>
|
||||
fixer.replaceText(
|
||||
property.key,
|
||||
getQuotedKey(property.key),
|
||||
),
|
||||
});
|
||||
});
|
||||
} else if (quotedProps.length && unquotedProps.length) {
|
||||
unquotedProps.forEach(property => {
|
||||
context.report({
|
||||
node: property,
|
||||
messageId: "inconsistentlyQuotedProperty",
|
||||
data: { key: property.key.name || property.key.value },
|
||||
fix: fixer =>
|
||||
fixer.replaceText(
|
||||
property.key,
|
||||
getQuotedKey(property.key),
|
||||
),
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
Property(node) {
|
||||
if (MODE === "always" || !MODE) {
|
||||
checkOmittedQuotes(node);
|
||||
}
|
||||
if (MODE === "as-needed") {
|
||||
checkUnnecessaryQuotes(node);
|
||||
}
|
||||
},
|
||||
ObjectExpression(node) {
|
||||
if (MODE === "consistent") {
|
||||
checkConsistency(node, false);
|
||||
}
|
||||
if (MODE === "consistent-as-needed") {
|
||||
checkConsistency(node, true);
|
||||
}
|
||||
},
|
||||
};
|
||||
},
|
||||
};
|
||||
Binary file not shown.
@@ -0,0 +1 @@
|
||||
module.exports={C:{"4":0.0186,"52":0.00372,"69":0.00372,"77":0.00372,"108":0.00744,"115":0.08926,"128":0.01116,"130":0.00744,"131":0.00372,"132":0.00372,"133":0.00744,"134":0.02975,"135":0.15248,"136":0.89256,"137":0.00372,_:"2 3 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 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 70 71 72 73 74 75 76 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 105 106 107 109 110 111 112 113 114 116 117 118 119 120 121 122 123 124 125 126 127 129 138 139 140 3.5 3.6"},D:{"38":0.00372,"39":0.00744,"40":0.00372,"41":0.00372,"42":0.00372,"43":0.00744,"44":0.00372,"45":0.00744,"46":0.00372,"47":0.01116,"48":0.00372,"49":0.00744,"50":0.00744,"51":0.00372,"52":0.00744,"53":0.00744,"54":0.00372,"55":0.00744,"56":0.00744,"57":0.00372,"58":0.00744,"59":0.00744,"60":0.00372,"63":0.00372,"65":0.00372,"69":0.00372,"73":0.00744,"74":0.00744,"75":0.00744,"76":0.00372,"77":0.00744,"79":0.06694,"81":0.00372,"85":0.00744,"86":0.00372,"87":0.05579,"88":0.01488,"91":0.00372,"92":0.02603,"93":0.02231,"94":0.02231,"98":0.00744,"100":0.02231,"101":0.00372,"102":0.00372,"103":0.03719,"104":0.00372,"105":0.00744,"106":0.00372,"108":0.07438,"109":0.72149,"110":0.01116,"111":0.00744,"112":0.00372,"114":0.00744,"115":0.00372,"116":0.11901,"117":0.00372,"118":0.00744,"119":0.01116,"120":0.01116,"121":0.01488,"122":0.06322,"123":0.02975,"124":0.1376,"125":0.11157,"126":0.05207,"127":0.0186,"128":0.0595,"129":0.05207,"130":0.14504,"131":0.86281,"132":0.37934,"133":6.82808,"134":13.4665,"135":0.01116,_:"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 61 62 64 66 67 68 70 71 72 78 80 83 84 89 90 95 96 97 99 107 113 136 137 138"},F:{"86":0.00372,"87":0.01116,"88":0.00372,"95":0.02231,"114":0.03347,"116":0.48719,"117":1.28677,_:"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 89 90 91 92 93 94 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.00372,"85":0.00372,"92":0.01488,"100":0.00372,"109":0.03347,"112":0.00372,"114":0.02603,"115":0.00372,"118":0.00372,"119":0.00372,"121":0.00744,"122":0.00372,"123":0.00372,"124":0.00744,"125":0.00372,"126":0.01116,"127":0.00372,"128":0.00372,"129":0.01116,"130":0.01116,"131":0.04091,"132":0.10041,"133":1.5657,"134":3.62974,_:"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 102 103 104 105 106 107 108 110 111 113 116 117 120"},E:{"14":0.00372,_:"0 4 5 6 7 8 9 10 11 12 13 15 3.1 3.2 6.1 7.1 9.1 10.1 12.1 15.1 15.2-15.3 15.5","5.1":0.00744,"11.1":0.00372,"13.1":0.01488,"14.1":0.00372,"15.4":0.00372,"15.6":0.04835,"16.0":0.00372,"16.1":0.00744,"16.2":0.00372,"16.3":0.01116,"16.4":0.00372,"16.5":0.02231,"16.6":0.06694,"17.0":0.01116,"17.1":0.02975,"17.2":0.00744,"17.3":0.00372,"17.4":0.02231,"17.5":0.04091,"17.6":0.10413,"18.0":0.0595,"18.1":0.18223,"18.2":0.0186,"18.3":0.83306,"18.4":0.06694},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00371,"5.0-5.1":0,"6.0-6.1":0.01113,"7.0-7.1":0.00742,"8.1-8.4":0,"9.0-9.2":0.00556,"9.3":0.02596,"10.0-10.2":0.00185,"10.3":0.04265,"11.0-11.2":0.19658,"11.3-11.4":0.01298,"12.0-12.1":0.00742,"12.2-12.5":0.18359,"13.0-13.1":0.00371,"13.2":0.00556,"13.3":0.00742,"13.4-13.7":0.02596,"14.0-14.4":0.06491,"14.5-14.8":0.07789,"15.0-15.1":0.04265,"15.2-15.3":0.04265,"15.4":0.05193,"15.5":0.05934,"15.6-15.8":0.73067,"16.0":0.10385,"16.1":0.21327,"16.2":0.11127,"16.3":0.19287,"16.4":0.04265,"16.5":0.07974,"16.6-16.7":0.86604,"17.0":0.05193,"17.1":0.09272,"17.2":0.07047,"17.3":0.09829,"17.4":0.19658,"17.5":0.43766,"17.6-17.7":1.27032,"18.0":0.35606,"18.1":1.16462,"18.2":0.52111,"18.3":10.89138,"18.4":0.16134},P:{"4":0.08286,"20":0.01036,"21":0.01036,"22":0.02072,"23":0.02072,"24":0.06215,"25":0.06215,"26":0.17608,"27":1.82299,"5.0-5.4":0.01036,"6.2-6.4":0.01036,"7.2-7.4":0.05179,_:"8.2 9.2 10.1 12.0 14.0 15.0 17.0 18.0","11.1-11.2":0.01036,"13.0":0.01036,"16.0":0.02072,"19.0":0.01036},I:{"0":0.0376,"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.00004},K:{"0":0.29516,_:"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.15072},Q:{_:"14.9"},O:{"0":0.05652},H:{"0":0},L:{"0":43.49908}};
|
||||
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2018 Anders Nilsson
|
||||
|
||||
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,47 @@
|
||||
[](https://www.npmjs.com/package/merge-refs)  [](https://github.com/wojtekmaj/merge-refs/actions)
|
||||
|
||||
# Merge-Refs
|
||||
|
||||
A function that merges React refs into one. Filters out invalid (eg. falsy) refs as well and returns original ref if only one valid ref was given.
|
||||
|
||||
## tl;dr
|
||||
|
||||
- Install by executing `npm install merge-refs` or `yarn add merge-refs`.
|
||||
- Import by adding `import mergeRefs from 'merge-refs'`.
|
||||
- Use it in `ref` like so: `<div ref={mergeRefs(ref, someOtherRef)} />`
|
||||
|
||||
## Accepted refs
|
||||
|
||||
- Refs created using `createRef()`
|
||||
- Refs created using `useRef()`
|
||||
- Functional refs
|
||||
|
||||
## Example
|
||||
|
||||
```tsx
|
||||
function Hello() {
|
||||
const ref1 = useRef<HTMLDivElement>(); // I'm going to be updated!
|
||||
const ref2 = (element: HTMLDivElement) => {
|
||||
// I'm going to be called!
|
||||
};
|
||||
|
||||
return <div ref={mergeRefs(ref1, ref2)} />;
|
||||
}
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
The MIT License.
|
||||
|
||||
## Author
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td >
|
||||
<img src="https://avatars.githubusercontent.com/u/5426427?v=4&s=128" width="64" height="64" alt="Wojciech Maj">
|
||||
</td>
|
||||
<td>
|
||||
<a href="https://github.com/wojtekmaj">Wojciech Maj</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user