create-microact-app 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +95 -0
- package/package.json +21 -0
- package/templates/vanilla/.github/workflows/deploy.yml +38 -0
- package/templates/vanilla/index.html +13 -0
- package/templates/vanilla/node_modules/.package-lock.json +207 -0
- package/templates/vanilla/node_modules/@esbuild/darwin-x64/README.md +3 -0
- package/templates/vanilla/node_modules/@esbuild/darwin-x64/bin/esbuild +0 -0
- package/templates/vanilla/node_modules/@esbuild/darwin-x64/package.json +17 -0
- package/templates/vanilla/node_modules/@monygroupcorp/microact/README.md +154 -0
- package/templates/vanilla/node_modules/@monygroupcorp/microact/dist/microact.cjs.js +1749 -0
- package/templates/vanilla/node_modules/@monygroupcorp/microact/dist/microact.cjs.js.map +1 -0
- package/templates/vanilla/node_modules/@monygroupcorp/microact/dist/microact.esm.js +1743 -0
- package/templates/vanilla/node_modules/@monygroupcorp/microact/dist/microact.esm.js.map +1 -0
- package/templates/vanilla/node_modules/@monygroupcorp/microact/dist/microact.umd.js +2 -0
- package/templates/vanilla/node_modules/@monygroupcorp/microact/dist/microact.umd.js.map +1 -0
- package/templates/vanilla/node_modules/@monygroupcorp/microact/example/index.html +13 -0
- package/templates/vanilla/node_modules/@monygroupcorp/microact/example/index.js +63 -0
- package/templates/vanilla/node_modules/@monygroupcorp/microact/package.json +38 -0
- package/templates/vanilla/node_modules/@monygroupcorp/microact/rollup.config.cjs +30 -0
- package/templates/vanilla/node_modules/@monygroupcorp/microact/src/Component.js +831 -0
- package/templates/vanilla/node_modules/@monygroupcorp/microact/src/DOMUpdater.js +320 -0
- package/templates/vanilla/node_modules/@monygroupcorp/microact/src/EventBus.js +123 -0
- package/templates/vanilla/node_modules/@monygroupcorp/microact/src/Router.js +253 -0
- package/templates/vanilla/node_modules/@monygroupcorp/microact/src/UpdateScheduler.js +218 -0
- package/templates/vanilla/node_modules/@monygroupcorp/microact/src/index.js +6 -0
- package/templates/vanilla/node_modules/esbuild/LICENSE.md +21 -0
- package/templates/vanilla/node_modules/esbuild/README.md +3 -0
- package/templates/vanilla/node_modules/esbuild/bin/esbuild +0 -0
- package/templates/vanilla/node_modules/esbuild/install.js +287 -0
- package/templates/vanilla/node_modules/esbuild/lib/main.d.ts +660 -0
- package/templates/vanilla/node_modules/esbuild/lib/main.js +2393 -0
- package/templates/vanilla/node_modules/esbuild/package.json +42 -0
- package/templates/vanilla/node_modules/nanoid/LICENSE +20 -0
- package/templates/vanilla/node_modules/nanoid/README.md +39 -0
- package/templates/vanilla/node_modules/nanoid/async/index.browser.cjs +69 -0
- package/templates/vanilla/node_modules/nanoid/async/index.browser.js +34 -0
- package/templates/vanilla/node_modules/nanoid/async/index.cjs +71 -0
- package/templates/vanilla/node_modules/nanoid/async/index.d.ts +56 -0
- package/templates/vanilla/node_modules/nanoid/async/index.js +35 -0
- package/templates/vanilla/node_modules/nanoid/async/index.native.js +26 -0
- package/templates/vanilla/node_modules/nanoid/async/package.json +12 -0
- package/templates/vanilla/node_modules/nanoid/bin/nanoid.cjs +55 -0
- package/templates/vanilla/node_modules/nanoid/index.browser.cjs +72 -0
- package/templates/vanilla/node_modules/nanoid/index.browser.js +34 -0
- package/templates/vanilla/node_modules/nanoid/index.cjs +85 -0
- package/templates/vanilla/node_modules/nanoid/index.d.cts +91 -0
- package/templates/vanilla/node_modules/nanoid/index.d.ts +91 -0
- package/templates/vanilla/node_modules/nanoid/index.js +45 -0
- package/templates/vanilla/node_modules/nanoid/nanoid.js +1 -0
- package/templates/vanilla/node_modules/nanoid/non-secure/index.cjs +34 -0
- package/templates/vanilla/node_modules/nanoid/non-secure/index.d.ts +33 -0
- package/templates/vanilla/node_modules/nanoid/non-secure/index.js +21 -0
- package/templates/vanilla/node_modules/nanoid/non-secure/package.json +6 -0
- package/templates/vanilla/node_modules/nanoid/package.json +89 -0
- package/templates/vanilla/node_modules/nanoid/url-alphabet/index.cjs +7 -0
- package/templates/vanilla/node_modules/nanoid/url-alphabet/index.js +3 -0
- package/templates/vanilla/node_modules/nanoid/url-alphabet/package.json +6 -0
- package/templates/vanilla/node_modules/picocolors/LICENSE +15 -0
- package/templates/vanilla/node_modules/picocolors/README.md +21 -0
- package/templates/vanilla/node_modules/picocolors/package.json +25 -0
- package/templates/vanilla/node_modules/picocolors/picocolors.browser.js +4 -0
- package/templates/vanilla/node_modules/picocolors/picocolors.d.ts +5 -0
- package/templates/vanilla/node_modules/picocolors/picocolors.js +75 -0
- package/templates/vanilla/node_modules/picocolors/types.d.ts +51 -0
- package/templates/vanilla/node_modules/postcss/LICENSE +20 -0
- package/templates/vanilla/node_modules/postcss/README.md +29 -0
- package/templates/vanilla/node_modules/postcss/lib/at-rule.d.ts +140 -0
- package/templates/vanilla/node_modules/postcss/lib/at-rule.js +25 -0
- package/templates/vanilla/node_modules/postcss/lib/comment.d.ts +68 -0
- package/templates/vanilla/node_modules/postcss/lib/comment.js +13 -0
- package/templates/vanilla/node_modules/postcss/lib/container.d.ts +483 -0
- package/templates/vanilla/node_modules/postcss/lib/container.js +447 -0
- package/templates/vanilla/node_modules/postcss/lib/css-syntax-error.d.ts +248 -0
- package/templates/vanilla/node_modules/postcss/lib/css-syntax-error.js +133 -0
- package/templates/vanilla/node_modules/postcss/lib/declaration.d.ts +151 -0
- package/templates/vanilla/node_modules/postcss/lib/declaration.js +24 -0
- package/templates/vanilla/node_modules/postcss/lib/document.d.ts +69 -0
- package/templates/vanilla/node_modules/postcss/lib/document.js +33 -0
- package/templates/vanilla/node_modules/postcss/lib/fromJSON.d.ts +9 -0
- package/templates/vanilla/node_modules/postcss/lib/fromJSON.js +54 -0
- package/templates/vanilla/node_modules/postcss/lib/input.d.ts +227 -0
- package/templates/vanilla/node_modules/postcss/lib/input.js +265 -0
- package/templates/vanilla/node_modules/postcss/lib/lazy-result.d.ts +190 -0
- package/templates/vanilla/node_modules/postcss/lib/lazy-result.js +550 -0
- package/templates/vanilla/node_modules/postcss/lib/list.d.ts +60 -0
- package/templates/vanilla/node_modules/postcss/lib/list.js +58 -0
- package/templates/vanilla/node_modules/postcss/lib/map-generator.js +368 -0
- package/templates/vanilla/node_modules/postcss/lib/no-work-result.d.ts +46 -0
- package/templates/vanilla/node_modules/postcss/lib/no-work-result.js +138 -0
- package/templates/vanilla/node_modules/postcss/lib/node.d.ts +556 -0
- package/templates/vanilla/node_modules/postcss/lib/node.js +449 -0
- package/templates/vanilla/node_modules/postcss/lib/parse.d.ts +9 -0
- package/templates/vanilla/node_modules/postcss/lib/parse.js +42 -0
- package/templates/vanilla/node_modules/postcss/lib/parser.js +611 -0
- package/templates/vanilla/node_modules/postcss/lib/postcss.d.mts +69 -0
- package/templates/vanilla/node_modules/postcss/lib/postcss.d.ts +458 -0
- package/templates/vanilla/node_modules/postcss/lib/postcss.js +101 -0
- package/templates/vanilla/node_modules/postcss/lib/postcss.mjs +30 -0
- package/templates/vanilla/node_modules/postcss/lib/previous-map.d.ts +81 -0
- package/templates/vanilla/node_modules/postcss/lib/previous-map.js +144 -0
- package/templates/vanilla/node_modules/postcss/lib/processor.d.ts +115 -0
- package/templates/vanilla/node_modules/postcss/lib/processor.js +67 -0
- package/templates/vanilla/node_modules/postcss/lib/result.d.ts +205 -0
- package/templates/vanilla/node_modules/postcss/lib/result.js +42 -0
- package/templates/vanilla/node_modules/postcss/lib/root.d.ts +87 -0
- package/templates/vanilla/node_modules/postcss/lib/root.js +61 -0
- package/templates/vanilla/node_modules/postcss/lib/rule.d.ts +126 -0
- package/templates/vanilla/node_modules/postcss/lib/rule.js +27 -0
- package/templates/vanilla/node_modules/postcss/lib/stringifier.d.ts +46 -0
- package/templates/vanilla/node_modules/postcss/lib/stringifier.js +353 -0
- package/templates/vanilla/node_modules/postcss/lib/stringify.d.ts +9 -0
- package/templates/vanilla/node_modules/postcss/lib/stringify.js +11 -0
- package/templates/vanilla/node_modules/postcss/lib/symbols.js +5 -0
- package/templates/vanilla/node_modules/postcss/lib/terminal-highlight.js +70 -0
- package/templates/vanilla/node_modules/postcss/lib/tokenize.js +266 -0
- package/templates/vanilla/node_modules/postcss/lib/warn-once.js +13 -0
- package/templates/vanilla/node_modules/postcss/lib/warning.d.ts +147 -0
- package/templates/vanilla/node_modules/postcss/lib/warning.js +37 -0
- package/templates/vanilla/node_modules/postcss/package.json +88 -0
- package/templates/vanilla/node_modules/rollup/LICENSE.md +695 -0
- package/templates/vanilla/node_modules/rollup/README.md +125 -0
- package/templates/vanilla/node_modules/rollup/dist/bin/rollup +1715 -0
- package/templates/vanilla/node_modules/rollup/dist/es/getLogFilter.js +64 -0
- package/templates/vanilla/node_modules/rollup/dist/es/package.json +1 -0
- package/templates/vanilla/node_modules/rollup/dist/es/rollup.js +17 -0
- package/templates/vanilla/node_modules/rollup/dist/es/shared/node-entry.js +27273 -0
- package/templates/vanilla/node_modules/rollup/dist/es/shared/watch.js +4857 -0
- package/templates/vanilla/node_modules/rollup/dist/getLogFilter.d.ts +5 -0
- package/templates/vanilla/node_modules/rollup/dist/getLogFilter.js +69 -0
- package/templates/vanilla/node_modules/rollup/dist/loadConfigFile.d.ts +20 -0
- package/templates/vanilla/node_modules/rollup/dist/loadConfigFile.js +29 -0
- package/templates/vanilla/node_modules/rollup/dist/rollup.d.ts +1012 -0
- package/templates/vanilla/node_modules/rollup/dist/rollup.js +31 -0
- package/templates/vanilla/node_modules/rollup/dist/shared/fsevents-importer.js +37 -0
- package/templates/vanilla/node_modules/rollup/dist/shared/index.js +4571 -0
- package/templates/vanilla/node_modules/rollup/dist/shared/loadConfigFile.js +546 -0
- package/templates/vanilla/node_modules/rollup/dist/shared/rollup.js +27351 -0
- package/templates/vanilla/node_modules/rollup/dist/shared/watch-cli.js +561 -0
- package/templates/vanilla/node_modules/rollup/dist/shared/watch-proxy.js +87 -0
- package/templates/vanilla/node_modules/rollup/dist/shared/watch.js +316 -0
- package/templates/vanilla/node_modules/rollup/package.json +181 -0
- package/templates/vanilla/node_modules/source-map-js/LICENSE +28 -0
- package/templates/vanilla/node_modules/source-map-js/README.md +765 -0
- package/templates/vanilla/node_modules/source-map-js/lib/array-set.js +121 -0
- package/templates/vanilla/node_modules/source-map-js/lib/base64-vlq.js +140 -0
- package/templates/vanilla/node_modules/source-map-js/lib/base64.js +67 -0
- package/templates/vanilla/node_modules/source-map-js/lib/binary-search.js +111 -0
- package/templates/vanilla/node_modules/source-map-js/lib/mapping-list.js +79 -0
- package/templates/vanilla/node_modules/source-map-js/lib/quick-sort.js +132 -0
- package/templates/vanilla/node_modules/source-map-js/lib/source-map-consumer.d.ts +1 -0
- package/templates/vanilla/node_modules/source-map-js/lib/source-map-consumer.js +1188 -0
- package/templates/vanilla/node_modules/source-map-js/lib/source-map-generator.d.ts +1 -0
- package/templates/vanilla/node_modules/source-map-js/lib/source-map-generator.js +444 -0
- package/templates/vanilla/node_modules/source-map-js/lib/source-node.d.ts +1 -0
- package/templates/vanilla/node_modules/source-map-js/lib/source-node.js +413 -0
- package/templates/vanilla/node_modules/source-map-js/lib/util.js +594 -0
- package/templates/vanilla/node_modules/source-map-js/package.json +71 -0
- package/templates/vanilla/node_modules/source-map-js/source-map.d.ts +104 -0
- package/templates/vanilla/node_modules/source-map-js/source-map.js +8 -0
- package/templates/vanilla/node_modules/vite/LICENSE.md +3396 -0
- package/templates/vanilla/node_modules/vite/README.md +20 -0
- package/templates/vanilla/node_modules/vite/bin/openChrome.applescript +95 -0
- package/templates/vanilla/node_modules/vite/bin/vite.js +61 -0
- package/templates/vanilla/node_modules/vite/client.d.ts +281 -0
- package/templates/vanilla/node_modules/vite/dist/client/client.mjs +725 -0
- package/templates/vanilla/node_modules/vite/dist/client/client.mjs.map +1 -0
- package/templates/vanilla/node_modules/vite/dist/client/env.mjs +30 -0
- package/templates/vanilla/node_modules/vite/dist/client/env.mjs.map +1 -0
- package/templates/vanilla/node_modules/vite/dist/node/chunks/dep-7ec6f216.js +914 -0
- package/templates/vanilla/node_modules/vite/dist/node/chunks/dep-827b23df.js +66713 -0
- package/templates/vanilla/node_modules/vite/dist/node/chunks/dep-c423598f.js +561 -0
- package/templates/vanilla/node_modules/vite/dist/node/chunks/dep-f0c7dae0.js +7930 -0
- package/templates/vanilla/node_modules/vite/dist/node/chunks/dep-f1e8587f.js +7646 -0
- package/templates/vanilla/node_modules/vite/dist/node/cli.js +929 -0
- package/templates/vanilla/node_modules/vite/dist/node/constants.js +130 -0
- package/templates/vanilla/node_modules/vite/dist/node/index.d.ts +3548 -0
- package/templates/vanilla/node_modules/vite/dist/node/index.js +158 -0
- package/templates/vanilla/node_modules/vite/dist/node-cjs/publicUtils.cjs +4555 -0
- package/templates/vanilla/node_modules/vite/index.cjs +34 -0
- package/templates/vanilla/node_modules/vite/package.json +173 -0
- package/templates/vanilla/node_modules/vite/types/customEvent.d.ts +35 -0
- package/templates/vanilla/node_modules/vite/types/hmrPayload.d.ts +61 -0
- package/templates/vanilla/node_modules/vite/types/hot.d.ts +32 -0
- package/templates/vanilla/node_modules/vite/types/importGlob.d.ts +97 -0
- package/templates/vanilla/node_modules/vite/types/importMeta.d.ts +26 -0
- package/templates/vanilla/node_modules/vite/types/metadata.d.ts +10 -0
- package/templates/vanilla/node_modules/vite/types/package.json +4 -0
- package/templates/vanilla/package-lock.json +589 -0
- package/templates/vanilla/package.json +17 -0
- package/templates/vanilla/src/components/App.js +60 -0
- package/templates/vanilla/src/components/Card.js +21 -0
- package/templates/vanilla/src/components/Hero.js +15 -0
- package/templates/vanilla/src/components/InteractiveDemo.js +59 -0
- package/templates/vanilla/src/main.js +9 -0
- package/templates/vanilla/src/style/main.css +172 -0
- package/templates/vanilla/vite.config.js +8 -0
- package/templates/web3/.env.example +15 -0
- package/templates/web3/.github/workflows/deploy.yml +38 -0
- package/templates/web3/README.md +33 -0
- package/templates/web3/contracts/foundry.toml +11 -0
- package/templates/web3/contracts/script/Deploy.s.sol +13 -0
- package/templates/web3/contracts/src/Counter.sol +21 -0
- package/templates/web3/index.html +13 -0
- package/templates/web3/package.json +25 -0
- package/templates/web3/scripts/chain-start.mjs +305 -0
- package/templates/web3/scripts/chain-stop.mjs +34 -0
- package/templates/web3/scripts/deploy.mjs +155 -0
- package/templates/web3/scripts/setup.mjs +42 -0
- package/templates/web3/src/components/App.js +49 -0
- package/templates/web3/src/components/CounterCard.js +111 -0
- package/templates/web3/src/main.js +54 -0
- package/templates/web3/src/style/main.css +345 -0
- package/templates/web3/vite.config.js +29 -0
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generate secure URL-friendly unique ID.
|
|
3
|
+
*
|
|
4
|
+
* By default, the ID will have 21 symbols to have a collision probability
|
|
5
|
+
* similar to UUID v4.
|
|
6
|
+
*
|
|
7
|
+
* ```js
|
|
8
|
+
* import { nanoid } from 'nanoid'
|
|
9
|
+
* model.id = nanoid() //=> "Uakgb_J5m9g-0JDMbcJqL"
|
|
10
|
+
* ```
|
|
11
|
+
*
|
|
12
|
+
* @param size Size of the ID. The default size is 21.
|
|
13
|
+
* @returns A random string.
|
|
14
|
+
*/
|
|
15
|
+
export function nanoid(size?: number): string
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Generate secure unique ID with custom alphabet.
|
|
19
|
+
*
|
|
20
|
+
* Alphabet must contain 256 symbols or less. Otherwise, the generator
|
|
21
|
+
* will not be secure.
|
|
22
|
+
*
|
|
23
|
+
* @param alphabet Alphabet used to generate the ID.
|
|
24
|
+
* @param defaultSize Size of the ID. The default size is 21.
|
|
25
|
+
* @returns A random string generator.
|
|
26
|
+
*
|
|
27
|
+
* ```js
|
|
28
|
+
* const { customAlphabet } = require('nanoid')
|
|
29
|
+
* const nanoid = customAlphabet('0123456789абвгдеё', 5)
|
|
30
|
+
* nanoid() //=> "8ё56а"
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
export function customAlphabet(
|
|
34
|
+
alphabet: string,
|
|
35
|
+
defaultSize?: number
|
|
36
|
+
): (size?: number) => string
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Generate unique ID with custom random generator and alphabet.
|
|
40
|
+
*
|
|
41
|
+
* Alphabet must contain 256 symbols or less. Otherwise, the generator
|
|
42
|
+
* will not be secure.
|
|
43
|
+
*
|
|
44
|
+
* ```js
|
|
45
|
+
* import { customRandom } from 'nanoid/format'
|
|
46
|
+
*
|
|
47
|
+
* const nanoid = customRandom('abcdef', 5, size => {
|
|
48
|
+
* const random = []
|
|
49
|
+
* for (let i = 0; i < size; i++) {
|
|
50
|
+
* random.push(randomByte())
|
|
51
|
+
* }
|
|
52
|
+
* return random
|
|
53
|
+
* })
|
|
54
|
+
*
|
|
55
|
+
* nanoid() //=> "fbaef"
|
|
56
|
+
* ```
|
|
57
|
+
*
|
|
58
|
+
* @param alphabet Alphabet used to generate a random string.
|
|
59
|
+
* @param size Size of the random string.
|
|
60
|
+
* @param random A random bytes generator.
|
|
61
|
+
* @returns A random string generator.
|
|
62
|
+
*/
|
|
63
|
+
export function customRandom(
|
|
64
|
+
alphabet: string,
|
|
65
|
+
size: number,
|
|
66
|
+
random: (bytes: number) => Uint8Array
|
|
67
|
+
): () => string
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* URL safe symbols.
|
|
71
|
+
*
|
|
72
|
+
* ```js
|
|
73
|
+
* import { urlAlphabet } from 'nanoid'
|
|
74
|
+
* const nanoid = customAlphabet(urlAlphabet, 10)
|
|
75
|
+
* nanoid() //=> "Uakgb_J5m9"
|
|
76
|
+
* ```
|
|
77
|
+
*/
|
|
78
|
+
export const urlAlphabet: string
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Generate an array of random bytes collected from hardware noise.
|
|
82
|
+
*
|
|
83
|
+
* ```js
|
|
84
|
+
* import { customRandom, random } from 'nanoid'
|
|
85
|
+
* const nanoid = customRandom("abcdef", 5, random)
|
|
86
|
+
* ```
|
|
87
|
+
*
|
|
88
|
+
* @param bytes Size of the array.
|
|
89
|
+
* @returns An array of random bytes.
|
|
90
|
+
*/
|
|
91
|
+
export function random(bytes: number): Uint8Array
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generate secure URL-friendly unique ID.
|
|
3
|
+
*
|
|
4
|
+
* By default, the ID will have 21 symbols to have a collision probability
|
|
5
|
+
* similar to UUID v4.
|
|
6
|
+
*
|
|
7
|
+
* ```js
|
|
8
|
+
* import { nanoid } from 'nanoid'
|
|
9
|
+
* model.id = nanoid() //=> "Uakgb_J5m9g-0JDMbcJqL"
|
|
10
|
+
* ```
|
|
11
|
+
*
|
|
12
|
+
* @param size Size of the ID. The default size is 21.
|
|
13
|
+
* @returns A random string.
|
|
14
|
+
*/
|
|
15
|
+
export function nanoid(size?: number): string
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Generate secure unique ID with custom alphabet.
|
|
19
|
+
*
|
|
20
|
+
* Alphabet must contain 256 symbols or less. Otherwise, the generator
|
|
21
|
+
* will not be secure.
|
|
22
|
+
*
|
|
23
|
+
* @param alphabet Alphabet used to generate the ID.
|
|
24
|
+
* @param defaultSize Size of the ID. The default size is 21.
|
|
25
|
+
* @returns A random string generator.
|
|
26
|
+
*
|
|
27
|
+
* ```js
|
|
28
|
+
* const { customAlphabet } = require('nanoid')
|
|
29
|
+
* const nanoid = customAlphabet('0123456789абвгдеё', 5)
|
|
30
|
+
* nanoid() //=> "8ё56а"
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
export function customAlphabet(
|
|
34
|
+
alphabet: string,
|
|
35
|
+
defaultSize?: number
|
|
36
|
+
): (size?: number) => string
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Generate unique ID with custom random generator and alphabet.
|
|
40
|
+
*
|
|
41
|
+
* Alphabet must contain 256 symbols or less. Otherwise, the generator
|
|
42
|
+
* will not be secure.
|
|
43
|
+
*
|
|
44
|
+
* ```js
|
|
45
|
+
* import { customRandom } from 'nanoid/format'
|
|
46
|
+
*
|
|
47
|
+
* const nanoid = customRandom('abcdef', 5, size => {
|
|
48
|
+
* const random = []
|
|
49
|
+
* for (let i = 0; i < size; i++) {
|
|
50
|
+
* random.push(randomByte())
|
|
51
|
+
* }
|
|
52
|
+
* return random
|
|
53
|
+
* })
|
|
54
|
+
*
|
|
55
|
+
* nanoid() //=> "fbaef"
|
|
56
|
+
* ```
|
|
57
|
+
*
|
|
58
|
+
* @param alphabet Alphabet used to generate a random string.
|
|
59
|
+
* @param size Size of the random string.
|
|
60
|
+
* @param random A random bytes generator.
|
|
61
|
+
* @returns A random string generator.
|
|
62
|
+
*/
|
|
63
|
+
export function customRandom(
|
|
64
|
+
alphabet: string,
|
|
65
|
+
size: number,
|
|
66
|
+
random: (bytes: number) => Uint8Array
|
|
67
|
+
): () => string
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* URL safe symbols.
|
|
71
|
+
*
|
|
72
|
+
* ```js
|
|
73
|
+
* import { urlAlphabet } from 'nanoid'
|
|
74
|
+
* const nanoid = customAlphabet(urlAlphabet, 10)
|
|
75
|
+
* nanoid() //=> "Uakgb_J5m9"
|
|
76
|
+
* ```
|
|
77
|
+
*/
|
|
78
|
+
export const urlAlphabet: string
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Generate an array of random bytes collected from hardware noise.
|
|
82
|
+
*
|
|
83
|
+
* ```js
|
|
84
|
+
* import { customRandom, random } from 'nanoid'
|
|
85
|
+
* const nanoid = customRandom("abcdef", 5, random)
|
|
86
|
+
* ```
|
|
87
|
+
*
|
|
88
|
+
* @param bytes Size of the array.
|
|
89
|
+
* @returns An array of random bytes.
|
|
90
|
+
*/
|
|
91
|
+
export function random(bytes: number): Uint8Array
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import crypto from 'crypto'
|
|
2
|
+
import { urlAlphabet } from './url-alphabet/index.js'
|
|
3
|
+
const POOL_SIZE_MULTIPLIER = 128
|
|
4
|
+
let pool, poolOffset
|
|
5
|
+
let fillPool = bytes => {
|
|
6
|
+
if (!pool || pool.length < bytes) {
|
|
7
|
+
pool = Buffer.allocUnsafe(bytes * POOL_SIZE_MULTIPLIER)
|
|
8
|
+
crypto.randomFillSync(pool)
|
|
9
|
+
poolOffset = 0
|
|
10
|
+
} else if (poolOffset + bytes > pool.length) {
|
|
11
|
+
crypto.randomFillSync(pool)
|
|
12
|
+
poolOffset = 0
|
|
13
|
+
}
|
|
14
|
+
poolOffset += bytes
|
|
15
|
+
}
|
|
16
|
+
let random = bytes => {
|
|
17
|
+
fillPool((bytes |= 0))
|
|
18
|
+
return pool.subarray(poolOffset - bytes, poolOffset)
|
|
19
|
+
}
|
|
20
|
+
let customRandom = (alphabet, defaultSize, getRandom) => {
|
|
21
|
+
let mask = (2 << (31 - Math.clz32((alphabet.length - 1) | 1))) - 1
|
|
22
|
+
let step = Math.ceil((1.6 * mask * defaultSize) / alphabet.length)
|
|
23
|
+
return (size = defaultSize) => {
|
|
24
|
+
let id = ''
|
|
25
|
+
while (true) {
|
|
26
|
+
let bytes = getRandom(step)
|
|
27
|
+
let i = step
|
|
28
|
+
while (i--) {
|
|
29
|
+
id += alphabet[bytes[i] & mask] || ''
|
|
30
|
+
if (id.length === size) return id
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
let customAlphabet = (alphabet, size = 21) =>
|
|
36
|
+
customRandom(alphabet, size, random)
|
|
37
|
+
let nanoid = (size = 21) => {
|
|
38
|
+
fillPool((size |= 0))
|
|
39
|
+
let id = ''
|
|
40
|
+
for (let i = poolOffset - size; i < poolOffset; i++) {
|
|
41
|
+
id += urlAlphabet[pool[i] & 63]
|
|
42
|
+
}
|
|
43
|
+
return id
|
|
44
|
+
}
|
|
45
|
+
export { nanoid, customAlphabet, customRandom, urlAlphabet, random }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export let nanoid=(t=21)=>crypto.getRandomValues(new Uint8Array(t)).reduce(((t,e)=>t+=(e&=63)<36?e.toString(36):e<62?(e-26).toString(36).toUpperCase():e<63?"_":"-"),"");
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
// This alphabet uses `A-Za-z0-9_-` symbols.
|
|
2
|
+
// The order of characters is optimized for better gzip and brotli compression.
|
|
3
|
+
// References to the same file (works both for gzip and brotli):
|
|
4
|
+
// `'use`, `andom`, and `rict'`
|
|
5
|
+
// References to the brotli default dictionary:
|
|
6
|
+
// `-26T`, `1983`, `40px`, `75px`, `bush`, `jack`, `mind`, `very`, and `wolf`
|
|
7
|
+
let urlAlphabet =
|
|
8
|
+
'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict'
|
|
9
|
+
|
|
10
|
+
let customAlphabet = (alphabet, defaultSize = 21) => {
|
|
11
|
+
return (size = defaultSize) => {
|
|
12
|
+
let id = ''
|
|
13
|
+
// A compact alternative for `for (var i = 0; i < step; i++)`.
|
|
14
|
+
let i = size | 0
|
|
15
|
+
while (i--) {
|
|
16
|
+
// `| 0` is more compact and faster than `Math.floor()`.
|
|
17
|
+
id += alphabet[(Math.random() * alphabet.length) | 0]
|
|
18
|
+
}
|
|
19
|
+
return id
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
let nanoid = (size = 21) => {
|
|
24
|
+
let id = ''
|
|
25
|
+
// A compact alternative for `for (var i = 0; i < step; i++)`.
|
|
26
|
+
let i = size | 0
|
|
27
|
+
while (i--) {
|
|
28
|
+
// `| 0` is more compact and faster than `Math.floor()`.
|
|
29
|
+
id += urlAlphabet[(Math.random() * 64) | 0]
|
|
30
|
+
}
|
|
31
|
+
return id
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
module.exports = { nanoid, customAlphabet }
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generate URL-friendly unique ID. This method uses the non-secure
|
|
3
|
+
* predictable random generator with bigger collision probability.
|
|
4
|
+
*
|
|
5
|
+
* ```js
|
|
6
|
+
* import { nanoid } from 'nanoid/non-secure'
|
|
7
|
+
* model.id = nanoid() //=> "Uakgb_J5m9g-0JDMbcJqL"
|
|
8
|
+
* ```
|
|
9
|
+
*
|
|
10
|
+
* @param size Size of the ID. The default size is 21.
|
|
11
|
+
* @returns A random string.
|
|
12
|
+
*/
|
|
13
|
+
export function nanoid(size?: number): string
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Generate a unique ID based on a custom alphabet.
|
|
17
|
+
* This method uses the non-secure predictable random generator
|
|
18
|
+
* with bigger collision probability.
|
|
19
|
+
*
|
|
20
|
+
* @param alphabet Alphabet used to generate the ID.
|
|
21
|
+
* @param defaultSize Size of the ID. The default size is 21.
|
|
22
|
+
* @returns A random string generator.
|
|
23
|
+
*
|
|
24
|
+
* ```js
|
|
25
|
+
* import { customAlphabet } from 'nanoid/non-secure'
|
|
26
|
+
* const nanoid = customAlphabet('0123456789абвгдеё', 5)
|
|
27
|
+
* model.id = //=> "8ё56а"
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
export function customAlphabet(
|
|
31
|
+
alphabet: string,
|
|
32
|
+
defaultSize?: number
|
|
33
|
+
): (size?: number) => string
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
let urlAlphabet =
|
|
2
|
+
'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict'
|
|
3
|
+
let customAlphabet = (alphabet, defaultSize = 21) => {
|
|
4
|
+
return (size = defaultSize) => {
|
|
5
|
+
let id = ''
|
|
6
|
+
let i = size | 0
|
|
7
|
+
while (i--) {
|
|
8
|
+
id += alphabet[(Math.random() * alphabet.length) | 0]
|
|
9
|
+
}
|
|
10
|
+
return id
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
let nanoid = (size = 21) => {
|
|
14
|
+
let id = ''
|
|
15
|
+
let i = size | 0
|
|
16
|
+
while (i--) {
|
|
17
|
+
id += urlAlphabet[(Math.random() * 64) | 0]
|
|
18
|
+
}
|
|
19
|
+
return id
|
|
20
|
+
}
|
|
21
|
+
export { nanoid, customAlphabet }
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "nanoid",
|
|
3
|
+
"version": "3.3.11",
|
|
4
|
+
"description": "A tiny (116 bytes), secure URL-friendly unique string ID generator",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"uuid",
|
|
7
|
+
"random",
|
|
8
|
+
"id",
|
|
9
|
+
"url"
|
|
10
|
+
],
|
|
11
|
+
"engines": {
|
|
12
|
+
"node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1"
|
|
13
|
+
},
|
|
14
|
+
"funding": [
|
|
15
|
+
{
|
|
16
|
+
"type": "github",
|
|
17
|
+
"url": "https://github.com/sponsors/ai"
|
|
18
|
+
}
|
|
19
|
+
],
|
|
20
|
+
"author": "Andrey Sitnik <andrey@sitnik.ru>",
|
|
21
|
+
"license": "MIT",
|
|
22
|
+
"repository": "ai/nanoid",
|
|
23
|
+
"browser": {
|
|
24
|
+
"./index.js": "./index.browser.js",
|
|
25
|
+
"./async/index.js": "./async/index.browser.js",
|
|
26
|
+
"./async/index.cjs": "./async/index.browser.cjs",
|
|
27
|
+
"./index.cjs": "./index.browser.cjs"
|
|
28
|
+
},
|
|
29
|
+
"react-native": "index.js",
|
|
30
|
+
"bin": "./bin/nanoid.cjs",
|
|
31
|
+
"sideEffects": false,
|
|
32
|
+
"types": "./index.d.ts",
|
|
33
|
+
"type": "module",
|
|
34
|
+
"main": "index.cjs",
|
|
35
|
+
"module": "index.js",
|
|
36
|
+
"exports": {
|
|
37
|
+
".": {
|
|
38
|
+
"react-native": "./index.browser.js",
|
|
39
|
+
"browser": "./index.browser.js",
|
|
40
|
+
"require": {
|
|
41
|
+
"types": "./index.d.cts",
|
|
42
|
+
"default": "./index.cjs"
|
|
43
|
+
},
|
|
44
|
+
"import": {
|
|
45
|
+
"types": "./index.d.ts",
|
|
46
|
+
"default": "./index.js"
|
|
47
|
+
},
|
|
48
|
+
"default": "./index.js"
|
|
49
|
+
},
|
|
50
|
+
"./package.json": "./package.json",
|
|
51
|
+
"./async/package.json": "./async/package.json",
|
|
52
|
+
"./async": {
|
|
53
|
+
"browser": "./async/index.browser.js",
|
|
54
|
+
"require": {
|
|
55
|
+
"types": "./index.d.cts",
|
|
56
|
+
"default": "./async/index.cjs"
|
|
57
|
+
},
|
|
58
|
+
"import": {
|
|
59
|
+
"types": "./index.d.ts",
|
|
60
|
+
"default": "./async/index.js"
|
|
61
|
+
},
|
|
62
|
+
"default": "./async/index.js"
|
|
63
|
+
},
|
|
64
|
+
"./non-secure/package.json": "./non-secure/package.json",
|
|
65
|
+
"./non-secure": {
|
|
66
|
+
"require": {
|
|
67
|
+
"types": "./index.d.cts",
|
|
68
|
+
"default": "./non-secure/index.cjs"
|
|
69
|
+
},
|
|
70
|
+
"import": {
|
|
71
|
+
"types": "./index.d.ts",
|
|
72
|
+
"default": "./non-secure/index.js"
|
|
73
|
+
},
|
|
74
|
+
"default": "./non-secure/index.js"
|
|
75
|
+
},
|
|
76
|
+
"./url-alphabet/package.json": "./url-alphabet/package.json",
|
|
77
|
+
"./url-alphabet": {
|
|
78
|
+
"require": {
|
|
79
|
+
"types": "./index.d.cts",
|
|
80
|
+
"default": "./url-alphabet/index.cjs"
|
|
81
|
+
},
|
|
82
|
+
"import": {
|
|
83
|
+
"types": "./index.d.ts",
|
|
84
|
+
"default": "./url-alphabet/index.js"
|
|
85
|
+
},
|
|
86
|
+
"default": "./url-alphabet/index.js"
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// This alphabet uses `A-Za-z0-9_-` symbols.
|
|
2
|
+
// The order of characters is optimized for better gzip and brotli compression.
|
|
3
|
+
// Same as in non-secure/index.js
|
|
4
|
+
let urlAlphabet =
|
|
5
|
+
'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict'
|
|
6
|
+
|
|
7
|
+
module.exports = { urlAlphabet }
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
ISC License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2021-2024 Oleksii Raspopov, Kostiantyn Denysov, Anton Verinov
|
|
4
|
+
|
|
5
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
+
purpose with or without fee is hereby granted, provided that the above
|
|
7
|
+
copyright notice and this permission notice appear in all copies.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
10
|
+
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
11
|
+
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
12
|
+
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
13
|
+
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
14
|
+
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
15
|
+
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# picocolors
|
|
2
|
+
|
|
3
|
+
The tiniest and the fastest library for terminal output formatting with ANSI colors.
|
|
4
|
+
|
|
5
|
+
```javascript
|
|
6
|
+
import pc from "picocolors"
|
|
7
|
+
|
|
8
|
+
console.log(
|
|
9
|
+
pc.green(`How are ${pc.italic(`you`)} doing?`)
|
|
10
|
+
)
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
- **No dependencies.**
|
|
14
|
+
- **14 times** smaller and **2 times** faster than chalk.
|
|
15
|
+
- Used by popular tools like PostCSS, SVGO, Stylelint, and Browserslist.
|
|
16
|
+
- Node.js v6+ & browsers support. Support for both CJS and ESM projects.
|
|
17
|
+
- TypeScript type declarations included.
|
|
18
|
+
- [`NO_COLOR`](https://no-color.org/) friendly.
|
|
19
|
+
|
|
20
|
+
## Docs
|
|
21
|
+
Read **[full docs](https://github.com/alexeyraspopov/picocolors#readme)** on GitHub.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "picocolors",
|
|
3
|
+
"version": "1.1.1",
|
|
4
|
+
"main": "./picocolors.js",
|
|
5
|
+
"types": "./picocolors.d.ts",
|
|
6
|
+
"browser": {
|
|
7
|
+
"./picocolors.js": "./picocolors.browser.js"
|
|
8
|
+
},
|
|
9
|
+
"sideEffects": false,
|
|
10
|
+
"description": "The tiniest and the fastest library for terminal output formatting with ANSI colors",
|
|
11
|
+
"files": [
|
|
12
|
+
"picocolors.*",
|
|
13
|
+
"types.d.ts"
|
|
14
|
+
],
|
|
15
|
+
"keywords": [
|
|
16
|
+
"terminal",
|
|
17
|
+
"colors",
|
|
18
|
+
"formatting",
|
|
19
|
+
"cli",
|
|
20
|
+
"console"
|
|
21
|
+
],
|
|
22
|
+
"author": "Alexey Raspopov",
|
|
23
|
+
"repository": "alexeyraspopov/picocolors",
|
|
24
|
+
"license": "ISC"
|
|
25
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
var x=String;
|
|
2
|
+
var create=function() {return {isColorSupported:false,reset:x,bold:x,dim:x,italic:x,underline:x,inverse:x,hidden:x,strikethrough:x,black:x,red:x,green:x,yellow:x,blue:x,magenta:x,cyan:x,white:x,gray:x,bgBlack:x,bgRed:x,bgGreen:x,bgYellow:x,bgBlue:x,bgMagenta:x,bgCyan:x,bgWhite:x,blackBright:x,redBright:x,greenBright:x,yellowBright:x,blueBright:x,magentaBright:x,cyanBright:x,whiteBright:x,bgBlackBright:x,bgRedBright:x,bgGreenBright:x,bgYellowBright:x,bgBlueBright:x,bgMagentaBright:x,bgCyanBright:x,bgWhiteBright:x}};
|
|
3
|
+
module.exports=create();
|
|
4
|
+
module.exports.createColors = create;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
let p = process || {}, argv = p.argv || [], env = p.env || {}
|
|
2
|
+
let isColorSupported =
|
|
3
|
+
!(!!env.NO_COLOR || argv.includes("--no-color")) &&
|
|
4
|
+
(!!env.FORCE_COLOR || argv.includes("--color") || p.platform === "win32" || ((p.stdout || {}).isTTY && env.TERM !== "dumb") || !!env.CI)
|
|
5
|
+
|
|
6
|
+
let formatter = (open, close, replace = open) =>
|
|
7
|
+
input => {
|
|
8
|
+
let string = "" + input, index = string.indexOf(close, open.length)
|
|
9
|
+
return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
let replaceClose = (string, close, replace, index) => {
|
|
13
|
+
let result = "", cursor = 0
|
|
14
|
+
do {
|
|
15
|
+
result += string.substring(cursor, index) + replace
|
|
16
|
+
cursor = index + close.length
|
|
17
|
+
index = string.indexOf(close, cursor)
|
|
18
|
+
} while (~index)
|
|
19
|
+
return result + string.substring(cursor)
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
let createColors = (enabled = isColorSupported) => {
|
|
23
|
+
let f = enabled ? formatter : () => String
|
|
24
|
+
return {
|
|
25
|
+
isColorSupported: enabled,
|
|
26
|
+
reset: f("\x1b[0m", "\x1b[0m"),
|
|
27
|
+
bold: f("\x1b[1m", "\x1b[22m", "\x1b[22m\x1b[1m"),
|
|
28
|
+
dim: f("\x1b[2m", "\x1b[22m", "\x1b[22m\x1b[2m"),
|
|
29
|
+
italic: f("\x1b[3m", "\x1b[23m"),
|
|
30
|
+
underline: f("\x1b[4m", "\x1b[24m"),
|
|
31
|
+
inverse: f("\x1b[7m", "\x1b[27m"),
|
|
32
|
+
hidden: f("\x1b[8m", "\x1b[28m"),
|
|
33
|
+
strikethrough: f("\x1b[9m", "\x1b[29m"),
|
|
34
|
+
|
|
35
|
+
black: f("\x1b[30m", "\x1b[39m"),
|
|
36
|
+
red: f("\x1b[31m", "\x1b[39m"),
|
|
37
|
+
green: f("\x1b[32m", "\x1b[39m"),
|
|
38
|
+
yellow: f("\x1b[33m", "\x1b[39m"),
|
|
39
|
+
blue: f("\x1b[34m", "\x1b[39m"),
|
|
40
|
+
magenta: f("\x1b[35m", "\x1b[39m"),
|
|
41
|
+
cyan: f("\x1b[36m", "\x1b[39m"),
|
|
42
|
+
white: f("\x1b[37m", "\x1b[39m"),
|
|
43
|
+
gray: f("\x1b[90m", "\x1b[39m"),
|
|
44
|
+
|
|
45
|
+
bgBlack: f("\x1b[40m", "\x1b[49m"),
|
|
46
|
+
bgRed: f("\x1b[41m", "\x1b[49m"),
|
|
47
|
+
bgGreen: f("\x1b[42m", "\x1b[49m"),
|
|
48
|
+
bgYellow: f("\x1b[43m", "\x1b[49m"),
|
|
49
|
+
bgBlue: f("\x1b[44m", "\x1b[49m"),
|
|
50
|
+
bgMagenta: f("\x1b[45m", "\x1b[49m"),
|
|
51
|
+
bgCyan: f("\x1b[46m", "\x1b[49m"),
|
|
52
|
+
bgWhite: f("\x1b[47m", "\x1b[49m"),
|
|
53
|
+
|
|
54
|
+
blackBright: f("\x1b[90m", "\x1b[39m"),
|
|
55
|
+
redBright: f("\x1b[91m", "\x1b[39m"),
|
|
56
|
+
greenBright: f("\x1b[92m", "\x1b[39m"),
|
|
57
|
+
yellowBright: f("\x1b[93m", "\x1b[39m"),
|
|
58
|
+
blueBright: f("\x1b[94m", "\x1b[39m"),
|
|
59
|
+
magentaBright: f("\x1b[95m", "\x1b[39m"),
|
|
60
|
+
cyanBright: f("\x1b[96m", "\x1b[39m"),
|
|
61
|
+
whiteBright: f("\x1b[97m", "\x1b[39m"),
|
|
62
|
+
|
|
63
|
+
bgBlackBright: f("\x1b[100m", "\x1b[49m"),
|
|
64
|
+
bgRedBright: f("\x1b[101m", "\x1b[49m"),
|
|
65
|
+
bgGreenBright: f("\x1b[102m", "\x1b[49m"),
|
|
66
|
+
bgYellowBright: f("\x1b[103m", "\x1b[49m"),
|
|
67
|
+
bgBlueBright: f("\x1b[104m", "\x1b[49m"),
|
|
68
|
+
bgMagentaBright: f("\x1b[105m", "\x1b[49m"),
|
|
69
|
+
bgCyanBright: f("\x1b[106m", "\x1b[49m"),
|
|
70
|
+
bgWhiteBright: f("\x1b[107m", "\x1b[49m"),
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
module.exports = createColors()
|
|
75
|
+
module.exports.createColors = createColors
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
export type Formatter = (input: string | number | null | undefined) => string
|
|
2
|
+
|
|
3
|
+
export interface Colors {
|
|
4
|
+
isColorSupported: boolean
|
|
5
|
+
|
|
6
|
+
reset: Formatter
|
|
7
|
+
bold: Formatter
|
|
8
|
+
dim: Formatter
|
|
9
|
+
italic: Formatter
|
|
10
|
+
underline: Formatter
|
|
11
|
+
inverse: Formatter
|
|
12
|
+
hidden: Formatter
|
|
13
|
+
strikethrough: Formatter
|
|
14
|
+
|
|
15
|
+
black: Formatter
|
|
16
|
+
red: Formatter
|
|
17
|
+
green: Formatter
|
|
18
|
+
yellow: Formatter
|
|
19
|
+
blue: Formatter
|
|
20
|
+
magenta: Formatter
|
|
21
|
+
cyan: Formatter
|
|
22
|
+
white: Formatter
|
|
23
|
+
gray: Formatter
|
|
24
|
+
|
|
25
|
+
bgBlack: Formatter
|
|
26
|
+
bgRed: Formatter
|
|
27
|
+
bgGreen: Formatter
|
|
28
|
+
bgYellow: Formatter
|
|
29
|
+
bgBlue: Formatter
|
|
30
|
+
bgMagenta: Formatter
|
|
31
|
+
bgCyan: Formatter
|
|
32
|
+
bgWhite: Formatter
|
|
33
|
+
|
|
34
|
+
blackBright: Formatter
|
|
35
|
+
redBright: Formatter
|
|
36
|
+
greenBright: Formatter
|
|
37
|
+
yellowBright: Formatter
|
|
38
|
+
blueBright: Formatter
|
|
39
|
+
magentaBright: Formatter
|
|
40
|
+
cyanBright: Formatter
|
|
41
|
+
whiteBright: Formatter
|
|
42
|
+
|
|
43
|
+
bgBlackBright: Formatter
|
|
44
|
+
bgRedBright: Formatter
|
|
45
|
+
bgGreenBright: Formatter
|
|
46
|
+
bgYellowBright: Formatter
|
|
47
|
+
bgBlueBright: Formatter
|
|
48
|
+
bgMagentaBright: Formatter
|
|
49
|
+
bgCyanBright: Formatter
|
|
50
|
+
bgWhiteBright: Formatter
|
|
51
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright 2013 Andrey Sitnik <andrey@sitnik.ru>
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
6
|
+
this software and associated documentation files (the "Software"), to deal in
|
|
7
|
+
the Software without restriction, including without limitation the rights to
|
|
8
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
9
|
+
the Software, and to permit persons to whom the Software is furnished to do so,
|
|
10
|
+
subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
17
|
+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
18
|
+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
19
|
+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
20
|
+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|