update
This commit is contained in:
@@ -0,0 +1,150 @@
|
||||
/// <reference types="node" resolution-mode="require"/>
|
||||
/**
|
||||
* A class representing the Node.js implementation of Hfs.
|
||||
* @implements {HfsImpl}
|
||||
*/
|
||||
export class NodeHfsImpl implements HfsImpl {
|
||||
/**
|
||||
* Creates a new instance.
|
||||
* @param {object} [options] The options for the instance.
|
||||
* @param {Fsp} [options.fsp] The file system module to use.
|
||||
*/
|
||||
constructor({ fsp }?: {
|
||||
fsp?: Fsp;
|
||||
});
|
||||
/**
|
||||
* Reads a file and returns the contents as a string. Assumes UTF-8 encoding.
|
||||
* @param {string} filePath The path to the file to read.
|
||||
* @returns {Promise<string|undefined>} A promise that resolves with the contents of
|
||||
* the file or undefined if the file doesn't exist.
|
||||
* @throws {TypeError} If the file path is not a string.
|
||||
* @throws {RangeError} If the file path is empty.
|
||||
* @throws {RangeError} If the file path is not absolute.
|
||||
* @throws {RangeError} If the file path is not a file.
|
||||
* @throws {RangeError} If the file path is not readable.
|
||||
*/
|
||||
text(filePath: string): Promise<string | undefined>;
|
||||
/**
|
||||
* Reads a file and returns the contents as a JSON object. Assumes UTF-8 encoding.
|
||||
* @param {string} filePath The path to the file to read.
|
||||
* @returns {Promise<object|undefined>} A promise that resolves with the contents of
|
||||
* the file or undefined if the file doesn't exist.
|
||||
* @throws {SyntaxError} If the file contents are not valid JSON.
|
||||
* @throws {Error} If the file cannot be read.
|
||||
* @throws {TypeError} If the file path is not a string.
|
||||
*/
|
||||
json(filePath: string): Promise<object | undefined>;
|
||||
/**
|
||||
* Reads a file and returns the contents as an ArrayBuffer.
|
||||
* @param {string} filePath The path to the file to read.
|
||||
* @returns {Promise<ArrayBuffer|undefined>} A promise that resolves with the contents
|
||||
* of the file or undefined if the file doesn't exist.
|
||||
* @throws {Error} If the file cannot be read.
|
||||
* @throws {TypeError} If the file path is not a string.
|
||||
* @deprecated Use bytes() instead.
|
||||
*/
|
||||
arrayBuffer(filePath: string): Promise<ArrayBuffer | undefined>;
|
||||
/**
|
||||
* Reads a file and returns the contents as an Uint8Array.
|
||||
* @param {string} filePath The path to the file to read.
|
||||
* @returns {Promise<Uint8Array|undefined>} A promise that resolves with the contents
|
||||
* of the file or undefined if the file doesn't exist.
|
||||
* @throws {Error} If the file cannot be read.
|
||||
* @throws {TypeError} If the file path is not a string.
|
||||
*/
|
||||
bytes(filePath: string): Promise<Uint8Array | undefined>;
|
||||
/**
|
||||
* Writes a value to a file. If the value is a string, UTF-8 encoding is used.
|
||||
* @param {string} filePath The path to the file to write.
|
||||
* @param {string|ArrayBuffer|ArrayBufferView} contents The contents to write to the
|
||||
* file.
|
||||
* @returns {Promise<void>} A promise that resolves when the file is
|
||||
* written.
|
||||
* @throws {TypeError} If the file path is not a string.
|
||||
* @throws {Error} If the file cannot be written.
|
||||
*/
|
||||
write(filePath: string, contents: string | ArrayBuffer | ArrayBufferView): Promise<void>;
|
||||
/**
|
||||
* Checks if a file exists.
|
||||
* @param {string} filePath The path to the file to check.
|
||||
* @returns {Promise<boolean>} A promise that resolves with true if the
|
||||
* file exists or false if it does not.
|
||||
* @throws {Error} If the operation fails with a code other than ENOENT.
|
||||
*/
|
||||
isFile(filePath: string): Promise<boolean>;
|
||||
/**
|
||||
* Checks if a directory exists.
|
||||
* @param {string} dirPath The path to the directory to check.
|
||||
* @returns {Promise<boolean>} A promise that resolves with true if the
|
||||
* directory exists or false if it does not.
|
||||
* @throws {Error} If the operation fails with a code other than ENOENT.
|
||||
*/
|
||||
isDirectory(dirPath: string): Promise<boolean>;
|
||||
/**
|
||||
* Creates a directory recursively.
|
||||
* @param {string} dirPath The path to the directory to create.
|
||||
* @returns {Promise<void>} A promise that resolves when the directory is
|
||||
* created.
|
||||
*/
|
||||
createDirectory(dirPath: string): Promise<void>;
|
||||
/**
|
||||
* Deletes a file or empty directory.
|
||||
* @param {string} fileOrDirPath The path to the file or directory to
|
||||
* delete.
|
||||
* @returns {Promise<void>} A promise that resolves when the file or
|
||||
* directory is deleted.
|
||||
* @throws {TypeError} If the file or directory path is not a string.
|
||||
* @throws {Error} If the file or directory cannot be deleted.
|
||||
* @throws {Error} If the file or directory is not found.
|
||||
*/
|
||||
delete(fileOrDirPath: string): Promise<void>;
|
||||
/**
|
||||
* Deletes a file or directory recursively.
|
||||
* @param {string} fileOrDirPath The path to the file or directory to
|
||||
* delete.
|
||||
* @returns {Promise<void>} A promise that resolves when the file or
|
||||
* directory is deleted.
|
||||
* @throws {TypeError} If the file or directory path is not a string.
|
||||
* @throws {Error} If the file or directory cannot be deleted.
|
||||
* @throws {Error} If the file or directory is not found.
|
||||
*/
|
||||
deleteAll(fileOrDirPath: string): Promise<void>;
|
||||
/**
|
||||
* Returns a list of directory entries for the given path.
|
||||
* @param {string} dirPath The path to the directory to read.
|
||||
* @returns {AsyncIterable<HfsDirectoryEntry>} A promise that resolves with the
|
||||
* directory entries.
|
||||
* @throws {TypeError} If the directory path is not a string.
|
||||
* @throws {Error} If the directory cannot be read.
|
||||
*/
|
||||
list(dirPath: string): AsyncIterable<HfsDirectoryEntry>;
|
||||
/**
|
||||
* Returns the size of a file.
|
||||
* @param {string} filePath The path to the file to read.
|
||||
* @returns {Promise<number|undefined>} A promise that resolves with the size of the
|
||||
* file in bytes or undefined if the file doesn't exist.
|
||||
*/
|
||||
size(filePath: string): Promise<number | undefined>;
|
||||
#private;
|
||||
}
|
||||
/**
|
||||
* A class representing a file system utility library.
|
||||
* @implements {HfsImpl}
|
||||
*/
|
||||
export class NodeHfs extends Hfs implements HfsImpl {
|
||||
/**
|
||||
* Creates a new instance.
|
||||
* @param {object} [options] The options for the instance.
|
||||
* @param {Fsp} [options.fsp] The file system module to use.
|
||||
*/
|
||||
constructor({ fsp }?: {
|
||||
fsp?: Fsp;
|
||||
});
|
||||
}
|
||||
export const hfs: NodeHfs;
|
||||
export type HfsImpl = import("@humanfs/types").HfsImpl;
|
||||
export type HfsDirectoryEntry = import("@humanfs/types").HfsDirectoryEntry;
|
||||
export type Fsp = typeof nativeFsp;
|
||||
export type Dirent = import("fs").Dirent;
|
||||
import { Hfs } from "@humanfs/core";
|
||||
import nativeFsp from "node:fs/promises";
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={C:{"50":0.00962,"112":0.00962,"115":0.08175,"126":0.00481,"127":0.00481,"128":0.03847,"131":0.00481,"133":0.00962,"134":0.02405,"135":0.46647,"136":0.93776,"137":0.01924,_:"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 51 52 53 54 55 56 57 58 59 60 61 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 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 113 114 116 117 118 119 120 121 122 123 124 125 129 130 132 138 139 140 3.5 3.6"},D:{"34":0.00962,"39":0.00481,"40":0.00962,"41":0.00481,"42":0.00481,"43":0.00962,"45":0.00481,"46":0.00481,"47":0.00481,"49":0.00481,"50":0.00481,"51":0.00481,"54":0.00481,"55":0.00962,"56":0.00481,"57":0.00481,"58":0.00481,"59":0.00481,"60":0.00481,"70":0.00481,"71":0.00481,"73":0.00481,"77":0.00481,"79":0.02885,"80":0.00962,"81":0.00962,"83":0.00962,"84":0.00481,"87":0.04809,"88":0.01443,"89":0.00481,"91":0.00481,"93":0.01443,"95":0.00962,"96":0.00481,"97":0.01924,"98":0.03847,"100":0.00962,"101":0.00962,"103":0.02885,"105":0.05771,"106":0.01443,"107":0.06252,"108":0.02885,"109":0.34625,"110":0.02405,"111":0.09618,"112":0.03366,"114":0.00962,"116":0.22121,"117":0.00481,"118":0.02885,"119":0.00481,"120":0.02405,"121":0.01924,"122":0.08175,"123":0.02885,"124":0.06252,"125":0.06733,"126":0.0529,"127":0.03366,"128":0.13946,"129":0.10099,"130":0.07214,"131":0.37029,"132":0.46166,"133":8.37247,"134":14.96561,"135":0.08656,"136":0.00962,_:"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 35 36 37 38 44 48 52 53 61 62 63 64 65 66 67 68 69 72 74 75 76 78 85 86 90 92 94 99 102 104 113 115 137 138"},F:{"46":0.00481,"86":0.07694,"87":0.07694,"88":0.00481,"95":0.00962,"114":0.00962,"115":0.00481,"116":0.10099,"117":1.07722,_:"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 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:{"12":0.00481,"13":0.00481,"14":0.00481,"15":0.00481,"16":0.00481,"17":0.01924,"18":0.06733,"84":0.00962,"89":0.01443,"90":0.01443,"92":0.1058,"100":0.00962,"106":0.01924,"109":0.03366,"110":0.03847,"111":0.00481,"114":0.02405,"116":0.00962,"118":0.00481,"121":0.00962,"122":0.01443,"124":0.00962,"125":0.01443,"126":0.01443,"128":0.00481,"129":0.01924,"130":0.02885,"131":0.12023,"132":0.08175,"133":1.77933,"134":3.85201,_:"79 80 81 83 85 86 87 88 91 93 94 95 96 97 98 99 101 102 103 104 105 107 108 112 113 115 117 119 120 123 127"},E:{"12":0.00481,_:"0 4 5 6 7 8 9 10 11 13 14 15 3.1 3.2 5.1 6.1 7.1 9.1 10.1 11.1 15.2-15.3 15.4 16.0 16.3 17.0 17.4","12.1":0.00962,"13.1":0.01443,"14.1":0.00962,"15.1":0.00962,"15.5":0.00481,"15.6":0.12023,"16.1":0.01924,"16.2":0.00481,"16.4":0.00962,"16.5":0.00962,"16.6":0.04809,"17.1":0.01443,"17.2":0.00481,"17.3":0.00962,"17.5":0.03366,"17.6":0.08175,"18.0":0.03366,"18.1":0.06252,"18.2":0.01443,"18.3":0.36068,"18.4":0.00481},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00119,"5.0-5.1":0,"6.0-6.1":0.00358,"7.0-7.1":0.00239,"8.1-8.4":0,"9.0-9.2":0.00179,"9.3":0.00836,"10.0-10.2":0.0006,"10.3":0.01374,"11.0-11.2":0.06333,"11.3-11.4":0.00418,"12.0-12.1":0.00239,"12.2-12.5":0.05915,"13.0-13.1":0.00119,"13.2":0.00179,"13.3":0.00239,"13.4-13.7":0.00836,"14.0-14.4":0.02091,"14.5-14.8":0.02509,"15.0-15.1":0.01374,"15.2-15.3":0.01374,"15.4":0.01673,"15.5":0.01912,"15.6-15.8":0.23541,"16.0":0.03346,"16.1":0.06871,"16.2":0.03585,"16.3":0.06214,"16.4":0.01374,"16.5":0.02569,"16.6-16.7":0.27903,"17.0":0.01673,"17.1":0.02987,"17.2":0.0227,"17.3":0.03167,"17.4":0.06333,"17.5":0.14101,"17.6-17.7":0.40928,"18.0":0.11472,"18.1":0.37522,"18.2":0.16789,"18.3":3.50902,"18.4":0.05198},P:{"4":0.04239,"21":0.0212,"22":0.0106,"23":0.0106,"24":0.03179,"25":0.0106,"26":0.03179,"27":0.44513,_:"20 5.0-5.4 8.2 10.1 11.1-11.2 12.0 13.0 14.0 15.0 16.0 17.0 18.0","6.2-6.4":0.0106,"7.2-7.4":0.03179,"9.2":0.09538,"19.0":0.0212},I:{"0":0.01554,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0,"4.4":0,"4.4.3-4.4.4":0.00002},K:{"0":3.52336,_:"10 11 12 11.1 11.5 12.1"},A:{"11":0.01443,_:"6 7 8 9 10 5.5"},S:{"2.5":0.01038,_:"3.0-3.1"},J:{_:"7 10"},N:{_:"10 11"},R:{_:"0"},M:{"0":0.08306},Q:{"14.9":0.01038},O:{"0":0.32184},H:{"0":1.46},L:{"0":50.60787}};
|
||||
@@ -0,0 +1,21 @@
|
||||
# picocolors
|
||||
|
||||
The tiniest and the fastest library for terminal output formatting with ANSI colors.
|
||||
|
||||
```javascript
|
||||
import pc from "picocolors"
|
||||
|
||||
console.log(
|
||||
pc.green(`How are ${pc.italic(`you`)} doing?`)
|
||||
)
|
||||
```
|
||||
|
||||
- **No dependencies.**
|
||||
- **14 times** smaller and **2 times** faster than chalk.
|
||||
- Used by popular tools like PostCSS, SVGO, Stylelint, and Browserslist.
|
||||
- Node.js v6+ & browsers support. Support for both CJS and ESM projects.
|
||||
- TypeScript type declarations included.
|
||||
- [`NO_COLOR`](https://no-color.org/) friendly.
|
||||
|
||||
## Docs
|
||||
Read **[full docs](https://github.com/alexeyraspopov/picocolors#readme)** on GitHub.
|
||||
@@ -0,0 +1,12 @@
|
||||
import { ErrorRouteComponent } from './route.cjs';
|
||||
import { ErrorInfo } from 'react';
|
||||
import * as React from 'react';
|
||||
export declare function CatchBoundary(props: {
|
||||
getResetKey: () => number | string;
|
||||
children: React.ReactNode;
|
||||
errorComponent?: ErrorRouteComponent;
|
||||
onCatch?: (error: Error, errorInfo: ErrorInfo) => void;
|
||||
}): import("react/jsx-runtime").JSX.Element;
|
||||
export declare function ErrorComponent({ error }: {
|
||||
error: any;
|
||||
}): import("react/jsx-runtime").JSX.Element;
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"2":"K D E F A mC","33":"B"},B:{"1":"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":"0 2 3 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 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 nC LC J PB K D E F A B C L M G N O P QB qC rC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 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","2":"J PB K D E F A"},E:{"1":"D E F A B C L M G 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","2":"J PB K sC SC tC"},F:{"1":"0 1 2 3 4 5 6 7 8 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","2":"F B C 4C 5C 6C 7C FC kC 8C GC"},G:{"1":"E 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","2":"SC 9C lC AD BD"},H:{"2":"WD"},I:{"1":"I bD cD","2":"LC J XD YD ZD aD lC"},J:{"1":"A","2":"D"},K:{"1":"H","2":"A B C FC kC GC"},L:{"1":"I"},M:{"1":"EC"},N:{"2":"A","33":"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:2,C:"crypto.getRandomValues()",D:true};
|
||||
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:{"1":"0 9 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","2":"C L M","578":"G"},C:{"1":"0 9 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":"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 qC rC","194":"kB lB mB nB oB","1025":"pB"},D:{"1":"0 9 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 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","322":"oB pB qB rB sB tB"},E:{"1":"B C L M G 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","2":"J PB K D E F A sC SC tC uC vC wC TC"},F:{"1":"0 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","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 4C 5C 6C 7C FC kC 8C GC","322":"bB cB dB eB fB gB"},G:{"1":"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","2":"E SC 9C lC AD BD CD DD ED FD GD HD"},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 fD gD hD TC iD jD kD lD mD IC JC KC nD","2":"J dD eD"},Q:{"1":"oD"},R:{"1":"pD"},S:{"1":"rD","194":"qD"}},B:6,C:"WebAssembly",D:true};
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
module.exports={C:{"52":0.00579,"75":0.00579,"78":0.02315,"113":0.00579,"115":0.1794,"125":0.01157,"127":0.00579,"128":0.05208,"131":0.00579,"132":0.02315,"133":0.01157,"134":0.02315,"135":0.42824,"136":1.75925,"137":0.00579,_:"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 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 76 77 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 108 109 110 111 112 114 116 117 118 119 120 121 122 123 124 126 129 130 138 139 140 3.5 3.6"},D:{"38":0.00579,"49":0.01157,"79":0.05208,"81":0.00579,"85":0.01157,"87":0.07523,"88":0.01157,"89":0.00579,"91":0.00579,"93":0.00579,"94":0.00579,"95":0.01157,"97":0.00579,"100":0.00579,"101":0.01157,"102":0.00579,"103":0.0463,"104":0.08681,"105":0.00579,"106":0.01157,"107":0.01736,"108":0.04051,"109":0.81597,"110":0.01157,"111":0.01736,"112":0.01157,"113":0.01157,"114":0.02315,"115":0.00579,"116":0.10995,"117":0.86226,"118":0.00579,"119":0.01157,"120":0.02894,"121":0.03472,"122":0.23148,"123":0.04051,"124":0.06366,"125":0.05208,"126":0.10995,"127":0.02894,"128":0.12153,"129":0.05787,"130":0.09838,"131":0.37616,"132":0.56713,"133":11.22099,"134":22.39569,"135":0.01736,_:"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 39 40 41 42 43 44 45 46 47 48 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 80 83 84 86 90 92 96 98 99 136 137 138"},F:{"36":0.00579,"46":0.00579,"73":0.00579,"79":0.01157,"87":0.01157,"88":0.00579,"89":0.01157,"95":0.01736,"102":0.00579,"113":0.00579,"114":0.01736,"115":0.00579,"116":1.44096,"117":3.10183,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 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 74 75 76 77 78 80 81 82 83 84 85 86 90 91 92 93 94 96 97 98 99 100 101 103 104 105 106 107 108 109 110 111 112 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"92":0.00579,"109":0.0463,"110":0.00579,"116":0.01157,"117":0.00579,"120":0.00579,"122":0.00579,"124":0.01157,"125":0.00579,"126":0.02315,"127":0.02894,"128":0.00579,"129":0.01736,"130":0.01736,"131":0.05787,"132":0.18518,"133":2.03124,"134":5.21409,_:"12 13 14 15 16 17 18 79 80 81 83 84 85 86 87 88 89 90 91 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 111 112 113 114 115 118 119 121 123"},E:{"14":0.01157,_:"0 4 5 6 7 8 9 10 11 12 13 15 3.1 3.2 5.1 6.1 7.1 9.1 10.1 11.1","12.1":0.00579,"13.1":0.03472,"14.1":0.0463,"15.1":0.00579,"15.2-15.3":0.00579,"15.4":0.00579,"15.5":0.01157,"15.6":0.12731,"16.0":0.01736,"16.1":0.02315,"16.2":0.02315,"16.3":0.04051,"16.4":0.01157,"16.5":0.02894,"16.6":0.16782,"17.0":0.02315,"17.1":0.08681,"17.2":0.03472,"17.3":0.04051,"17.4":0.0463,"17.5":0.14468,"17.6":0.30092,"18.0":0.05787,"18.1":0.15625,"18.2":0.08681,"18.3":1.75346,"18.4":0.05787},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00225,"5.0-5.1":0,"6.0-6.1":0.00675,"7.0-7.1":0.0045,"8.1-8.4":0,"9.0-9.2":0.00337,"9.3":0.01575,"10.0-10.2":0.00112,"10.3":0.02587,"11.0-11.2":0.11924,"11.3-11.4":0.00787,"12.0-12.1":0.0045,"12.2-12.5":0.11136,"13.0-13.1":0.00225,"13.2":0.00337,"13.3":0.0045,"13.4-13.7":0.01575,"14.0-14.4":0.03937,"14.5-14.8":0.04724,"15.0-15.1":0.02587,"15.2-15.3":0.02587,"15.4":0.0315,"15.5":0.036,"15.6-15.8":0.4432,"16.0":0.06299,"16.1":0.12936,"16.2":0.06749,"16.3":0.11699,"16.4":0.02587,"16.5":0.04837,"16.6-16.7":0.52531,"17.0":0.0315,"17.1":0.05624,"17.2":0.04275,"17.3":0.05962,"17.4":0.11924,"17.5":0.26547,"17.6-17.7":0.77054,"18.0":0.21598,"18.1":0.70642,"18.2":0.31609,"18.3":6.60637,"18.4":0.09786},P:{"4":0.05151,"21":0.0103,"22":0.0206,"23":0.0206,"24":0.0206,"25":0.0309,"26":0.0412,"27":1.52457,_:"20 8.2 9.2 10.1 11.1-11.2 12.0 14.0 15.0 16.0 17.0 18.0 19.0","5.0-5.4":0.0103,"6.2-6.4":0.0103,"7.2-7.4":0.0103,"13.0":0.0206},I:{"0":0.03784,"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.28648,_:"10 11 12 11.1 11.5 12.1"},A:{"11":0.02315,_:"6 7 8 9 10 5.5"},S:{_:"2.5 3.0-3.1"},J:{_:"7 10"},N:{_:"10 11"},R:{_:"0"},M:{"0":0.23172},Q:{"14.9":0.00421},O:{"0":0.07162},H:{"0":0},L:{"0":28.78371}};
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"1":"F A B","16":"mC","516":"E","1540":"K D"},B:{"1":"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":"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","132":"LC","260":"nC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 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","16":"PB K D E","132":"J"},E:{"1":"K D E F A B C L M G 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","16":"PB sC","132":"J SC"},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 8C GC","16":"F 4C","260":"B 5C 6C 7C FC kC"},G:{"1":"E 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","16":"SC 9C lC"},H:{"1":"WD"},I:{"1":"LC J I aD lC bD cD","16":"XD YD","132":"ZD"},J:{"1":"D A"},K:{"1":"C H GC","260":"A B FC kC"},L:{"1":"I"},M:{"1":"EC"},N:{"1":"A 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:2,C:"::first-letter CSS pseudo-element selector",D:true};
|
||||
@@ -0,0 +1,300 @@
|
||||
/**
|
||||
* @fileoverview Checks for unreachable code due to return, throws, break, and continue.
|
||||
* @author Joel Feenstra
|
||||
*/
|
||||
"use strict";
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Helpers
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* @typedef {Object} ConstructorInfo
|
||||
* @property {ConstructorInfo | null} upper Info about the constructor that encloses this constructor.
|
||||
* @property {boolean} hasSuperCall The flag about having `super()` expressions.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Checks whether or not a given variable declarator has the initializer.
|
||||
* @param {ASTNode} node A VariableDeclarator node to check.
|
||||
* @returns {boolean} `true` if the node has the initializer.
|
||||
*/
|
||||
function isInitialized(node) {
|
||||
return Boolean(node.init);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks all segments in a set and returns true if all are unreachable.
|
||||
* @param {Set<CodePathSegment>} segments The segments to check.
|
||||
* @returns {boolean} True if all segments are unreachable; false otherwise.
|
||||
*/
|
||||
function areAllSegmentsUnreachable(segments) {
|
||||
for (const segment of segments) {
|
||||
if (segment.reachable) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* The class to distinguish consecutive unreachable statements.
|
||||
*/
|
||||
class ConsecutiveRange {
|
||||
constructor(sourceCode) {
|
||||
this.sourceCode = sourceCode;
|
||||
this.startNode = null;
|
||||
this.endNode = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* The location object of this range.
|
||||
* @type {Object}
|
||||
*/
|
||||
get location() {
|
||||
return {
|
||||
start: this.startNode.loc.start,
|
||||
end: this.endNode.loc.end,
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* `true` if this range is empty.
|
||||
* @type {boolean}
|
||||
*/
|
||||
get isEmpty() {
|
||||
return !(this.startNode && this.endNode);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether the given node is inside of this range.
|
||||
* @param {ASTNode|Token} node The node to check.
|
||||
* @returns {boolean} `true` if the node is inside of this range.
|
||||
*/
|
||||
contains(node) {
|
||||
return (
|
||||
node.range[0] >= this.startNode.range[0] &&
|
||||
node.range[1] <= this.endNode.range[1]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether the given node is consecutive to this range.
|
||||
* @param {ASTNode} node The node to check.
|
||||
* @returns {boolean} `true` if the node is consecutive to this range.
|
||||
*/
|
||||
isConsecutive(node) {
|
||||
return this.contains(this.sourceCode.getTokenBefore(node));
|
||||
}
|
||||
|
||||
/**
|
||||
* Merges the given node to this range.
|
||||
* @param {ASTNode} node The node to merge.
|
||||
* @returns {void}
|
||||
*/
|
||||
merge(node) {
|
||||
this.endNode = node;
|
||||
}
|
||||
|
||||
/**
|
||||
* Resets this range by the given node or null.
|
||||
* @param {ASTNode|null} node The node to reset, or null.
|
||||
* @returns {void}
|
||||
*/
|
||||
reset(node) {
|
||||
this.startNode = this.endNode = node;
|
||||
}
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Rule Definition
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
/** @type {import('../shared/types').Rule} */
|
||||
module.exports = {
|
||||
meta: {
|
||||
type: "problem",
|
||||
|
||||
docs: {
|
||||
description:
|
||||
"Disallow unreachable code after `return`, `throw`, `continue`, and `break` statements",
|
||||
recommended: true,
|
||||
url: "https://eslint.org/docs/latest/rules/no-unreachable",
|
||||
},
|
||||
|
||||
schema: [],
|
||||
|
||||
messages: {
|
||||
unreachableCode: "Unreachable code.",
|
||||
},
|
||||
},
|
||||
|
||||
create(context) {
|
||||
/** @type {ConstructorInfo | null} */
|
||||
let constructorInfo = null;
|
||||
|
||||
/** @type {ConsecutiveRange} */
|
||||
const range = new ConsecutiveRange(context.sourceCode);
|
||||
|
||||
/** @type {Array<Set<CodePathSegment>>} */
|
||||
const codePathSegments = [];
|
||||
|
||||
/** @type {Set<CodePathSegment>} */
|
||||
let currentCodePathSegments = new Set();
|
||||
|
||||
/**
|
||||
* Reports a given node if it's unreachable.
|
||||
* @param {ASTNode} node A statement node to report.
|
||||
* @returns {void}
|
||||
*/
|
||||
function reportIfUnreachable(node) {
|
||||
let nextNode = null;
|
||||
|
||||
if (
|
||||
node &&
|
||||
(node.type === "PropertyDefinition" ||
|
||||
areAllSegmentsUnreachable(currentCodePathSegments))
|
||||
) {
|
||||
// Store this statement to distinguish consecutive statements.
|
||||
if (range.isEmpty) {
|
||||
range.reset(node);
|
||||
return;
|
||||
}
|
||||
|
||||
// Skip if this statement is inside of the current range.
|
||||
if (range.contains(node)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Merge if this statement is consecutive to the current range.
|
||||
if (range.isConsecutive(node)) {
|
||||
range.merge(node);
|
||||
return;
|
||||
}
|
||||
|
||||
nextNode = node;
|
||||
}
|
||||
|
||||
/*
|
||||
* Report the current range since this statement is reachable or is
|
||||
* not consecutive to the current range.
|
||||
*/
|
||||
if (!range.isEmpty) {
|
||||
context.report({
|
||||
messageId: "unreachableCode",
|
||||
loc: range.location,
|
||||
node: range.startNode,
|
||||
});
|
||||
}
|
||||
|
||||
// Update the current range.
|
||||
range.reset(nextNode);
|
||||
}
|
||||
|
||||
return {
|
||||
// Manages the current code path.
|
||||
onCodePathStart() {
|
||||
codePathSegments.push(currentCodePathSegments);
|
||||
currentCodePathSegments = new Set();
|
||||
},
|
||||
|
||||
onCodePathEnd() {
|
||||
currentCodePathSegments = codePathSegments.pop();
|
||||
},
|
||||
|
||||
onUnreachableCodePathSegmentStart(segment) {
|
||||
currentCodePathSegments.add(segment);
|
||||
},
|
||||
|
||||
onUnreachableCodePathSegmentEnd(segment) {
|
||||
currentCodePathSegments.delete(segment);
|
||||
},
|
||||
|
||||
onCodePathSegmentEnd(segment) {
|
||||
currentCodePathSegments.delete(segment);
|
||||
},
|
||||
|
||||
onCodePathSegmentStart(segment) {
|
||||
currentCodePathSegments.add(segment);
|
||||
},
|
||||
|
||||
// Registers for all statement nodes (excludes FunctionDeclaration).
|
||||
BlockStatement: reportIfUnreachable,
|
||||
BreakStatement: reportIfUnreachable,
|
||||
ClassDeclaration: reportIfUnreachable,
|
||||
ContinueStatement: reportIfUnreachable,
|
||||
DebuggerStatement: reportIfUnreachable,
|
||||
DoWhileStatement: reportIfUnreachable,
|
||||
ExpressionStatement: reportIfUnreachable,
|
||||
ForInStatement: reportIfUnreachable,
|
||||
ForOfStatement: reportIfUnreachable,
|
||||
ForStatement: reportIfUnreachable,
|
||||
IfStatement: reportIfUnreachable,
|
||||
ImportDeclaration: reportIfUnreachable,
|
||||
LabeledStatement: reportIfUnreachable,
|
||||
ReturnStatement: reportIfUnreachable,
|
||||
SwitchStatement: reportIfUnreachable,
|
||||
ThrowStatement: reportIfUnreachable,
|
||||
TryStatement: reportIfUnreachable,
|
||||
|
||||
VariableDeclaration(node) {
|
||||
if (
|
||||
node.kind !== "var" ||
|
||||
node.declarations.some(isInitialized)
|
||||
) {
|
||||
reportIfUnreachable(node);
|
||||
}
|
||||
},
|
||||
|
||||
WhileStatement: reportIfUnreachable,
|
||||
WithStatement: reportIfUnreachable,
|
||||
ExportNamedDeclaration: reportIfUnreachable,
|
||||
ExportDefaultDeclaration: reportIfUnreachable,
|
||||
ExportAllDeclaration: reportIfUnreachable,
|
||||
|
||||
"Program:exit"() {
|
||||
reportIfUnreachable();
|
||||
},
|
||||
|
||||
/*
|
||||
* Instance fields defined in a subclass are never created if the constructor of the subclass
|
||||
* doesn't call `super()`, so their definitions are unreachable code.
|
||||
*/
|
||||
"MethodDefinition[kind='constructor']"() {
|
||||
constructorInfo = {
|
||||
upper: constructorInfo,
|
||||
hasSuperCall: false,
|
||||
};
|
||||
},
|
||||
"MethodDefinition[kind='constructor']:exit"(node) {
|
||||
const { hasSuperCall } = constructorInfo;
|
||||
|
||||
constructorInfo = constructorInfo.upper;
|
||||
|
||||
// skip typescript constructors without the body
|
||||
if (!node.value.body) {
|
||||
return;
|
||||
}
|
||||
|
||||
const classDefinition = node.parent.parent;
|
||||
|
||||
if (classDefinition.superClass && !hasSuperCall) {
|
||||
for (const element of classDefinition.body.body) {
|
||||
if (
|
||||
element.type === "PropertyDefinition" &&
|
||||
!element.static
|
||||
) {
|
||||
reportIfUnreachable(element);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"CallExpression > Super.callee"() {
|
||||
if (constructorInfo) {
|
||||
constructorInfo.hasSuperCall = true;
|
||||
}
|
||||
},
|
||||
};
|
||||
},
|
||||
};
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"names":["_classApplyDescriptorSet","receiver","descriptor","value","set","call","writable","TypeError"],"sources":["../../src/helpers/classApplyDescriptorSet.js"],"sourcesContent":["/* @minVersion 7.13.10 */\n/* @onlyBabel7 */\n\nexport default function _classApplyDescriptorSet(receiver, descriptor, value) {\n if (descriptor.set) {\n descriptor.set.call(receiver, value);\n } else {\n if (!descriptor.writable) {\n // This should only throw in strict mode, but class bodies are\n // always strict and private fields can only be used inside\n // class bodies.\n throw new TypeError(\"attempted to set read only private field\");\n }\n descriptor.value = value;\n }\n}\n"],"mappings":";;;;;;AAGe,SAASA,wBAAwBA,CAACC,QAAQ,EAAEC,UAAU,EAAEC,KAAK,EAAE;EAC5E,IAAID,UAAU,CAACE,GAAG,EAAE;IAClBF,UAAU,CAACE,GAAG,CAACC,IAAI,CAACJ,QAAQ,EAAEE,KAAK,CAAC;EACtC,CAAC,MAAM;IACL,IAAI,CAACD,UAAU,CAACI,QAAQ,EAAE;MAIxB,MAAM,IAAIC,SAAS,CAAC,0CAA0C,CAAC;IACjE;IACAL,UAAU,CAACC,KAAK,GAAGA,KAAK;EAC1B;AACF","ignoreList":[]}
|
||||
@@ -0,0 +1,361 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = normalizeModuleAndLoadMetadata;
|
||||
exports.hasExports = hasExports;
|
||||
exports.isSideEffectImport = isSideEffectImport;
|
||||
exports.validateImportInteropOption = validateImportInteropOption;
|
||||
var _path = require("path");
|
||||
var _helperValidatorIdentifier = require("@babel/helper-validator-identifier");
|
||||
function hasExports(metadata) {
|
||||
return metadata.hasExports;
|
||||
}
|
||||
function isSideEffectImport(source) {
|
||||
return source.imports.size === 0 && source.importsNamespace.size === 0 && source.reexports.size === 0 && source.reexportNamespace.size === 0 && !source.reexportAll;
|
||||
}
|
||||
function validateImportInteropOption(importInterop) {
|
||||
if (typeof importInterop !== "function" && importInterop !== "none" && importInterop !== "babel" && importInterop !== "node") {
|
||||
throw new Error(`.importInterop must be one of "none", "babel", "node", or a function returning one of those values (received ${importInterop}).`);
|
||||
}
|
||||
return importInterop;
|
||||
}
|
||||
function resolveImportInterop(importInterop, source, filename) {
|
||||
if (typeof importInterop === "function") {
|
||||
return validateImportInteropOption(importInterop(source, filename));
|
||||
}
|
||||
return importInterop;
|
||||
}
|
||||
function normalizeModuleAndLoadMetadata(programPath, exportName, {
|
||||
importInterop,
|
||||
initializeReexports = false,
|
||||
getWrapperPayload,
|
||||
esNamespaceOnly = false,
|
||||
filename
|
||||
}) {
|
||||
if (!exportName) {
|
||||
exportName = programPath.scope.generateUidIdentifier("exports").name;
|
||||
}
|
||||
const stringSpecifiers = new Set();
|
||||
nameAnonymousExports(programPath);
|
||||
const {
|
||||
local,
|
||||
sources,
|
||||
hasExports
|
||||
} = getModuleMetadata(programPath, {
|
||||
initializeReexports,
|
||||
getWrapperPayload
|
||||
}, stringSpecifiers);
|
||||
removeImportExportDeclarations(programPath);
|
||||
for (const [source, metadata] of sources) {
|
||||
const {
|
||||
importsNamespace,
|
||||
imports
|
||||
} = metadata;
|
||||
if (importsNamespace.size > 0 && imports.size === 0) {
|
||||
const [nameOfnamespace] = importsNamespace;
|
||||
metadata.name = nameOfnamespace;
|
||||
}
|
||||
const resolvedInterop = resolveImportInterop(importInterop, source, filename);
|
||||
if (resolvedInterop === "none") {
|
||||
metadata.interop = "none";
|
||||
} else if (resolvedInterop === "node" && metadata.interop === "namespace") {
|
||||
metadata.interop = "node-namespace";
|
||||
} else if (resolvedInterop === "node" && metadata.interop === "default") {
|
||||
metadata.interop = "node-default";
|
||||
} else if (esNamespaceOnly && metadata.interop === "namespace") {
|
||||
metadata.interop = "default";
|
||||
}
|
||||
}
|
||||
return {
|
||||
exportName,
|
||||
exportNameListName: null,
|
||||
hasExports,
|
||||
local,
|
||||
source: sources,
|
||||
stringSpecifiers
|
||||
};
|
||||
}
|
||||
function getExportSpecifierName(path, stringSpecifiers) {
|
||||
if (path.isIdentifier()) {
|
||||
return path.node.name;
|
||||
} else if (path.isStringLiteral()) {
|
||||
const stringValue = path.node.value;
|
||||
if (!(0, _helperValidatorIdentifier.isIdentifierName)(stringValue)) {
|
||||
stringSpecifiers.add(stringValue);
|
||||
}
|
||||
return stringValue;
|
||||
} else {
|
||||
throw new Error(`Expected export specifier to be either Identifier or StringLiteral, got ${path.node.type}`);
|
||||
}
|
||||
}
|
||||
function assertExportSpecifier(path) {
|
||||
if (path.isExportSpecifier()) {
|
||||
return;
|
||||
} else if (path.isExportNamespaceSpecifier()) {
|
||||
throw path.buildCodeFrameError("Export namespace should be first transformed by `@babel/plugin-transform-export-namespace-from`.");
|
||||
} else {
|
||||
throw path.buildCodeFrameError("Unexpected export specifier type");
|
||||
}
|
||||
}
|
||||
function getModuleMetadata(programPath, {
|
||||
getWrapperPayload,
|
||||
initializeReexports
|
||||
}, stringSpecifiers) {
|
||||
const localData = getLocalExportMetadata(programPath, initializeReexports, stringSpecifiers);
|
||||
const importNodes = new Map();
|
||||
const sourceData = new Map();
|
||||
const getData = (sourceNode, node) => {
|
||||
const source = sourceNode.value;
|
||||
let data = sourceData.get(source);
|
||||
if (!data) {
|
||||
data = {
|
||||
name: programPath.scope.generateUidIdentifier((0, _path.basename)(source, (0, _path.extname)(source))).name,
|
||||
interop: "none",
|
||||
loc: null,
|
||||
imports: new Map(),
|
||||
importsNamespace: new Set(),
|
||||
reexports: new Map(),
|
||||
reexportNamespace: new Set(),
|
||||
reexportAll: null,
|
||||
wrap: null,
|
||||
get lazy() {
|
||||
return this.wrap === "lazy";
|
||||
},
|
||||
referenced: false
|
||||
};
|
||||
sourceData.set(source, data);
|
||||
importNodes.set(source, [node]);
|
||||
} else {
|
||||
importNodes.get(source).push(node);
|
||||
}
|
||||
return data;
|
||||
};
|
||||
let hasExports = false;
|
||||
programPath.get("body").forEach(child => {
|
||||
if (child.isImportDeclaration()) {
|
||||
const data = getData(child.node.source, child.node);
|
||||
if (!data.loc) data.loc = child.node.loc;
|
||||
child.get("specifiers").forEach(spec => {
|
||||
if (spec.isImportDefaultSpecifier()) {
|
||||
const localName = spec.get("local").node.name;
|
||||
data.imports.set(localName, "default");
|
||||
const reexport = localData.get(localName);
|
||||
if (reexport) {
|
||||
localData.delete(localName);
|
||||
reexport.names.forEach(name => {
|
||||
data.reexports.set(name, "default");
|
||||
});
|
||||
data.referenced = true;
|
||||
}
|
||||
} else if (spec.isImportNamespaceSpecifier()) {
|
||||
const localName = spec.get("local").node.name;
|
||||
data.importsNamespace.add(localName);
|
||||
const reexport = localData.get(localName);
|
||||
if (reexport) {
|
||||
localData.delete(localName);
|
||||
reexport.names.forEach(name => {
|
||||
data.reexportNamespace.add(name);
|
||||
});
|
||||
data.referenced = true;
|
||||
}
|
||||
} else if (spec.isImportSpecifier()) {
|
||||
const importName = getExportSpecifierName(spec.get("imported"), stringSpecifiers);
|
||||
const localName = spec.get("local").node.name;
|
||||
data.imports.set(localName, importName);
|
||||
const reexport = localData.get(localName);
|
||||
if (reexport) {
|
||||
localData.delete(localName);
|
||||
reexport.names.forEach(name => {
|
||||
data.reexports.set(name, importName);
|
||||
});
|
||||
data.referenced = true;
|
||||
}
|
||||
}
|
||||
});
|
||||
} else if (child.isExportAllDeclaration()) {
|
||||
hasExports = true;
|
||||
const data = getData(child.node.source, child.node);
|
||||
if (!data.loc) data.loc = child.node.loc;
|
||||
data.reexportAll = {
|
||||
loc: child.node.loc
|
||||
};
|
||||
data.referenced = true;
|
||||
} else if (child.isExportNamedDeclaration() && child.node.source) {
|
||||
hasExports = true;
|
||||
const data = getData(child.node.source, child.node);
|
||||
if (!data.loc) data.loc = child.node.loc;
|
||||
child.get("specifiers").forEach(spec => {
|
||||
assertExportSpecifier(spec);
|
||||
const importName = getExportSpecifierName(spec.get("local"), stringSpecifiers);
|
||||
const exportName = getExportSpecifierName(spec.get("exported"), stringSpecifiers);
|
||||
data.reexports.set(exportName, importName);
|
||||
data.referenced = true;
|
||||
if (exportName === "__esModule") {
|
||||
throw spec.get("exported").buildCodeFrameError('Illegal export "__esModule".');
|
||||
}
|
||||
});
|
||||
} else if (child.isExportNamedDeclaration() || child.isExportDefaultDeclaration()) {
|
||||
hasExports = true;
|
||||
}
|
||||
});
|
||||
for (const metadata of sourceData.values()) {
|
||||
let needsDefault = false;
|
||||
let needsNamed = false;
|
||||
if (metadata.importsNamespace.size > 0) {
|
||||
needsDefault = true;
|
||||
needsNamed = true;
|
||||
}
|
||||
if (metadata.reexportAll) {
|
||||
needsNamed = true;
|
||||
}
|
||||
for (const importName of metadata.imports.values()) {
|
||||
if (importName === "default") needsDefault = true;else needsNamed = true;
|
||||
}
|
||||
for (const importName of metadata.reexports.values()) {
|
||||
if (importName === "default") needsDefault = true;else needsNamed = true;
|
||||
}
|
||||
if (needsDefault && needsNamed) {
|
||||
metadata.interop = "namespace";
|
||||
} else if (needsDefault) {
|
||||
metadata.interop = "default";
|
||||
}
|
||||
}
|
||||
if (getWrapperPayload) {
|
||||
for (const [source, metadata] of sourceData) {
|
||||
metadata.wrap = getWrapperPayload(source, metadata, importNodes.get(source));
|
||||
}
|
||||
}
|
||||
return {
|
||||
hasExports,
|
||||
local: localData,
|
||||
sources: sourceData
|
||||
};
|
||||
}
|
||||
function getLocalExportMetadata(programPath, initializeReexports, stringSpecifiers) {
|
||||
const bindingKindLookup = new Map();
|
||||
programPath.get("body").forEach(child => {
|
||||
let kind;
|
||||
if (child.isImportDeclaration()) {
|
||||
kind = "import";
|
||||
} else {
|
||||
if (child.isExportDefaultDeclaration()) {
|
||||
child = child.get("declaration");
|
||||
}
|
||||
if (child.isExportNamedDeclaration()) {
|
||||
if (child.node.declaration) {
|
||||
child = child.get("declaration");
|
||||
} else if (initializeReexports && child.node.source && child.get("source").isStringLiteral()) {
|
||||
child.get("specifiers").forEach(spec => {
|
||||
assertExportSpecifier(spec);
|
||||
bindingKindLookup.set(spec.get("local").node.name, "block");
|
||||
});
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (child.isFunctionDeclaration()) {
|
||||
kind = "hoisted";
|
||||
} else if (child.isClassDeclaration()) {
|
||||
kind = "block";
|
||||
} else if (child.isVariableDeclaration({
|
||||
kind: "var"
|
||||
})) {
|
||||
kind = "var";
|
||||
} else if (child.isVariableDeclaration()) {
|
||||
kind = "block";
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
Object.keys(child.getOuterBindingIdentifiers()).forEach(name => {
|
||||
bindingKindLookup.set(name, kind);
|
||||
});
|
||||
});
|
||||
const localMetadata = new Map();
|
||||
const getLocalMetadata = idPath => {
|
||||
const localName = idPath.node.name;
|
||||
let metadata = localMetadata.get(localName);
|
||||
if (!metadata) {
|
||||
const kind = bindingKindLookup.get(localName);
|
||||
if (kind === undefined) {
|
||||
throw idPath.buildCodeFrameError(`Exporting local "${localName}", which is not declared.`);
|
||||
}
|
||||
metadata = {
|
||||
names: [],
|
||||
kind
|
||||
};
|
||||
localMetadata.set(localName, metadata);
|
||||
}
|
||||
return metadata;
|
||||
};
|
||||
programPath.get("body").forEach(child => {
|
||||
if (child.isExportNamedDeclaration() && (initializeReexports || !child.node.source)) {
|
||||
if (child.node.declaration) {
|
||||
const declaration = child.get("declaration");
|
||||
const ids = declaration.getOuterBindingIdentifierPaths();
|
||||
Object.keys(ids).forEach(name => {
|
||||
if (name === "__esModule") {
|
||||
throw declaration.buildCodeFrameError('Illegal export "__esModule".');
|
||||
}
|
||||
getLocalMetadata(ids[name]).names.push(name);
|
||||
});
|
||||
} else {
|
||||
child.get("specifiers").forEach(spec => {
|
||||
const local = spec.get("local");
|
||||
const exported = spec.get("exported");
|
||||
const localMetadata = getLocalMetadata(local);
|
||||
const exportName = getExportSpecifierName(exported, stringSpecifiers);
|
||||
if (exportName === "__esModule") {
|
||||
throw exported.buildCodeFrameError('Illegal export "__esModule".');
|
||||
}
|
||||
localMetadata.names.push(exportName);
|
||||
});
|
||||
}
|
||||
} else if (child.isExportDefaultDeclaration()) {
|
||||
const declaration = child.get("declaration");
|
||||
if (declaration.isFunctionDeclaration() || declaration.isClassDeclaration()) {
|
||||
getLocalMetadata(declaration.get("id")).names.push("default");
|
||||
} else {
|
||||
throw declaration.buildCodeFrameError("Unexpected default expression export.");
|
||||
}
|
||||
}
|
||||
});
|
||||
return localMetadata;
|
||||
}
|
||||
function nameAnonymousExports(programPath) {
|
||||
programPath.get("body").forEach(child => {
|
||||
if (!child.isExportDefaultDeclaration()) return;
|
||||
{
|
||||
var _child$splitExportDec;
|
||||
(_child$splitExportDec = child.splitExportDeclaration) != null ? _child$splitExportDec : child.splitExportDeclaration = require("@babel/traverse").NodePath.prototype.splitExportDeclaration;
|
||||
}
|
||||
child.splitExportDeclaration();
|
||||
});
|
||||
}
|
||||
function removeImportExportDeclarations(programPath) {
|
||||
programPath.get("body").forEach(child => {
|
||||
if (child.isImportDeclaration()) {
|
||||
child.remove();
|
||||
} else if (child.isExportNamedDeclaration()) {
|
||||
if (child.node.declaration) {
|
||||
child.node.declaration._blockHoist = child.node._blockHoist;
|
||||
child.replaceWith(child.node.declaration);
|
||||
} else {
|
||||
child.remove();
|
||||
}
|
||||
} else if (child.isExportDefaultDeclaration()) {
|
||||
const declaration = child.get("declaration");
|
||||
if (declaration.isFunctionDeclaration() || declaration.isClassDeclaration()) {
|
||||
declaration._blockHoist = child.node._blockHoist;
|
||||
child.replaceWith(declaration);
|
||||
} else {
|
||||
throw declaration.buildCodeFrameError("Unexpected default expression export.");
|
||||
}
|
||||
} else if (child.isExportAllDeclaration()) {
|
||||
child.remove();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//# sourceMappingURL=normalize-and-load-metadata.js.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
||||
@@ -0,0 +1,34 @@
|
||||
{
|
||||
"name": "json-buffer",
|
||||
"description": "JSON parse & stringify that supports binary via bops & base64",
|
||||
"version": "3.0.1",
|
||||
"homepage": "https://github.com/dominictarr/json-buffer",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/dominictarr/json-buffer.git"
|
||||
},
|
||||
"devDependencies": {
|
||||
"tape": "^4.6.3"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "set -e; for t in test/*.js; do node $t; done"
|
||||
},
|
||||
"author": "Dominic Tarr <dominic.tarr@gmail.com> (http://dominictarr.com)",
|
||||
"license": "MIT",
|
||||
"testling": {
|
||||
"files": "test/*.js",
|
||||
"browsers": [
|
||||
"ie/8..latest",
|
||||
"firefox/17..latest",
|
||||
"firefox/nightly",
|
||||
"chrome/22..latest",
|
||||
"chrome/canary",
|
||||
"opera/12..latest",
|
||||
"opera/next",
|
||||
"safari/5.1..latest",
|
||||
"ipad/6.0..latest",
|
||||
"iphone/6.0..latest",
|
||||
"android-browser/4.2..latest"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"2":"K D E F mC","132":"A B"},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","132":"C L M G N O","516":"P"},C:{"1":"0 9 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":"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 qC rC"},D:{"1":"0 9 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 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","260":"yB zB"},E:{"1":"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","1090":"G yC zC UC VC HC 0C"},F:{"1":"0 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","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 4C 5C 6C 7C FC kC 8C GC","260":"nB oB"},G:{"1":"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","1090":"RD SD UC VC HC TD"},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:{"132":"A B"},O:{"1":"HC"},P:{"1":"1 2 3 4 5 6 7 8 gD hD TC iD jD kD lD mD IC JC KC nD","2":"J dD eD fD"},Q:{"1":"oD"},R:{"1":"pD"},S:{"1":"rD","2":"qD"}},B:5,C:"CSS overscroll-behavior",D:true};
|
||||
@@ -0,0 +1,335 @@
|
||||
/**
|
||||
* @fileoverview JavaScript Language Object
|
||||
* @author Nicholas C. Zakas
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Requirements
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
const { SourceCode } = require("./source-code");
|
||||
const createDebug = require("debug");
|
||||
const astUtils = require("../../shared/ast-utils");
|
||||
const espree = require("espree");
|
||||
const eslintScope = require("eslint-scope");
|
||||
const evk = require("eslint-visitor-keys");
|
||||
const { validateLanguageOptions } = require("./validate-language-options");
|
||||
const { LATEST_ECMA_VERSION } = require("../../../conf/ecma-version");
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Type Definitions
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
/** @typedef {import("@eslint/core").File} File */
|
||||
/** @typedef {import("@eslint/core").Language} Language */
|
||||
/** @typedef {import("@eslint/core").OkParseResult} OkParseResult */
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Helpers
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
const debug = createDebug("eslint:languages:js");
|
||||
const DEFAULT_ECMA_VERSION = 5;
|
||||
const parserSymbol = Symbol.for("eslint.RuleTester.parser");
|
||||
|
||||
/**
|
||||
* Analyze scope of the given AST.
|
||||
* @param {ASTNode} ast The `Program` node to analyze.
|
||||
* @param {LanguageOptions} languageOptions The parser options.
|
||||
* @param {Record<string, string[]>} visitorKeys The visitor keys.
|
||||
* @returns {ScopeManager} The analysis result.
|
||||
*/
|
||||
function analyzeScope(ast, languageOptions, visitorKeys) {
|
||||
const parserOptions = languageOptions.parserOptions;
|
||||
const ecmaFeatures = parserOptions.ecmaFeatures || {};
|
||||
const ecmaVersion = languageOptions.ecmaVersion || DEFAULT_ECMA_VERSION;
|
||||
|
||||
return eslintScope.analyze(ast, {
|
||||
ignoreEval: true,
|
||||
nodejsScope: ecmaFeatures.globalReturn,
|
||||
impliedStrict: ecmaFeatures.impliedStrict,
|
||||
ecmaVersion: typeof ecmaVersion === "number" ? ecmaVersion : 6,
|
||||
sourceType: languageOptions.sourceType || "script",
|
||||
childVisitorKeys: visitorKeys || evk.KEYS,
|
||||
fallback: evk.getKeys,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines if a given object is Espree.
|
||||
* @param {Object} parser The parser to check.
|
||||
* @returns {boolean} True if the parser is Espree or false if not.
|
||||
*/
|
||||
function isEspree(parser) {
|
||||
return !!(parser === espree || parser[parserSymbol] === espree);
|
||||
}
|
||||
|
||||
/**
|
||||
* Normalize ECMAScript version from the initial config into languageOptions (year)
|
||||
* format.
|
||||
* @param {any} [ecmaVersion] ECMAScript version from the initial config
|
||||
* @returns {number} normalized ECMAScript version
|
||||
*/
|
||||
function normalizeEcmaVersionForLanguageOptions(ecmaVersion) {
|
||||
switch (ecmaVersion) {
|
||||
case 3:
|
||||
return 3;
|
||||
|
||||
// void 0 = no ecmaVersion specified so use the default
|
||||
case 5:
|
||||
case void 0:
|
||||
return 5;
|
||||
|
||||
default:
|
||||
if (typeof ecmaVersion === "number") {
|
||||
return ecmaVersion >= 2015 ? ecmaVersion : ecmaVersion + 2009;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* We default to the latest supported ecmaVersion for everything else.
|
||||
* Remember, this is for languageOptions.ecmaVersion, which sets the version
|
||||
* that is used for a number of processes inside of ESLint. It's normally
|
||||
* safe to assume people want the latest unless otherwise specified.
|
||||
*/
|
||||
return LATEST_ECMA_VERSION;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Exports
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* @type {Language}
|
||||
*/
|
||||
module.exports = {
|
||||
fileType: "text",
|
||||
lineStart: 1,
|
||||
columnStart: 0,
|
||||
nodeTypeKey: "type",
|
||||
visitorKeys: evk.KEYS,
|
||||
|
||||
defaultLanguageOptions: {
|
||||
sourceType: "module",
|
||||
ecmaVersion: "latest",
|
||||
parser: espree,
|
||||
parserOptions: {},
|
||||
},
|
||||
|
||||
validateLanguageOptions,
|
||||
|
||||
/**
|
||||
* Normalizes the language options.
|
||||
* @param {Object} languageOptions The language options to normalize.
|
||||
* @returns {Object} The normalized language options.
|
||||
*/
|
||||
normalizeLanguageOptions(languageOptions) {
|
||||
languageOptions.ecmaVersion = normalizeEcmaVersionForLanguageOptions(
|
||||
languageOptions.ecmaVersion,
|
||||
);
|
||||
|
||||
// Espree expects this information to be passed in
|
||||
if (isEspree(languageOptions.parser)) {
|
||||
const parserOptions = languageOptions.parserOptions;
|
||||
|
||||
if (languageOptions.sourceType) {
|
||||
parserOptions.sourceType = languageOptions.sourceType;
|
||||
|
||||
if (
|
||||
parserOptions.sourceType === "module" &&
|
||||
parserOptions.ecmaFeatures &&
|
||||
parserOptions.ecmaFeatures.globalReturn
|
||||
) {
|
||||
parserOptions.ecmaFeatures.globalReturn = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return languageOptions;
|
||||
},
|
||||
|
||||
/**
|
||||
* Determines if a given node matches a given selector class.
|
||||
* @param {string} className The class name to check.
|
||||
* @param {ASTNode} node The node to check.
|
||||
* @param {Array<ASTNode>} ancestry The ancestry of the node.
|
||||
* @returns {boolean} True if there's a match, false if not.
|
||||
* @throws {Error} When an unknown class name is passed.
|
||||
*/
|
||||
matchesSelectorClass(className, node, ancestry) {
|
||||
/*
|
||||
* Copyright (c) 2013, Joel Feenstra
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of the ESQuery nor the names of its contributors may
|
||||
* be used to endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL JOEL FEENSTRA BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
switch (className.toLowerCase()) {
|
||||
case "statement":
|
||||
if (node.type.slice(-9) === "Statement") {
|
||||
return true;
|
||||
}
|
||||
|
||||
// fallthrough: interface Declaration <: Statement { }
|
||||
|
||||
case "declaration":
|
||||
return node.type.slice(-11) === "Declaration";
|
||||
|
||||
case "pattern":
|
||||
if (node.type.slice(-7) === "Pattern") {
|
||||
return true;
|
||||
}
|
||||
|
||||
// fallthrough: interface Expression <: Node, Pattern { }
|
||||
|
||||
case "expression":
|
||||
return (
|
||||
node.type.slice(-10) === "Expression" ||
|
||||
node.type.slice(-7) === "Literal" ||
|
||||
(node.type === "Identifier" &&
|
||||
(ancestry.length === 0 ||
|
||||
ancestry[0].type !== "MetaProperty")) ||
|
||||
node.type === "MetaProperty"
|
||||
);
|
||||
|
||||
case "function":
|
||||
return (
|
||||
node.type === "FunctionDeclaration" ||
|
||||
node.type === "FunctionExpression" ||
|
||||
node.type === "ArrowFunctionExpression"
|
||||
);
|
||||
|
||||
default:
|
||||
throw new Error(`Unknown class name: ${className}`);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Parses the given file into an AST.
|
||||
* @param {File} file The virtual file to parse.
|
||||
* @param {Object} options Additional options passed from ESLint.
|
||||
* @param {LanguageOptions} options.languageOptions The language options.
|
||||
* @returns {Object} The result of parsing.
|
||||
*/
|
||||
parse(file, { languageOptions }) {
|
||||
// Note: BOM already removed
|
||||
const { body: text, path: filePath } = file;
|
||||
const textToParse = text.replace(
|
||||
astUtils.shebangPattern,
|
||||
(match, captured) => `//${captured}`,
|
||||
);
|
||||
const { ecmaVersion, sourceType, parser } = languageOptions;
|
||||
const parserOptions = Object.assign(
|
||||
{ ecmaVersion, sourceType },
|
||||
languageOptions.parserOptions,
|
||||
{
|
||||
loc: true,
|
||||
range: true,
|
||||
raw: true,
|
||||
tokens: true,
|
||||
comment: true,
|
||||
eslintVisitorKeys: true,
|
||||
eslintScopeManager: true,
|
||||
filePath,
|
||||
},
|
||||
);
|
||||
|
||||
/*
|
||||
* Check for parsing errors first. If there's a parsing error, nothing
|
||||
* else can happen. However, a parsing error does not throw an error
|
||||
* from this method - it's just considered a fatal error message, a
|
||||
* problem that ESLint identified just like any other.
|
||||
*/
|
||||
try {
|
||||
debug("Parsing:", filePath);
|
||||
const parseResult =
|
||||
typeof parser.parseForESLint === "function"
|
||||
? parser.parseForESLint(textToParse, parserOptions)
|
||||
: { ast: parser.parse(textToParse, parserOptions) };
|
||||
|
||||
debug("Parsing successful:", filePath);
|
||||
|
||||
const {
|
||||
ast,
|
||||
services: parserServices = {},
|
||||
visitorKeys = evk.KEYS,
|
||||
scopeManager,
|
||||
} = parseResult;
|
||||
|
||||
return {
|
||||
ok: true,
|
||||
ast,
|
||||
parserServices,
|
||||
visitorKeys,
|
||||
scopeManager,
|
||||
};
|
||||
} catch (ex) {
|
||||
// If the message includes a leading line number, strip it:
|
||||
const message = ex.message.replace(/^line \d+:/iu, "").trim();
|
||||
|
||||
debug("%s\n%s", message, ex.stack);
|
||||
|
||||
return {
|
||||
ok: false,
|
||||
errors: [
|
||||
{
|
||||
message,
|
||||
line: ex.lineNumber,
|
||||
column: ex.column,
|
||||
},
|
||||
],
|
||||
};
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Creates a new `SourceCode` object from the given information.
|
||||
* @param {File} file The virtual file to create a `SourceCode` object from.
|
||||
* @param {OkParseResult} parseResult The result returned from `parse()`.
|
||||
* @param {Object} options Additional options passed from ESLint.
|
||||
* @param {LanguageOptions} options.languageOptions The language options.
|
||||
* @returns {SourceCode} The new `SourceCode` object.
|
||||
*/
|
||||
createSourceCode(file, parseResult, { languageOptions }) {
|
||||
const { body: text, path: filePath, bom: hasBOM } = file;
|
||||
const { ast, parserServices, visitorKeys } = parseResult;
|
||||
|
||||
debug("Scope analysis:", filePath);
|
||||
const scopeManager =
|
||||
parseResult.scopeManager ||
|
||||
analyzeScope(ast, languageOptions, visitorKeys);
|
||||
|
||||
debug("Scope analysis successful:", filePath);
|
||||
|
||||
return new SourceCode({
|
||||
text,
|
||||
ast,
|
||||
hasBOM,
|
||||
parserServices,
|
||||
scopeManager,
|
||||
visitorKeys,
|
||||
});
|
||||
},
|
||||
};
|
||||
@@ -0,0 +1,64 @@
|
||||
/**
|
||||
* @fileoverview Common error classes
|
||||
* @author Nicholas C. Zakas
|
||||
*/
|
||||
/**
|
||||
* Error thrown when a file or directory is not found.
|
||||
*/
|
||||
export class NotFoundError extends Error {
|
||||
/**
|
||||
* Creates a new instance.
|
||||
* @param {string} message The error message.
|
||||
*/
|
||||
constructor(message: string);
|
||||
/**
|
||||
* Error code.
|
||||
* @type {string}
|
||||
*/
|
||||
code: string;
|
||||
}
|
||||
/**
|
||||
* Error thrown when an operation is not permitted.
|
||||
*/
|
||||
export class PermissionError extends Error {
|
||||
/**
|
||||
* Creates a new instance.
|
||||
* @param {string} message The error message.
|
||||
*/
|
||||
constructor(message: string);
|
||||
/**
|
||||
* Error code.
|
||||
* @type {string}
|
||||
*/
|
||||
code: string;
|
||||
}
|
||||
/**
|
||||
* Error thrown when an operation is not allowed on a directory.
|
||||
*/
|
||||
export class DirectoryError extends Error {
|
||||
/**
|
||||
* Creates a new instance.
|
||||
* @param {string} message The error message.
|
||||
*/
|
||||
constructor(message: string);
|
||||
/**
|
||||
* Error code.
|
||||
* @type {string}
|
||||
*/
|
||||
code: string;
|
||||
}
|
||||
/**
|
||||
* Error thrown when a directory is not empty.
|
||||
*/
|
||||
export class NotEmptyError extends Error {
|
||||
/**
|
||||
* Creates a new instance.
|
||||
* @param {string} message The error message.
|
||||
*/
|
||||
constructor(message: string);
|
||||
/**
|
||||
* Error code.
|
||||
* @type {string}
|
||||
*/
|
||||
code: string;
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
import { ResolveHook } from 'node:module';
|
||||
|
||||
declare let resolve: ResolveHook;
|
||||
|
||||
export { resolve };
|
||||
@@ -0,0 +1,11 @@
|
||||
var test = require('tape');
|
||||
var stringify = require('../');
|
||||
|
||||
test('custom comparison function', function (t) {
|
||||
t.plan(1);
|
||||
var obj = { c: 8, b: [{z:6,y:5,x:4},7], a: 3 };
|
||||
var s = stringify(obj, function (a, b) {
|
||||
return a.key < b.key ? 1 : -1;
|
||||
});
|
||||
t.equal(s, '{"c":8,"b":[{"z":6,"y":5,"x":4},7],"a":3}');
|
||||
});
|
||||
@@ -0,0 +1,61 @@
|
||||
/**
|
||||
* @fileoverview Define the cursor which iterates tokens and comments in reverse.
|
||||
* @author Toru Nagashima
|
||||
*/
|
||||
"use strict";
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Requirements
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
const Cursor = require("./cursor");
|
||||
const utils = require("./utils");
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Exports
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* The cursor which iterates tokens and comments in reverse.
|
||||
*/
|
||||
module.exports = class BackwardTokenCommentCursor extends Cursor {
|
||||
/**
|
||||
* Initializes this cursor.
|
||||
* @param {Token[]} tokens The array of tokens.
|
||||
* @param {Comment[]} comments The array of comments.
|
||||
* @param {Object} indexMap The map from locations to indices in `tokens`.
|
||||
* @param {number} startLoc The start location of the iteration range.
|
||||
* @param {number} endLoc The end location of the iteration range.
|
||||
*/
|
||||
constructor(tokens, comments, indexMap, startLoc, endLoc) {
|
||||
super();
|
||||
this.tokens = tokens;
|
||||
this.comments = comments;
|
||||
this.tokenIndex = utils.getLastIndex(tokens, indexMap, endLoc);
|
||||
this.commentIndex = utils.search(comments, endLoc) - 1;
|
||||
this.border = startLoc;
|
||||
}
|
||||
|
||||
/** @inheritdoc */
|
||||
moveNext() {
|
||||
const token =
|
||||
this.tokenIndex >= 0 ? this.tokens[this.tokenIndex] : null;
|
||||
const comment =
|
||||
this.commentIndex >= 0 ? this.comments[this.commentIndex] : null;
|
||||
|
||||
if (token && (!comment || token.range[1] > comment.range[1])) {
|
||||
this.current = token;
|
||||
this.tokenIndex -= 1;
|
||||
} else if (comment) {
|
||||
this.current = comment;
|
||||
this.commentIndex -= 1;
|
||||
} else {
|
||||
this.current = null;
|
||||
}
|
||||
|
||||
return (
|
||||
Boolean(this.current) &&
|
||||
(this.border === -1 || this.current.range[0] >= this.border)
|
||||
);
|
||||
}
|
||||
};
|
||||
@@ -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 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":"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 qC rC","194":"1B"},D:{"1":"0 9 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 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"},E:{"1":"C L M G 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","2":"J PB K D E F A B sC SC tC uC vC wC TC"},F:{"1":"0 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","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 4C 5C 6C 7C FC kC 8C GC"},G:{"1":"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","2":"E SC 9C lC AD BD CD DD ED FD GD HD"},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 gD hD TC iD jD kD lD mD IC JC KC nD","2":"J dD eD fD"},Q:{"1":"oD"},R:{"1":"pD"},S:{"1":"rD","2":"qD"}},B:6,C:"JavaScript modules: dynamic import()",D:true};
|
||||
@@ -0,0 +1,151 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = _default;
|
||||
var _t = require("@babel/types");
|
||||
var _util = require("./util.js");
|
||||
const {
|
||||
BOOLEAN_NUMBER_BINARY_OPERATORS,
|
||||
createTypeAnnotationBasedOnTypeof,
|
||||
numberTypeAnnotation,
|
||||
voidTypeAnnotation
|
||||
} = _t;
|
||||
function _default(node) {
|
||||
if (!this.isReferenced()) return;
|
||||
const binding = this.scope.getBinding(node.name);
|
||||
if (binding) {
|
||||
if (binding.identifier.typeAnnotation) {
|
||||
return binding.identifier.typeAnnotation;
|
||||
} else {
|
||||
return getTypeAnnotationBindingConstantViolations(binding, this, node.name);
|
||||
}
|
||||
}
|
||||
if (node.name === "undefined") {
|
||||
return voidTypeAnnotation();
|
||||
} else if (node.name === "NaN" || node.name === "Infinity") {
|
||||
return numberTypeAnnotation();
|
||||
} else if (node.name === "arguments") {}
|
||||
}
|
||||
function getTypeAnnotationBindingConstantViolations(binding, path, name) {
|
||||
const types = [];
|
||||
const functionConstantViolations = [];
|
||||
let constantViolations = getConstantViolationsBefore(binding, path, functionConstantViolations);
|
||||
const testType = getConditionalAnnotation(binding, path, name);
|
||||
if (testType) {
|
||||
const testConstantViolations = getConstantViolationsBefore(binding, testType.ifStatement);
|
||||
constantViolations = constantViolations.filter(path => !testConstantViolations.includes(path));
|
||||
types.push(testType.typeAnnotation);
|
||||
}
|
||||
if (constantViolations.length) {
|
||||
constantViolations.push(...functionConstantViolations);
|
||||
for (const violation of constantViolations) {
|
||||
types.push(violation.getTypeAnnotation());
|
||||
}
|
||||
}
|
||||
if (!types.length) {
|
||||
return;
|
||||
}
|
||||
return (0, _util.createUnionType)(types);
|
||||
}
|
||||
function getConstantViolationsBefore(binding, path, functions) {
|
||||
const violations = binding.constantViolations.slice();
|
||||
violations.unshift(binding.path);
|
||||
return violations.filter(violation => {
|
||||
violation = violation.resolve();
|
||||
const status = violation._guessExecutionStatusRelativeTo(path);
|
||||
if (functions && status === "unknown") functions.push(violation);
|
||||
return status === "before";
|
||||
});
|
||||
}
|
||||
function inferAnnotationFromBinaryExpression(name, path) {
|
||||
const operator = path.node.operator;
|
||||
const right = path.get("right").resolve();
|
||||
const left = path.get("left").resolve();
|
||||
let target;
|
||||
if (left.isIdentifier({
|
||||
name
|
||||
})) {
|
||||
target = right;
|
||||
} else if (right.isIdentifier({
|
||||
name
|
||||
})) {
|
||||
target = left;
|
||||
}
|
||||
if (target) {
|
||||
if (operator === "===") {
|
||||
return target.getTypeAnnotation();
|
||||
}
|
||||
if (BOOLEAN_NUMBER_BINARY_OPERATORS.includes(operator)) {
|
||||
return numberTypeAnnotation();
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (operator !== "===" && operator !== "==") return;
|
||||
let typeofPath;
|
||||
let typePath;
|
||||
if (left.isUnaryExpression({
|
||||
operator: "typeof"
|
||||
})) {
|
||||
typeofPath = left;
|
||||
typePath = right;
|
||||
} else if (right.isUnaryExpression({
|
||||
operator: "typeof"
|
||||
})) {
|
||||
typeofPath = right;
|
||||
typePath = left;
|
||||
}
|
||||
if (!typeofPath) return;
|
||||
if (!typeofPath.get("argument").isIdentifier({
|
||||
name
|
||||
})) return;
|
||||
typePath = typePath.resolve();
|
||||
if (!typePath.isLiteral()) return;
|
||||
const typeValue = typePath.node.value;
|
||||
if (typeof typeValue !== "string") return;
|
||||
return createTypeAnnotationBasedOnTypeof(typeValue);
|
||||
}
|
||||
function getParentConditionalPath(binding, path, name) {
|
||||
let parentPath;
|
||||
while (parentPath = path.parentPath) {
|
||||
if (parentPath.isIfStatement() || parentPath.isConditionalExpression()) {
|
||||
if (path.key === "test") {
|
||||
return;
|
||||
}
|
||||
return parentPath;
|
||||
}
|
||||
if (parentPath.isFunction()) {
|
||||
if (parentPath.parentPath.scope.getBinding(name) !== binding) return;
|
||||
}
|
||||
path = parentPath;
|
||||
}
|
||||
}
|
||||
function getConditionalAnnotation(binding, path, name) {
|
||||
const ifStatement = getParentConditionalPath(binding, path, name);
|
||||
if (!ifStatement) return;
|
||||
const test = ifStatement.get("test");
|
||||
const paths = [test];
|
||||
const types = [];
|
||||
for (let i = 0; i < paths.length; i++) {
|
||||
const path = paths[i];
|
||||
if (path.isLogicalExpression()) {
|
||||
if (path.node.operator === "&&") {
|
||||
paths.push(path.get("left"));
|
||||
paths.push(path.get("right"));
|
||||
}
|
||||
} else if (path.isBinaryExpression()) {
|
||||
const type = inferAnnotationFromBinaryExpression(name, path);
|
||||
if (type) types.push(type);
|
||||
}
|
||||
}
|
||||
if (types.length) {
|
||||
return {
|
||||
typeAnnotation: (0, _util.createUnionType)(types),
|
||||
ifStatement
|
||||
};
|
||||
}
|
||||
return getConditionalAnnotation(binding, ifStatement, name);
|
||||
}
|
||||
|
||||
//# sourceMappingURL=inferer-reference.js.map
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={C:{"52":0.01296,"58":0.11664,"60":0.00432,"78":0.01728,"94":0.00432,"103":0.00432,"113":0.10368,"115":0.24192,"125":0.00432,"127":0.00864,"128":0.0216,"132":0.00432,"133":0.01728,"134":0.01728,"135":0.27648,"136":1.52928,"137":0.00432,_:"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 53 54 55 56 57 59 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 95 96 97 98 99 100 101 102 104 105 106 107 108 109 110 111 112 114 116 117 118 119 120 121 122 123 124 126 129 130 131 138 139 140 3.5 3.6"},D:{"39":0.00432,"40":0.00432,"41":0.00432,"42":0.00432,"43":0.00432,"44":0.00432,"45":0.00432,"46":0.00432,"47":0.00432,"48":0.00432,"49":0.00864,"50":0.00864,"51":0.00864,"52":0.00432,"53":0.00432,"54":0.00432,"55":0.00432,"56":0.00432,"57":0.00432,"58":0.00432,"59":0.00432,"60":0.00432,"62":0.00864,"63":0.00432,"65":0.00432,"67":0.00432,"69":0.00864,"70":0.00864,"73":0.00432,"75":0.00864,"79":0.03888,"83":0.01296,"85":0.00432,"86":0.01728,"87":0.03888,"88":0.00864,"89":0.00432,"90":0.00432,"91":0.00432,"92":0.00432,"93":0.00864,"94":0.01296,"97":0.00432,"98":0.00432,"100":0.00432,"101":0.00432,"102":0.00432,"103":0.02592,"104":0.00432,"105":0.04752,"106":0.01728,"107":0.00432,"108":0.03456,"109":1.89648,"110":0.02592,"111":0.01296,"112":0.00864,"113":0.00432,"114":0.03024,"115":0.00432,"116":0.1512,"117":0.00432,"118":0.01728,"119":0.02592,"120":0.07776,"121":0.02592,"122":0.07344,"123":0.03024,"124":0.05184,"125":0.4536,"126":0.07776,"127":0.04752,"128":0.22464,"129":0.06048,"130":0.08208,"131":0.22032,"132":0.26352,"133":7.47792,"134":17.60832,"135":0.01296,"136":0.00432,_:"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 61 64 66 68 71 72 74 76 77 78 80 81 84 95 96 99 137 138"},F:{"69":0.00432,"87":0.01296,"88":0.00864,"95":0.07776,"99":0.00864,"102":0.00432,"107":0.00432,"113":0.00432,"114":0.00864,"115":0.00432,"116":0.61344,"117":1.65456,_:"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 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 89 90 91 92 93 94 96 97 98 100 101 103 104 105 106 108 109 110 111 112 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"18":0.00432,"85":0.00432,"89":0.00432,"92":0.03024,"100":0.00432,"106":0.00864,"109":0.02592,"111":0.00864,"114":0.0216,"119":0.00432,"120":0.12528,"122":0.01296,"123":0.00432,"124":0.00432,"126":0.00864,"127":0.00432,"128":0.00432,"129":0.00432,"130":0.0432,"131":0.03456,"132":0.0432,"133":0.864,"134":2.53584,_:"12 13 14 15 16 17 79 80 81 83 84 86 87 88 90 91 93 94 95 96 97 98 99 101 102 103 104 105 107 108 110 112 113 115 116 117 118 121 125"},E:{"14":0.00432,_:"0 4 5 6 7 8 9 10 11 12 13 15 3.1 3.2 6.1 7.1 9.1 10.1 11.1 12.1 15.4 16.1 16.2 16.3 16.4 17.0","5.1":0.00432,"13.1":0.01296,"14.1":0.03888,"15.1":0.00432,"15.2-15.3":0.00432,"15.5":0.01296,"15.6":0.03888,"16.0":0.00432,"16.5":0.01728,"16.6":0.03888,"17.1":0.00432,"17.2":0.17712,"17.3":0.00864,"17.4":0.03024,"17.5":0.00864,"17.6":0.14688,"18.0":0.00864,"18.1":0.01296,"18.2":0.00864,"18.3":0.3024,"18.4":0.01728},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00083,"5.0-5.1":0,"6.0-6.1":0.0025,"7.0-7.1":0.00167,"8.1-8.4":0,"9.0-9.2":0.00125,"9.3":0.00584,"10.0-10.2":0.00042,"10.3":0.00959,"11.0-11.2":0.04419,"11.3-11.4":0.00292,"12.0-12.1":0.00167,"12.2-12.5":0.04127,"13.0-13.1":0.00083,"13.2":0.00125,"13.3":0.00167,"13.4-13.7":0.00584,"14.0-14.4":0.01459,"14.5-14.8":0.01751,"15.0-15.1":0.00959,"15.2-15.3":0.00959,"15.4":0.01167,"15.5":0.01334,"15.6-15.8":0.16426,"16.0":0.02335,"16.1":0.04794,"16.2":0.02501,"16.3":0.04336,"16.4":0.00959,"16.5":0.01793,"16.6-16.7":0.1947,"17.0":0.01167,"17.1":0.02085,"17.2":0.01584,"17.3":0.0221,"17.4":0.04419,"17.5":0.09839,"17.6-17.7":0.28558,"18.0":0.08005,"18.1":0.26182,"18.2":0.11715,"18.3":2.44852,"18.4":0.03627},P:{"4":0.11464,"20":0.01042,"21":0.03127,"22":0.03127,"23":0.05211,"24":0.04169,"25":0.03127,"26":0.12507,"27":1.55292,_:"5.0-5.4 6.2-6.4 8.2 9.2 10.1 14.0 16.0 18.0","7.2-7.4":0.08338,"11.1-11.2":0.01042,"12.0":0.01042,"13.0":0.01042,"15.0":0.01042,"17.0":0.03127,"19.0":0.01042},I:{"0":0.03401,"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.60776,_:"10 11 12 11.1 11.5 12.1"},A:{"11":0.00864,_:"6 7 8 9 10 5.5"},S:{_:"2.5 3.0-3.1"},J:{_:"7 10"},N:{_:"10 11"},R:{_:"0"},M:{"0":0.2556},Q:{"14.9":0.00568},O:{"0":0.18176},H:{"0":0},L:{"0":51.77536}};
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"1":"F A B","2":"K D E mC"},B:{"1":"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":"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","2":"nC LC","33":"qC rC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 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","33":"J PB K D E F"},E:{"1":"K D E F A B C L M G 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","33":"PB","164":"J sC SC"},F:{"1":"0 1 2 3 4 5 6 7 8 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 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 6C 7C FC kC 8C GC","2":"F 4C 5C"},G:{"1":"E 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","33":"9C lC","164":"SC"},H:{"2":"WD"},I:{"1":"J I aD lC bD cD","164":"LC XD YD ZD"},J:{"1":"A","33":"D"},K:{"1":"B C H FC kC GC","2":"A"},L:{"1":"I"},M:{"1":"EC"},N:{"1":"A 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:4,C:"CSS3 Box-shadow",D:true};
|
||||
Reference in New Issue
Block a user