diff --git a/.config/rollup.config.mjs b/.config/rollup.config.mjs index b375c73..24d8f9e 100644 --- a/.config/rollup.config.mjs +++ b/.config/rollup.config.mjs @@ -5,7 +5,7 @@ import { fileURLToPath } from 'url'; const __dirname = path.dirname(fileURLToPath(import.meta.url)); -var configs = []; +const configs = []; const banner = `/*! @orchidjs/unicode-variants | https://github.com/orchidjs/unicode-variants | Apache License (v2) */`; const extensions = [ @@ -33,38 +33,9 @@ var terser_config = terser({ }, }); - -// esm -configs.push({ - input: path.resolve(__dirname,'../lib/index.mjs'), - output:{ - dir: path.resolve(__dirname,'../dist/esm'), - format: 'esm', - preserveModules: true, - sourcemap: true, - banner: banner, - entryFileNames: '[name].js', - }, - plugins:[babel_config] // resolve_config -}); - -// cjs -configs.push({ - input: path.resolve(__dirname,'../lib/index.mjs'), - output:{ - dir: path.resolve(__dirname,'../dist/cjs'), - format: 'cjs', - preserveModules: false, - sourcemap: true, - banner: banner, - }, - plugins:[babel_config] //resolve_config -}); - - // umd configs.push({ - input: path.resolve(__dirname,'../lib/index.mjs'), + input: path.resolve(__dirname,'../lib/index.ts'), output: { name: 'diacritics', file: `dist/umd/index.js`, @@ -80,7 +51,7 @@ configs.push({ // umd min configs.push({ - input: path.resolve(__dirname,'../lib/index.mjs'), + input: path.resolve(__dirname,'../lib/index.ts'), output: { name: 'diacritics', file: `dist/umd/index.min.js`, @@ -94,5 +65,4 @@ configs.push({ ] }); - export default configs; diff --git a/.config/tsconfig.cjs.json b/.config/tsconfig.cjs.json new file mode 100644 index 0000000..d7b9e2b --- /dev/null +++ b/.config/tsconfig.cjs.json @@ -0,0 +1,7 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "module": "CommonJS", + "outDir": "../dist/cjs", + } +} diff --git a/.config/tsconfig.esm.json b/.config/tsconfig.esm.json new file mode 100644 index 0000000..7cbf995 --- /dev/null +++ b/.config/tsconfig.esm.json @@ -0,0 +1,7 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "module": "ESNext", + "outDir": "../dist/esm", + } +} diff --git a/.config/tsconfig.json b/.config/tsconfig.json index 6ee9c12..10bb096 100644 --- a/.config/tsconfig.json +++ b/.config/tsconfig.json @@ -1,19 +1,19 @@ { - "include": ["../lib/index.mjs"], + "include": ["../lib/index.ts"], "compilerOptions": { "allowJs": true, - "checkJs": true, - "strict": true, + "checkJs": true, + "strict": true, "target": "esnext", "module": "esnext", + "moduleResolution": "node", "noUnusedLocals": true, "noUnusedParameters": true, "allowUnreachableCode": false, "noUncheckedIndexedAccess": true, - "declaration": true, - "declarationDir": "../dist/types", "isolatedModules": true, - "moduleResolution": "node" + "sourceMap": true, + "rewriteRelativeImportExtensions": true, }, } diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 3a75549..e3c47f4 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -22,6 +22,5 @@ jobs: node-version: ${{ matrix.node-version }} - run: npm ci - run: npm run build - - run: npm run build:types - run: npm run test - - run: npm run test:typescript + - run: npm run test:types diff --git a/.gitignore b/.gitignore index 10d8cbd..ccd81a7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,8 @@ .DS_store +.vscode node_modules benchmark/report*.json coverage -build -x-* dist +x-* *.0x diff --git a/bench.mjs b/bench.mjs index a9b3d4a..04fda93 100644 --- a/bench.mjs +++ b/bench.mjs @@ -3,7 +3,7 @@ * Usage: * > npm run bench */ -import * as D from './lib/index.mjs'; +import * as D from './dist/esm/index.js'; import * as assert from 'assert'; const regExp = (needle) => { diff --git a/lib/index.d.ts b/lib/index.d.ts deleted file mode 100644 index 7ec0163..0000000 --- a/lib/index.d.ts +++ /dev/null @@ -1,11 +0,0 @@ - - -type TUnicodeMap = {[key:string]:string}; - -type TUnicodeSets = {[key:string]:Set}; - -type TCodePoints = [[number,number]]; - -type TCodePointObj = {folded:string,composed:string,code_point:number} - -type TSequencePart = {start:number,end:number,length:number,substr:string} diff --git a/lib/index.mjs b/lib/index.ts similarity index 77% rename from lib/index.mjs rename to lib/index.ts index 5cbf5c5..3e069af 100644 --- a/lib/index.mjs +++ b/lib/index.ts @@ -1,35 +1,25 @@ +import { setToPattern, arrayToPattern, escape_regex, sequencePattern } from './regex.ts'; +import { allSubstrings } from './strings.ts'; -/** - * @typedef {{[key:string]:string}} TUnicodeMap - * @typedef {{[key:string]:Set}} TUnicodeSets - * @typedef {[[number,number]]} TCodePoints - * @typedef {{folded:string,composed:string,code_point:number}} TCodePointObj - * @typedef {{start:number,end:number,length:number,substr:string}} TSequencePart - */ - - -import { setToPattern, arrayToPattern, escape_regex, sequencePattern, toArray } from './regex.mjs'; -import { allSubstrings } from './strings.mjs'; +export type TUnicodeMap = {[key:string]:string}; +export type TUnicodeSets = {[key:string]:Set}; +export type TCodePoints = [[number,number]]; +export type TCodePointObj = {folded:string,composed:string,code_point:number} +export type TSequencePart = {start:number,end:number,length:number,substr:string} - -/** @type {TCodePoints} */ -export const code_points = [[ 0, 65535 ]]; +export const code_points: TCodePoints = [[ 0, 65535 ]]; const accent_pat = '[\u0300-\u036F\u{b7}\u{2be}\u{2bc}]'; -/** @type {TUnicodeMap} */ -export let unicode_map; +export let unicode_map: TUnicodeMap; -/** @type {RegExp} */ -let multi_char_reg; +let multi_char_reg: RegExp; const max_char_length = 3; -/** @type {TUnicodeMap} */ -const latin_convert = {} +const latin_convert: TUnicodeMap = {} -/** @type {TUnicodeMap} */ -const latin_condensed = { +const latin_condensed: TUnicodeMap = { '/': '⁄∕', '0': '߀', "a": "ⱥɐɑ", @@ -89,10 +79,8 @@ const convert_pat = new RegExp(Object.keys(latin_convert).join('|')+'|'+accent_p /** * Initialize the unicode_map from the give code point ranges - * - * @param {TCodePoints=} _code_points */ -export const initialize = (_code_points) => { +export const initialize = (_code_points?: TCodePoints) => { if( unicode_map !== undefined ) return; unicode_map = generateMap(_code_points || code_points ); } @@ -101,10 +89,8 @@ export const initialize = (_code_points) => { /** * Helper method for normalize a string * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/normalize - * @param {string} str - * @param {string} form */ -export const normalize = (str,form='NFKD') => str.normalize(form); +export const normalize = (str: string, form: string = 'NFKD') => str.normalize(form); @@ -112,12 +98,10 @@ export const normalize = (str,form='NFKD') => str.normalize(form); * Remove accents without reordering string * calling str.normalize('NFKD') on \u{594}\u{595}\u{596} becomes \u{596}\u{594}\u{595} * via https://github.com/krisk/Fuse/issues/133#issuecomment-318692703 - * @param {string} str - * @return {string} */ -export const asciifold = (str) => { +export const asciifold = (str: string): string => { - return toArray(str).reduce( + return Array.from(str).reduce( /** * @param {string} result * @param {string} char @@ -129,11 +113,7 @@ export const asciifold = (str) => { ); }; -/** - * @param {string} str - * @return {string} - */ -export const _asciifold = (str) => { +export const _asciifold = (str: string): string => { str = normalize(str) .toLowerCase() .replace(convert_pat,(/** @type {string} */ char) => { @@ -144,17 +124,10 @@ export const _asciifold = (str) => { return normalize(str,'NFC') }; - - - - - /** * Generate a list of unicode variants from the list of code points - * @param {TCodePoints} code_points - * @yield {TCodePointObj} */ -export function* generator(code_points){ +export function* generator(code_points: TCodePoints): Generator { for(const [code_point_min, code_point_max] of code_points){ for(let i = code_point_min; i <= code_point_max; i++){ @@ -189,20 +162,12 @@ export function* generator(code_points){ /** * Generate a unicode map from the list of code points - * @param {TCodePoints} code_points - * @return {TUnicodeSets} */ -export const generateSets = (code_points) => { +export const generateSets = (code_points: TCodePoints): TUnicodeSets => { - /** @type {{[key:string]:Set}} */ - const unicode_sets = {}; + const unicode_sets: {[key: string]: Set} = {}; - - /** - * @param {string} folded - * @param {string} to_add - */ - const addMatching = (folded,to_add) => { + const addMatching = (folded: string, to_add: string) => { /** @type {Set} */ const folded_set = unicode_sets[folded] || new Set(); @@ -228,20 +193,13 @@ export const generateSets = (code_points) => { /** * Generate a unicode map from the list of code points * ae => (?:(?:ae|Æ|Ǽ|Ǣ)|(?:A|Ⓐ|A...)(?:E|ɛ|Ⓔ...)) - * - * @param {TCodePoints} code_points - * @return {TUnicodeMap} */ -export const generateMap = (code_points) => { - - /** @type {TUnicodeSets} */ +export const generateMap = (code_points: TCodePoints): TUnicodeMap => { const unicode_sets = generateSets(code_points); - /** @type {TUnicodeMap} */ - const unicode_map = {}; + const unicode_map: TUnicodeMap = {}; - /** @type {string[]} */ - let multi_char = []; + let multi_char: string[] = []; for( let folded in unicode_sets ){ @@ -264,15 +222,11 @@ export const generateMap = (code_points) => { /** - * Map each element of an array from it's folded value to all possible unicode matches - * @param {string[]} strings - * @param {number} min_replacement - * @return {string} + * Map each element of an array from its folded value to all possible unicode matches */ -export const mapSequence = (strings,min_replacement=1) =>{ +export const mapSequence = (strings: string[], min_replacement: number = 1): string =>{ let chars_replaced = 0; - strings = strings.map((str)=>{ if( unicode_map[str] ){ chars_replaced += str.length; @@ -294,13 +248,8 @@ export const mapSequence = (strings,min_replacement=1) =>{ * 'abc' * => [['abc'],['ab','c'],['a','bc'],['a','b','c']] * => ['abc-pattern','ab-c-pattern'...] - * - * - * @param {string} str - * @param {number} min_replacement - * @return {string} */ -export const substringsToPattern = (str,min_replacement=1) => { +export const substringsToPattern = (str: string, min_replacement: number = 1): string => { min_replacement = Math.max(min_replacement,str.length-1); @@ -314,16 +263,13 @@ export const substringsToPattern = (str,min_replacement=1) => { /** * Convert an array of sequences into a pattern * [{start:0,end:3,length:3,substr:'iii'}...] => (?:iii...) - * - * @param {Sequence[]} sequences - * @param {boolean} all */ -const sequencesToPattern = (sequences,all=true) => { +const sequencesToPattern = (sequences: Sequence[], all: boolean = true) => { let min_replacement = sequences.length > 1 ? 1 : 0; return arrayToPattern( sequences.map( (sequence) =>{ - let seq = []; + let seq: string[] = []; const len = all ? sequence.length() : sequence.length() - 1; for( let j = 0; j < len; j++){ seq.push(substringsToPattern(sequence.substrs[j]||'',min_replacement)); @@ -336,10 +282,8 @@ const sequencesToPattern = (sequences,all=true) => { /** * Return true if the sequence is already in the sequences - * @param {Sequence} needle_seq - * @param {Sequence[]} sequences */ -const inSequences = (needle_seq, sequences) => { +const inSequences = (needle_seq: Sequence, sequences: Sequence[]) => { for(const seq of sequences){ @@ -354,10 +298,7 @@ const inSequences = (needle_seq, sequences) => { let needle_parts = needle_seq.parts; - /** - * @param {TSequencePart} part - */ - const filter = (part) =>{ + const filter = (part: TSequencePart) =>{ for(const needle_part of needle_parts){ @@ -401,22 +342,19 @@ const inSequences = (needle_seq, sequences) => { } class Sequence{ + parts: TSequencePart[]; + substrs: string[]; + start: number; + end: number; constructor(){ - - /** @type {TSequencePart[]} */ this.parts = []; - - /** @type {string[]} */ this.substrs = []; this.start = 0; this.end = 0; } - /** - * @param {TSequencePart|undefined} part - */ - add(part){ + add(part: TSequencePart|undefined){ if( part ){ this.parts.push(part); this.substrs.push(part.substr); @@ -433,11 +371,7 @@ class Sequence{ return this.parts.length; } - /** - * @param {number} position - * @param {TSequencePart} last_piece - */ - clone(position, last_piece){ + clone(position: number, last_piece: TSequencePart){ let clone = new Sequence(); let parts = JSON.parse(JSON.stringify(this.parts)); @@ -466,11 +400,8 @@ class Sequence{ * İIJ = IIJ = ⅡJ * * 1/2/4 - * - * @param {string} str - * @return {string|undefined} */ -export const getPattern = (str) => { +export const getPattern = (str: string): string | undefined => { initialize(); str = asciifold(str); @@ -488,8 +419,8 @@ export const getPattern = (str) => { // loop through sequences // add either the char or multi_match - let overlapping = []; - let added_types = new Set(); + let overlapping: Sequence[] = []; + let added_types = new Set(); for(const sequence of sequences){ const last_piece = sequence.last(); diff --git a/lib/regex.mjs b/lib/regex.ts similarity index 65% rename from lib/regex.mjs rename to lib/regex.ts index c6ad329..bbc9551 100644 --- a/lib/regex.mjs +++ b/lib/regex.ts @@ -1,12 +1,9 @@ - /** * Convert array of strings to a regular expression * ex ['ab','a'] => (?:ab|a) * ex ['a','b'] => [ab] - * @param {string[]} chars - * @return {string} */ -export const arrayToPattern = (chars) =>{ +export const arrayToPattern = (chars: string[]): string => { chars = chars.filter( Boolean ); @@ -17,11 +14,7 @@ export const arrayToPattern = (chars) =>{ return (maxValueLength(chars) == 1) ? '['+chars.join('')+']' : '(?:'+chars.join('|')+')'; }; -/** - * @param {string[]} array - * @return {string} - */ -export const sequencePattern = (array)=>{ +export const sequencePattern = (array: string[]): string => { if( !hasDuplicates(array) ){ return array.join(''); @@ -61,54 +54,37 @@ export const sequencePattern = (array)=>{ * Convert array of strings to a regular expression * ex ['ab','a'] => (?:ab|a) * ex ['a','b'] => [ab] - * @param {Set} chars - * @return {string} */ -export const setToPattern = (chars)=>{ - let array = toArray(chars); +export const setToPattern = (chars: Set): string => { + let array = Array.from(chars); return arrayToPattern(array); } /** - * * https://stackoverflow.com/questions/7376598/in-javascript-how-do-i-check-if-an-array-has-duplicate-values - * @param {any[]} array */ -export const hasDuplicates = (array) => { +export const hasDuplicates = (array: any[]) => { return (new Set(array)).size !== array.length; } /** * https://stackoverflow.com/questions/63006601/why-does-u-throw-an-invalid-escape-error - * @param {string} str - * @return {string} */ -export const escape_regex = (str) => { +export const escape_regex = (str: string): string => { return (str + '').replace(/([\$\(\)\*\+\.\?\[\]\^\{\|\}\\])/gu, '\\$1'); }; /** * Return the max length of array values - * @param {string[]} array - * */ -export const maxValueLength = (array) => { +export const maxValueLength = (array: string[]) => { return array.reduce( (longest, value) => Math.max(longest,unicodeLength(value)),0); } -/** - * @param {string} str - */ -export const unicodeLength = (str) => { - return toArray(str).length; +export const unicodeLength = (str: string) => { + return Array.from(str).length; } - -/** - * @param {any} p - * @return {any[]} - */ -export const toArray = (p) => Array.from(p); diff --git a/lib/strings.mjs b/lib/strings.ts similarity index 80% rename from lib/strings.mjs rename to lib/strings.ts index 784d174..370a4d6 100644 --- a/lib/strings.mjs +++ b/lib/strings.ts @@ -1,18 +1,12 @@ - - - /** * Get all possible combinations of substrings that add up to the given string * https://stackoverflow.com/questions/30169587/find-all-the-combination-of-substrings-that-add-up-to-the-given-string - * @param {string} input - * @return {string[][]} */ -export const allSubstrings = (input) => { +export const allSubstrings = (input: string): string[][] => { if( input.length === 1) return [[input]]; - /** @type {string[][]} */ - let result = []; + let result: string[][] = []; const start = input.substring(1); const suba = allSubstrings(start); diff --git a/package-lock.json b/package-lock.json index 06fffed..e92328f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,6 +9,7 @@ "version": "1.0.4", "license": "Apache-2.0", "devDependencies": { + "@arethetypeswrong/cli": "^0.17.0", "@babel/core": "^7.26.0", "@babel/preset-env": "^7.26.0", "@babel/preset-typescript": "^7.26.0", @@ -17,7 +18,7 @@ "0x": "^5.7.0", "jest": "^29.7.0", "rollup": "^4.26.0", - "typescript": "^5.6.3" + "typescript": "^5.7.1-rc" } }, "node_modules/@ampproject/remapping": { @@ -34,6 +35,110 @@ "node": ">=6.0.0" } }, + "node_modules/@andrewbranch/untar.js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@andrewbranch/untar.js/-/untar.js-1.0.3.tgz", + "integrity": "sha512-Jh15/qVmrLGhkKJBdXlK1+9tY4lZruYjsgkDFj08ZmDiWVBLJcqkok7Z0/R0In+i1rScBpJlSvrTS2Lm41Pbnw==", + "dev": true + }, + "node_modules/@arethetypeswrong/cli": { + "version": "0.17.0", + "resolved": "https://registry.npmjs.org/@arethetypeswrong/cli/-/cli-0.17.0.tgz", + "integrity": "sha512-xSMW7bfzVWpYw5JFgZqBXqr6PdR0/REmn3DkxCES5N0JTcB0CVgbIynJCvKBFmXaPc3hzmmTrb7+yPDRoOSZdA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@arethetypeswrong/core": "0.17.0", + "chalk": "^4.1.2", + "cli-table3": "^0.6.3", + "commander": "^10.0.1", + "marked": "^9.1.2", + "marked-terminal": "^7.1.0", + "semver": "^7.5.4" + }, + "bin": { + "attw": "dist/index.js" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@arethetypeswrong/cli/node_modules/commander": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-10.0.1.tgz", + "integrity": "sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14" + } + }, + "node_modules/@arethetypeswrong/cli/node_modules/semver": { + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", + "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@arethetypeswrong/core": { + "version": "0.17.0", + "resolved": "https://registry.npmjs.org/@arethetypeswrong/core/-/core-0.17.0.tgz", + "integrity": "sha512-FHyhFizXNetigTVsIhqXKGYLpazPS5YNojEPpZEUcBPt9wVvoEbNIvG+hybuBR+pjlRcbyuqhukHZm1fr+bDgA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@andrewbranch/untar.js": "^1.0.3", + "cjs-module-lexer": "^1.2.3", + "fflate": "^0.8.2", + "lru-cache": "^10.4.3", + "semver": "^7.5.4", + "typescript": "5.6.1-rc", + "validate-npm-package-name": "^5.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@arethetypeswrong/core/node_modules/lru-cache": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/@arethetypeswrong/core/node_modules/semver": { + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", + "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@arethetypeswrong/core/node_modules/typescript": { + "version": "5.6.1-rc", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.6.1-rc.tgz", + "integrity": "sha512-E3b2+1zEFu84jB0YQi9BORDjz9+jGbwwy1Zi3G0LUNw7a7cePUrHMRNy8aPh53nXpkFGVHSxIZo5vKTfYaFiBQ==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, "node_modules/@babel/code-frame": { "version": "7.26.2", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.26.2.tgz", @@ -1831,6 +1936,17 @@ "dev": true, "license": "MIT" }, + "node_modules/@colors/colors": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.5.0.tgz", + "integrity": "sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ==", + "dev": true, + "license": "MIT", + "optional": true, + "engines": { + "node": ">=0.1.90" + } + }, "node_modules/@istanbuljs/load-nyc-config": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", @@ -2546,6 +2662,19 @@ "dev": true, "license": "MIT" }, + "node_modules/@sindresorhus/is": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.6.0.tgz", + "integrity": "sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sindresorhus/is?sponsor=1" + } + }, "node_modules/@sinonjs/commons": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-3.0.1.tgz", @@ -2839,6 +2968,13 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, + "node_modules/any-promise": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", + "integrity": "sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==", + "dev": true, + "license": "MIT" + }, "node_modules/anymatch": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", @@ -3601,6 +3737,135 @@ "dev": true, "license": "MIT" }, + "node_modules/cli-highlight": { + "version": "2.1.11", + "resolved": "https://registry.npmjs.org/cli-highlight/-/cli-highlight-2.1.11.tgz", + "integrity": "sha512-9KDcoEVwyUXrjcJNvHD0NFc/hiwe/WPVYIleQh2O1N2Zro5gWJZ/K+3DGn8w8P/F6FxOgzyC5bxDyHIgCSPhGg==", + "dev": true, + "license": "ISC", + "dependencies": { + "chalk": "^4.0.0", + "highlight.js": "^10.7.1", + "mz": "^2.4.0", + "parse5": "^5.1.1", + "parse5-htmlparser2-tree-adapter": "^6.0.0", + "yargs": "^16.0.0" + }, + "bin": { + "highlight": "bin/highlight" + }, + "engines": { + "node": ">=8.0.0", + "npm": ">=5.0.0" + } + }, + "node_modules/cli-highlight/node_modules/cliui": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + } + }, + "node_modules/cli-highlight/node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/cli-highlight/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/cli-highlight/node_modules/yargs": { + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "dev": true, + "license": "MIT", + "dependencies": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/cli-highlight/node_modules/yargs-parser": { + "version": "20.2.9", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", + "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=10" + } + }, + "node_modules/cli-table3": { + "version": "0.6.5", + "resolved": "https://registry.npmjs.org/cli-table3/-/cli-table3-0.6.5.tgz", + "integrity": "sha512-+W/5efTR7y5HRD7gACw9yQjqMVvEMLBHmboM/kPWam+H+Hmyrgjh6YncVKK122YZkXrLudzTuAukUw9FnMf7IQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "string-width": "^4.2.0" + }, + "engines": { + "node": "10.* || >= 12.*" + }, + "optionalDependencies": { + "@colors/colors": "1.5.0" + } + }, + "node_modules/cli-table3/node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/cli-table3/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/cliui": { "version": "8.0.1", "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", @@ -3917,9 +4182,9 @@ } }, "node_modules/d3-color": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/d3-color/-/d3-color-2.0.0.tgz", - "integrity": "sha512-SPXi0TSKPD4g9tw0NMZFnR95XVgUZiBH+uUTqQuDu1OsE2zomHU7ho0FISciaPvosimixwHFl3WHLGabv6dDgQ==", + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/d3-color/-/d3-color-1.4.1.tgz", + "integrity": "sha512-p2sTHSLCJI2QKunbGb7ocOh7DgTAn8IrLx21QRc/BSnodXM4sv6aLQlnfpvehFMLZEfBc6g9pH9SWQccFYfJ9Q==", "dev": true, "license": "BSD-3-Clause" }, @@ -3991,13 +4256,13 @@ "license": "BSD-3-Clause" }, "node_modules/d3-interpolate": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/d3-interpolate/-/d3-interpolate-2.0.1.tgz", - "integrity": "sha512-c5UhwwTs/yybcmTpAVqwSFl6vrQ8JZJoT5F7xNFK9pymv5C0Ymcc9/LIJHtYIggg/yS9YHw8i8O8tgb9pupjeQ==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/d3-interpolate/-/d3-interpolate-1.4.0.tgz", + "integrity": "sha512-V9znK0zc3jOPV4VD2zZn0sDhZU3WAE2bmlxdIwwQPPzPjvyLkd8B3JUVdS1IDUFDkWZ72c9qnv1GK2ZagTZ8EA==", "dev": true, "license": "BSD-3-Clause", "dependencies": { - "d3-color": "1 - 2" + "d3-color": "1" } }, "node_modules/d3-scale": { @@ -4063,23 +4328,6 @@ "d3-timer": "1" } }, - "node_modules/d3-transition/node_modules/d3-color": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/d3-color/-/d3-color-1.4.1.tgz", - "integrity": "sha512-p2sTHSLCJI2QKunbGb7ocOh7DgTAn8IrLx21QRc/BSnodXM4sv6aLQlnfpvehFMLZEfBc6g9pH9SWQccFYfJ9Q==", - "dev": true, - "license": "BSD-3-Clause" - }, - "node_modules/d3-transition/node_modules/d3-interpolate": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/d3-interpolate/-/d3-interpolate-1.4.0.tgz", - "integrity": "sha512-V9znK0zc3jOPV4VD2zZn0sDhZU3WAE2bmlxdIwwQPPzPjvyLkd8B3JUVdS1IDUFDkWZ72c9qnv1GK2ZagTZ8EA==", - "dev": true, - "license": "BSD-3-Clause", - "dependencies": { - "d3-color": "1" - } - }, "node_modules/d3-zoom": { "version": "1.8.3", "resolved": "https://registry.npmjs.org/d3-zoom/-/d3-zoom-1.8.3.tgz", @@ -4094,23 +4342,6 @@ "d3-transition": "1" } }, - "node_modules/d3-zoom/node_modules/d3-color": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/d3-color/-/d3-color-1.4.1.tgz", - "integrity": "sha512-p2sTHSLCJI2QKunbGb7ocOh7DgTAn8IrLx21QRc/BSnodXM4sv6aLQlnfpvehFMLZEfBc6g9pH9SWQccFYfJ9Q==", - "dev": true, - "license": "BSD-3-Clause" - }, - "node_modules/d3-zoom/node_modules/d3-interpolate": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/d3-interpolate/-/d3-interpolate-1.4.0.tgz", - "integrity": "sha512-V9znK0zc3jOPV4VD2zZn0sDhZU3WAE2bmlxdIwwQPPzPjvyLkd8B3JUVdS1IDUFDkWZ72c9qnv1GK2ZagTZ8EA==", - "dev": true, - "license": "BSD-3-Clause", - "dependencies": { - "d3-color": "1" - } - }, "node_modules/dash-ast": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/dash-ast/-/dash-ast-1.0.0.tgz", @@ -4408,6 +4639,13 @@ "dev": true, "license": "MIT" }, + "node_modules/emojilib": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/emojilib/-/emojilib-2.4.0.tgz", + "integrity": "sha512-5U0rVMU5Y2n2+ykNLQqMoqklN9ICBT/KsvC1Gz6vqHbz2AXXGkG+Pm5rMWk/8Vjrr/mY9985Hi8DYzn1F09Nyw==", + "dev": true, + "license": "MIT" + }, "node_modules/end-of-stream": { "version": "1.4.4", "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", @@ -4425,6 +4663,19 @@ "dev": true, "license": "MIT" }, + "node_modules/environment": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/environment/-/environment-1.1.0.tgz", + "integrity": "sha512-xUtoPkMggbz0MPyPiIWr1Kp4aeWJjDZ6SMvURhimjdZgsRuDplF5/s9hcgGhyXMhs+6vpnuoiZ2kFiu3FMnS8Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/error-ex": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", @@ -4638,6 +4889,13 @@ "bser": "2.1.1" } }, + "node_modules/fflate": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/fflate/-/fflate-0.8.2.tgz", + "integrity": "sha512-cPJU47OaAoCbg0pBvzsgpTPhmhqI5eJjh/JIu8tPj5q+T7iLvW/JAYUqmE7KOB4R1ZyEhzBaIQpQpardBF5z8A==", + "dev": true, + "license": "MIT" + }, "node_modules/fill-range": { "version": "7.1.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", @@ -4977,6 +5235,16 @@ "node": ">= 0.4" } }, + "node_modules/highlight.js": { + "version": "10.7.3", + "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-10.7.3.tgz", + "integrity": "sha512-tzcUFauisWKNHaRkN4Wjl/ZA07gENAjFl3J/c480dprkGTg5EQstgaNFqBfUqCq54kZRIEcreTsAgF/m2quD7A==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": "*" + } + }, "node_modules/hmac-drbg": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", @@ -6332,6 +6600,83 @@ "tmpl": "1.0.5" } }, + "node_modules/marked": { + "version": "9.1.6", + "resolved": "https://registry.npmjs.org/marked/-/marked-9.1.6.tgz", + "integrity": "sha512-jcByLnIFkd5gSXZmjNvS1TlmRhCXZjIzHYlaGkPlLIekG55JDR2Z4va9tZwCiP+/RDERiNhMOFu01xd6O5ct1Q==", + "dev": true, + "license": "MIT", + "bin": { + "marked": "bin/marked.js" + }, + "engines": { + "node": ">= 16" + } + }, + "node_modules/marked-terminal": { + "version": "7.2.1", + "resolved": "https://registry.npmjs.org/marked-terminal/-/marked-terminal-7.2.1.tgz", + "integrity": "sha512-rQ1MoMFXZICWNsKMiiHwP/Z+92PLKskTPXj+e7uwXmuMPkNn7iTqC+IvDekVm1MPeC9wYQeLxeFaOvudRR/XbQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-escapes": "^7.0.0", + "ansi-regex": "^6.1.0", + "chalk": "^5.3.0", + "cli-highlight": "^2.1.11", + "cli-table3": "^0.6.5", + "node-emoji": "^2.1.3", + "supports-hyperlinks": "^3.1.0" + }, + "engines": { + "node": ">=16.0.0" + }, + "peerDependencies": { + "marked": ">=1 <15" + } + }, + "node_modules/marked-terminal/node_modules/ansi-escapes": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-7.0.0.tgz", + "integrity": "sha512-GdYO7a61mR0fOlAsvC9/rIHf7L96sBc6dEWzeOu+KAea5bZyQRPIpojrVoI4AXGJS/ycu/fBTdLrUkA4ODrvjw==", + "dev": true, + "license": "MIT", + "dependencies": { + "environment": "^1.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/marked-terminal/node_modules/ansi-regex": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", + "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/marked-terminal/node_modules/chalk": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz", + "integrity": "sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.17.0 || ^14.13 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, "node_modules/md5.js": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", @@ -6544,6 +6889,18 @@ "queue-tick": "^1.0.0" } }, + "node_modules/mz": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz", + "integrity": "sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "any-promise": "^1.0.0", + "object-assign": "^4.0.1", + "thenify-all": "^1.0.0" + } + }, "node_modules/nanoassert": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/nanoassert/-/nanoassert-1.1.0.tgz", @@ -6693,6 +7050,22 @@ "lower-case": "^1.1.1" } }, + "node_modules/node-emoji": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/node-emoji/-/node-emoji-2.1.3.tgz", + "integrity": "sha512-E2WEOVsgs7O16zsURJ/eH8BqhF029wGpEOnv7Urwdo2wmQanOACwJQh0devF9D9RhoZru0+9JXIS0dBXIAz+lA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@sindresorhus/is": "^4.6.0", + "char-regex": "^1.0.2", + "emojilib": "^2.4.0", + "skin-tone": "^2.0.0" + }, + "engines": { + "node": ">=18" + } + }, "node_modules/node-int64": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", @@ -6750,6 +7123,16 @@ "node": ">=0.10.0" } }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/object-inspect": { "version": "1.13.3", "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.3.tgz", @@ -6957,6 +7340,30 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/parse5": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-5.1.1.tgz", + "integrity": "sha512-ugq4DFI0Ptb+WWjAdOK16+u/nHfiIrcE+sh8kZMaM0WllQKLI9rOUq6c2b7cwPkXdzfQESqvoqK6ug7U/Yyzug==", + "dev": true, + "license": "MIT" + }, + "node_modules/parse5-htmlparser2-tree-adapter": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/parse5-htmlparser2-tree-adapter/-/parse5-htmlparser2-tree-adapter-6.0.1.tgz", + "integrity": "sha512-qPuWvbLgvDGilKc5BoicRovlT4MtYT6JfJyBOMDsKoiT+GiuP5qyrPCnR9HcPECIJJmZh5jRndyNThnhhb/vlA==", + "dev": true, + "license": "MIT", + "dependencies": { + "parse5": "^6.0.1" + } + }, + "node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-6.0.1.tgz", + "integrity": "sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw==", + "dev": true, + "license": "MIT" + }, "node_modules/path-browserify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-1.0.1.tgz", @@ -7312,16 +7719,6 @@ "dev": true, "license": "MIT" }, - "node_modules/readable-stream/node_modules/string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "license": "MIT", - "dependencies": { - "safe-buffer": "~5.1.0" - } - }, "node_modules/regenerate": { "version": "1.4.2", "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.2.tgz", @@ -7697,6 +8094,19 @@ "dev": true, "license": "MIT" }, + "node_modules/skin-tone": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/skin-tone/-/skin-tone-2.0.0.tgz", + "integrity": "sha512-kUMbT1oBJCpgrnKoSr0o6wPtvRWT9W9UKvGLwfJYO2WuahZRHOpEyL1ckyMGgMWh0UdpmaoFqKKD29WTomNEGA==", + "dev": true, + "license": "MIT", + "dependencies": { + "unicode-emoji-modifier-base": "^1.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/slash": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", @@ -7877,15 +8287,22 @@ } }, "node_modules/string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "dev": true, "license": "MIT", "dependencies": { - "safe-buffer": "~5.2.0" + "safe-buffer": "~5.1.0" } }, + "node_modules/string_decoder/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true, + "license": "MIT" + }, "node_modules/string-length": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/string-length/-/string-length-4.0.2.tgz", @@ -8007,6 +8424,23 @@ "node": ">=8" } }, + "node_modules/supports-hyperlinks": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/supports-hyperlinks/-/supports-hyperlinks-3.1.0.tgz", + "integrity": "sha512-2rn0BZ+/f7puLOHZm1HOJfwBggfaHXUpPUSSG/SWM4TWp5KCfmNYwnC3hruy2rZlMnmWZ+QAGpZfchu3f3695A==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0", + "supports-color": "^7.0.0" + }, + "engines": { + "node": ">=14.18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/supports-preserve-symlinks-flag": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", @@ -8105,6 +8539,29 @@ "node": ">=8" } }, + "node_modules/thenify": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz", + "integrity": "sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==", + "dev": true, + "license": "MIT", + "dependencies": { + "any-promise": "^1.0.0" + } + }, + "node_modules/thenify-all": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/thenify-all/-/thenify-all-1.6.0.tgz", + "integrity": "sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==", + "dev": true, + "license": "MIT", + "dependencies": { + "thenify": ">= 3.1.0 < 4" + }, + "engines": { + "node": ">=0.8" + } + }, "node_modules/through": { "version": "2.3.8", "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", @@ -8260,9 +8717,9 @@ "license": "MIT" }, "node_modules/typescript": { - "version": "5.6.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.6.3.tgz", - "integrity": "sha512-hjcS1mhfuyi4WW8IWtjP7brDrG2cuDZukyrYrSauoXGNgx0S7zceP07adYkJycEr56BOUTNPzbInooiN3fn1qw==", + "version": "5.7.1-rc", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.7.1-rc.tgz", + "integrity": "sha512-d6m+HT78uZtyUbXbUyIvuJ6kXCTSJEfy+2pZSUwt9d6JZ0kOMNDwhIILfV5FnaxMwVa48Yfw4sK0ISC4Qyq5tw==", "dev": true, "license": "Apache-2.0", "bin": { @@ -8317,6 +8774,16 @@ "node": ">=4" } }, + "node_modules/unicode-emoji-modifier-base": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unicode-emoji-modifier-base/-/unicode-emoji-modifier-base-1.0.0.tgz", + "integrity": "sha512-yLSH4py7oFH3oG/9K+XWrz1pSi3dfUrWEnInbxMfArOfc1+33BlGPQtLsOYwvdMy11AwUBetYuaRxSPqgkq+8g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, "node_modules/unicode-match-property-ecmascript": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-2.0.0.tgz", @@ -8456,6 +8923,16 @@ "node": ">=10.12.0" } }, + "node_modules/validate-npm-package-name": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/validate-npm-package-name/-/validate-npm-package-name-5.0.1.tgz", + "integrity": "sha512-OljLrQ9SQdOUqTaQxqL5dEfZWrXExyyWsozYlAWFawPVNuD83igl7uJD2RTkNMbniIYgt8l81eCJGIdQF7avLQ==", + "dev": true, + "license": "ISC", + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, "node_modules/vm-browserify": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-1.1.2.tgz", diff --git a/package.json b/package.json index 5f12ffd..5d3c190 100644 --- a/package.json +++ b/package.json @@ -2,21 +2,30 @@ "name": "@orchidjs/unicode-variants", "version": "1.0.4", "description": "Unicode variant string matching", - "main": "dist/umd/index.js", - "browser": "dist/umd/index.js", - "module": "dist/esm/index.js", - "types": "dist/types/index.d.mts", "repository": { "type": "git", "url": "https://github.com/orchidjs/unicode-variants.git" }, + "type": "module", + "main": "dist/cjs/index.js", + "module": "dist/esm/index.js", + "browser": "dist/umd/index.js", + "exports": { + ".": { + "import": "./dist/esm/index.js", + "require": "./dist/cjs/index.js" + }, + "./package.json": "./package.json" + }, "scripts": { "pretest": "npm run build", "test": "jest --coverage", - "test:typescript": "tsc -p .config --noemit", + "test:types": "attw --pack .", "bench": "npx 0x -- node --zero-fill-buffers bench.mjs", - "build": "npx rollup -c .config/rollup.config.mjs", - "build:types": "tsc -p .config --emitDeclarationOnly" + "build": "rm -rf dist && npm run build:esm && npm run build:cjs && npm run build:umd", + "build:esm": "tsc -p .config/tsconfig.esm.json", + "build:cjs": "tsc -p .config/tsconfig.cjs.json && echo '{\"type\":\"commonjs\"}' > ./dist/cjs/package.json", + "build:umd": "npx rollup -c .config/rollup.config.mjs" }, "keywords": [ "unicode", @@ -34,7 +43,6 @@ "/dist", "/lib" ], - "dependencies": {}, "browserslist": [ ">= 0.5%", "not dead", @@ -47,15 +55,16 @@ "not Explorer <= 11" ], "devDependencies": { - "0x": "^5.7.0", + "@arethetypeswrong/cli": "^0.17.0", "@babel/core": "^7.26.0", "@babel/preset-env": "^7.26.0", "@babel/preset-typescript": "^7.26.0", "@rollup/plugin-babel": "^6.0.4", "@rollup/plugin-terser": "^0.4.4", + "0x": "^5.7.0", "jest": "^29.7.0", "rollup": "^4.26.0", - "typescript": "^5.6.3" + "typescript": "^5.7.1-rc" }, "jest": { "verbose": true,