@kaeawc/auto-mobile 0.0.91 → 0.0.93
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/dist/build-info.json +12 -12
- package/dist/schemas/README.md +16 -0
- package/dist/schemas/prototype-icon-names.json +302 -0
- package/dist/schemas/test-plan.schema.json +370 -52
- package/dist/src/chunk-00167wan.js +55 -0
- package/dist/src/chunk-0jrrsnc9.js +6 -0
- package/dist/src/chunk-0n6swkwg.js +5 -0
- package/dist/src/chunk-0qsy1qsx.js +57 -0
- package/dist/src/chunk-11m8wj8j.js +237 -0
- package/dist/src/chunk-1p7xf5kb.js +5 -0
- package/dist/src/chunk-23p5f095.js +4 -0
- package/dist/src/chunk-26k317v5.js +5 -0
- package/dist/src/chunk-284ptqa4.js +7 -0
- package/dist/src/chunk-28re4xrg.js +4 -0
- package/dist/src/chunk-2f9rkmhx.js +5 -0
- package/dist/src/chunk-2fxdh48t.js +4 -0
- package/dist/src/chunk-2tbdrbt6.js +4 -0
- package/dist/src/chunk-2tqzq5qh.js +971 -0
- package/dist/src/chunk-32gvv9b4.js +21 -0
- package/dist/src/chunk-3f3t1x97.js +8 -0
- package/dist/src/chunk-3fspkbc7.js +4 -0
- package/dist/src/chunk-3qwrzxh0.js +11 -0
- package/dist/src/chunk-3sy6ahhz.js +26 -0
- package/dist/src/chunk-3vg455e6.js +4 -0
- package/dist/src/chunk-3xkpk44w.js +5 -0
- package/dist/src/chunk-3y6eykz9.js +4 -0
- package/dist/src/chunk-49bsqdx3.js +4 -0
- package/dist/src/chunk-4hw3665t.js +42 -0
- package/dist/src/chunk-58wzr3mt.js +5 -0
- package/dist/src/chunk-5d2hft6c.js +5 -0
- package/dist/src/chunk-5s645vr4.js +4 -0
- package/dist/src/chunk-5snsn9cf.js +4 -0
- package/dist/src/chunk-5tm9mn47.js +54 -0
- package/dist/src/chunk-5zc77a5t.js +4 -0
- package/dist/src/chunk-64j0majr.js +19 -0
- package/dist/src/chunk-65y8v4td.js +17 -0
- package/dist/src/chunk-6awz7vhq.js +5 -0
- package/dist/src/chunk-6bznss4t.js +8 -0
- package/dist/src/chunk-6ep7f5ge.js +4 -0
- package/dist/src/chunk-6pg7bqck.js +4 -0
- package/dist/src/chunk-6wt9rgjf.js +5 -0
- package/dist/src/chunk-6xmss8er.js +8 -0
- package/dist/src/chunk-710rxz9y.js +5 -0
- package/dist/src/chunk-7cs2da62.js +5 -0
- package/dist/src/chunk-7g103b54.js +4 -0
- package/dist/src/chunk-7j5vj4pa.js +4 -0
- package/dist/src/chunk-7rz9898k.js +5 -0
- package/dist/src/chunk-7tw8x05v.js +4 -0
- package/dist/src/chunk-7zy586cb.js +4 -0
- package/dist/src/chunk-8037tzzj.js +5 -0
- package/dist/src/chunk-84nanf8s.js +5 -0
- package/dist/src/chunk-8g1922rp.js +10 -0
- package/dist/src/chunk-8gvwcv2p.js +4 -0
- package/dist/src/chunk-8ph29g99.js +4 -0
- package/dist/src/chunk-8thrmfat.js +4 -0
- package/dist/src/chunk-8zgzzs7k.js +78 -0
- package/dist/src/chunk-97b1zmaq.js +4 -0
- package/dist/src/chunk-9fth9ayh.js +4 -0
- package/dist/src/chunk-9j6anhjr.js +4 -0
- package/dist/src/chunk-aabchzxk.js +9 -0
- package/dist/src/chunk-ayp07wbb.js +4 -0
- package/dist/src/chunk-bfjwqk8q.js +4 -0
- package/dist/src/chunk-bfw6125s.js +5 -0
- package/dist/src/chunk-bnhscm2n.js +4 -0
- package/dist/src/chunk-bxmsax22.js +5 -0
- package/dist/src/chunk-c1vs4g1n.js +4 -0
- package/dist/src/chunk-ct3e7yng.js +4 -0
- package/dist/src/chunk-cyy71ggq.js +5 -0
- package/dist/src/chunk-ddzkz92z.js +4 -0
- package/dist/src/chunk-dgrbdpb7.js +9 -0
- package/dist/src/chunk-drdz8hee.js +5 -0
- package/dist/src/chunk-e98dqnc9.js +145 -0
- package/dist/src/chunk-eersndy7.js +5 -0
- package/dist/src/chunk-eggq53ks.js +4 -0
- package/dist/src/chunk-f2dya7cs.js +4 -0
- package/dist/src/chunk-fbakd6cw.js +4 -0
- package/dist/src/chunk-fgb98zjj.js +5 -0
- package/dist/src/chunk-fmpad823.js +5 -0
- package/dist/src/chunk-g04bwyj3.js +4 -0
- package/dist/src/chunk-g0xr8zw0.js +4 -0
- package/dist/src/chunk-g3rjs80x.js +4 -0
- package/dist/src/chunk-g78rtrfv.js +4 -0
- package/dist/src/chunk-g7tmjbkt.js +5 -0
- package/dist/src/chunk-gabgv3y5.js +4 -0
- package/dist/src/chunk-gmr45m8f.js +4 -0
- package/dist/src/chunk-gsyfebqj.js +4 -0
- package/dist/src/chunk-h5rpn9wr.js +247 -0
- package/dist/src/chunk-hb1x7v55.js +4 -0
- package/dist/src/chunk-hrfytkxh.js +168 -0
- package/dist/src/chunk-j4yjzbak.js +4 -0
- package/dist/src/chunk-jd6a5v6p.js +5 -0
- package/dist/src/chunk-jh6vhqzx.js +5 -0
- package/dist/src/chunk-kn5spq15.js +4 -0
- package/dist/src/chunk-m94qs0f0.js +4 -0
- package/dist/src/chunk-mjrps0ac.js +7 -0
- package/dist/src/chunk-n03dmn5q.js +5 -0
- package/dist/src/chunk-n72qhwd9.js +4 -0
- package/dist/src/chunk-ndt1ccxm.js +71 -0
- package/dist/src/chunk-nr6y0n4y.js +5 -0
- package/dist/src/chunk-pcsen2vs.js +4 -0
- package/dist/src/chunk-ppfr0b8h.js +4 -0
- package/dist/src/chunk-q10bdnat.js +4 -0
- package/dist/src/chunk-q9xmq595.js +4 -0
- package/dist/src/chunk-qcxzr2my.js +5 -0
- package/dist/src/chunk-qf6nynk6.js +7 -0
- package/dist/src/chunk-qyqypn28.js +5 -0
- package/dist/src/chunk-r2epb56s.js +4 -0
- package/dist/src/chunk-r5bxavdx.js +311 -0
- package/dist/src/chunk-r6z1eztj.js +18 -0
- package/dist/src/chunk-r7bpkgff.js +4 -0
- package/dist/src/chunk-r8jf3d92.js +4 -0
- package/dist/src/chunk-rbpdk7m0.js +5 -0
- package/dist/src/chunk-rc0dbypm.js +4 -0
- package/dist/src/chunk-rhcty4ms.js +4 -0
- package/dist/src/chunk-rpvckv3p.js +4 -0
- package/dist/src/chunk-rqc9ap3x.js +4 -0
- package/dist/src/chunk-rvvy1bte.js +7 -0
- package/dist/src/chunk-ry0mz41y.js +4 -0
- package/dist/src/chunk-s3jc6cwp.js +5 -0
- package/dist/src/chunk-sfv61xjb.js +6 -0
- package/dist/src/chunk-t6bfvfkg.js +4 -0
- package/dist/src/chunk-t6c8akcm.js +5 -0
- package/dist/src/chunk-t7w8rctc.js +4 -0
- package/dist/src/chunk-thbh3jew.js +5 -0
- package/dist/src/chunk-v2wd4n3e.js +5 -0
- package/dist/src/chunk-v6pya0dm.js +5 -0
- package/dist/src/chunk-vy3bwm1d.js +17 -0
- package/dist/src/chunk-w3vs79ex.js +27 -0
- package/dist/src/chunk-w4zga19f.js +4 -0
- package/dist/src/chunk-w5b2jwk3.js +14 -0
- package/dist/src/chunk-w7hkv422.js +5 -0
- package/dist/src/chunk-waqwcjyn.js +4 -0
- package/dist/src/chunk-wbh8spm5.js +20 -0
- package/dist/src/chunk-wyrkw6hw.js +5 -0
- package/dist/src/chunk-xa73x2cx.js +5 -0
- package/dist/src/chunk-xgan0qqp.js +4 -0
- package/dist/src/chunk-y2vs6jwg.js +4 -0
- package/dist/src/chunk-yattm52s.js +4 -0
- package/dist/src/chunk-yb97j25b.js +6 -0
- package/dist/src/chunk-ybbtagbt.js +5 -0
- package/dist/src/chunk-ycaj2sgf.js +9 -0
- package/dist/src/chunk-yf7ympyz.js +325 -0
- package/dist/src/chunk-yjawdzk8.js +4 -0
- package/dist/src/chunk-z637nqg8.js +11 -0
- package/dist/src/chunk-zgja5f3p.js +6 -0
- package/dist/src/chunk-zs1sghs9.js +4 -0
- package/dist/src/daemon/processEntry.js +4 -0
- package/dist/src/index.js +4 -2843
- package/dist/src/runtime/bunRuntimeGuard.js +4 -0
- package/dist/src/utils/workers/iosBundleExtractWorker.js +2 -3
- package/ios/CameraPosterInjection/Injection/CameraPosterInjection.m +466 -0
- package/package.json +7 -6
- package/schemas/README.md +16 -0
- package/schemas/prototype-icon-names.json +302 -0
- package/schemas/test-plan.schema.json +370 -52
- package/node_modules/@borewit/text-codec/README.md +0 -87
- package/node_modules/@jimp/diff/node_modules/pixelmatch/README.md +0 -110
- package/node_modules/@jimp/diff/node_modules/pixelmatch/node_modules/pngjs/README.md +0 -433
- package/node_modules/@jimp/file-ops/dist/browser/index.js +0 -8
- package/node_modules/@jimp/js-png/README.md +0 -35
- package/node_modules/@jimp/js-png/src/__image_snapshots__/index-node-test-ts-png-should-use-png-options-1-snap.png +0 -0
- package/node_modules/@jimp/js-png/src/output.png +0 -0
- package/node_modules/@jimp/js-png/vitest.config.browser.mjs +0 -3
- package/node_modules/@jimp/plugin-resize/README.md +0 -12
- package/node_modules/@jimp/plugin-resize/vitest.config.browser.mjs +0 -3
- package/node_modules/@tokenizer/inflate/README.md +0 -114
- package/node_modules/@tokenizer/token/README.md +0 -19
- package/node_modules/await-to-js/README.md +0 -82
- package/node_modules/debug/README.md +0 -481
- package/node_modules/exif-parser/README.md +0 -83
- package/node_modules/file-type/readme.md +0 -667
- package/node_modules/ieee754/README.md +0 -51
- package/node_modules/mime/README.md +0 -178
- package/node_modules/ms/readme.md +0 -59
- package/node_modules/parse-bmfont-xml/README.md +0 -74
- package/node_modules/parse-bmfont-xml/lib/browser.js +0 -85
- package/node_modules/parse-bmfont-xml/node_modules/xml2js/README.md +0 -507
- package/node_modules/pngjs/README.md +0 -287
- package/node_modules/sax/README.md +0 -228
- package/node_modules/strtok3/README.md +0 -795
- package/node_modules/tinycolor2/README.md +0 -492
- package/node_modules/tinycolor2/cjs/test.js +0 -2191
- package/node_modules/tinycolor2/cjs/test_template.js +0 -26
- package/node_modules/tinycolor2/deno_asserts@0.168.0.mjs +0 -807
- package/node_modules/tinycolor2/esm/test.js +0 -2189
- package/node_modules/tinycolor2/esm/test_template.js +0 -24
- package/node_modules/tinycolor2/tinycolor.js +0 -1191
- package/node_modules/token-types/README.md +0 -160
- package/node_modules/uint8array-extras/readme.md +0 -318
- package/node_modules/xml-parse-from-string/README.md +0 -35
- package/node_modules/xmlbuilder/README.md +0 -86
- package/node_modules/zod/README.md +0 -208
- package/node_modules/zod/v4/locales/ar.d.cts +0 -4
- package/node_modules/zod/v4/locales/ar.d.ts +0 -4
- package/node_modules/zod/v4/locales/az.d.cts +0 -4
- package/node_modules/zod/v4/locales/az.d.ts +0 -4
- package/node_modules/zod/v4/locales/be.d.cts +0 -4
- package/node_modules/zod/v4/locales/be.d.ts +0 -4
- package/node_modules/zod/v4/locales/ca.d.cts +0 -4
- package/node_modules/zod/v4/locales/ca.d.ts +0 -4
- package/node_modules/zod/v4/locales/cs.d.cts +0 -4
- package/node_modules/zod/v4/locales/cs.d.ts +0 -4
- package/node_modules/zod/v4/locales/de.d.cts +0 -4
- package/node_modules/zod/v4/locales/de.d.ts +0 -4
- package/node_modules/zod/v4/locales/en.d.cts +0 -5
- package/node_modules/zod/v4/locales/en.d.ts +0 -5
- package/node_modules/zod/v4/locales/eo.d.cts +0 -5
- package/node_modules/zod/v4/locales/eo.d.ts +0 -5
- package/node_modules/zod/v4/locales/es.d.cts +0 -4
- package/node_modules/zod/v4/locales/es.d.ts +0 -4
- package/node_modules/zod/v4/locales/fa.d.cts +0 -4
- package/node_modules/zod/v4/locales/fa.d.ts +0 -4
- package/node_modules/zod/v4/locales/fi.d.cts +0 -4
- package/node_modules/zod/v4/locales/fi.d.ts +0 -4
- package/node_modules/zod/v4/locales/fr-CA.d.cts +0 -4
- package/node_modules/zod/v4/locales/fr-CA.d.ts +0 -4
- package/node_modules/zod/v4/locales/fr.d.cts +0 -4
- package/node_modules/zod/v4/locales/fr.d.ts +0 -4
- package/node_modules/zod/v4/locales/he.d.cts +0 -4
- package/node_modules/zod/v4/locales/he.d.ts +0 -4
- package/node_modules/zod/v4/locales/hu.d.cts +0 -4
- package/node_modules/zod/v4/locales/hu.d.ts +0 -4
- package/node_modules/zod/v4/locales/id.d.cts +0 -4
- package/node_modules/zod/v4/locales/id.d.ts +0 -4
- package/node_modules/zod/v4/locales/index.d.cts +0 -39
- package/node_modules/zod/v4/locales/index.d.ts +0 -39
- package/node_modules/zod/v4/locales/it.d.cts +0 -4
- package/node_modules/zod/v4/locales/it.d.ts +0 -4
- package/node_modules/zod/v4/locales/ja.d.cts +0 -4
- package/node_modules/zod/v4/locales/ja.d.ts +0 -4
- package/node_modules/zod/v4/locales/kh.d.cts +0 -4
- package/node_modules/zod/v4/locales/kh.d.ts +0 -4
- package/node_modules/zod/v4/locales/ko.d.cts +0 -4
- package/node_modules/zod/v4/locales/ko.d.ts +0 -4
- package/node_modules/zod/v4/locales/mk.d.cts +0 -4
- package/node_modules/zod/v4/locales/mk.d.ts +0 -4
- package/node_modules/zod/v4/locales/ms.d.cts +0 -4
- package/node_modules/zod/v4/locales/ms.d.ts +0 -4
- package/node_modules/zod/v4/locales/nl.d.cts +0 -4
- package/node_modules/zod/v4/locales/nl.d.ts +0 -4
- package/node_modules/zod/v4/locales/no.d.cts +0 -4
- package/node_modules/zod/v4/locales/no.d.ts +0 -4
- package/node_modules/zod/v4/locales/ota.d.cts +0 -4
- package/node_modules/zod/v4/locales/ota.d.ts +0 -4
- package/node_modules/zod/v4/locales/pl.d.cts +0 -4
- package/node_modules/zod/v4/locales/pl.d.ts +0 -4
- package/node_modules/zod/v4/locales/ps.d.cts +0 -4
- package/node_modules/zod/v4/locales/ps.d.ts +0 -4
- package/node_modules/zod/v4/locales/pt.d.cts +0 -4
- package/node_modules/zod/v4/locales/pt.d.ts +0 -4
- package/node_modules/zod/v4/locales/ru.d.cts +0 -4
- package/node_modules/zod/v4/locales/ru.d.ts +0 -4
- package/node_modules/zod/v4/locales/sl.d.cts +0 -4
- package/node_modules/zod/v4/locales/sl.d.ts +0 -4
- package/node_modules/zod/v4/locales/sv.d.cts +0 -4
- package/node_modules/zod/v4/locales/sv.d.ts +0 -4
- package/node_modules/zod/v4/locales/ta.d.cts +0 -4
- package/node_modules/zod/v4/locales/ta.d.ts +0 -4
- package/node_modules/zod/v4/locales/th.d.cts +0 -4
- package/node_modules/zod/v4/locales/th.d.ts +0 -4
- package/node_modules/zod/v4/locales/tr.d.cts +0 -5
- package/node_modules/zod/v4/locales/tr.d.ts +0 -5
- package/node_modules/zod/v4/locales/ua.d.cts +0 -4
- package/node_modules/zod/v4/locales/ua.d.ts +0 -4
- package/node_modules/zod/v4/locales/ur.d.cts +0 -4
- package/node_modules/zod/v4/locales/ur.d.ts +0 -4
- package/node_modules/zod/v4/locales/vi.d.cts +0 -4
- package/node_modules/zod/v4/locales/vi.d.ts +0 -4
- package/node_modules/zod/v4/locales/zh-CN.d.cts +0 -4
- package/node_modules/zod/v4/locales/zh-CN.d.ts +0 -4
- package/node_modules/zod/v4/locales/zh-TW.d.cts +0 -4
- package/node_modules/zod/v4/locales/zh-TW.d.ts +0 -4
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
[](https://github.com/Borewit/tokenizer-inflate/actions/workflows/nodejs-ci.yml)
|
|
2
|
-
[](https://npmjs.org/package/@tokenizer/inflate)
|
|
3
|
-
[](https://npmcharts.com/compare/%40tokenizer%2Finflate?start=1200&interval=30)
|
|
4
|
-
|
|
5
|
-
# @tokenizer/inflate
|
|
6
|
-
|
|
7
|
-
`@tokenizer/inflate` is a package designed for handling and extracting data from ZIP files efficiently using a tokenizer-based approach.
|
|
8
|
-
The library provides a customizable way to parse ZIP archives and extract compressed data while minimizing memory usage.
|
|
9
|
-
|
|
10
|
-
## Features
|
|
11
|
-
- Efficient Decompression: Handles streams compressed with DEFLATE and related formats (e.g., gzip).
|
|
12
|
-
- Tokenizer Compatibility: Seamlessly integrates with [strtok3](https://github.com/Borewit/strtok3). For example, use [@tokenizer/s3](https://github.com/Borewit/tokenizer-s3) for efficient partial extraction of a Zip stored on AWS S3 cloud file storage.
|
|
13
|
-
- Streamlined Interface: Provides an intuitive API for working with compressed data in streaming and random-access scenarios.
|
|
14
|
-
- Chunked Data Access: Leverages the underlying media's capabilities to offer chunked or random access to data, unlike traditional streams.
|
|
15
|
-
- Plug-and-Play: Easily integrate with existing tokenizer-based workflows for parsing file metadata or binary structures.
|
|
16
|
-
- Interrupt the extraction process conditionally.
|
|
17
|
-
|
|
18
|
-
## Installation
|
|
19
|
-
```bash
|
|
20
|
-
npm install @tokenizer/inflate
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
## Usage
|
|
24
|
-
|
|
25
|
-
### Example: Extracting Specific Files
|
|
26
|
-
|
|
27
|
-
The following example demonstrates how to use the library to extract .txt files and stop processing when encountering a .stop file.
|
|
28
|
-
|
|
29
|
-
```js
|
|
30
|
-
import { ZipHandler } from '@tokenizer/inflate';
|
|
31
|
-
import { fromFile } from 'strtok3';
|
|
32
|
-
|
|
33
|
-
const fileFilter = (file) => {
|
|
34
|
-
console.log(`Processing file: ${file.filename}`);
|
|
35
|
-
|
|
36
|
-
if (file.filename?.endsWith(".stop")) {
|
|
37
|
-
console.log(`Stopping processing due to file: ${file.filename}`);
|
|
38
|
-
return { handler: false, stop: true }; // Stop the unzip process
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
if (file.filename?.endsWith(".txt")) {
|
|
42
|
-
return {
|
|
43
|
-
handler: async (data) => {
|
|
44
|
-
console.log(`Extracted text file: ${file.filename}`);
|
|
45
|
-
console.log(new TextDecoder().decode(data));
|
|
46
|
-
},
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
return { handler: false }; // Ignore other files
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
async function extractFiles(zipFilePath) {
|
|
54
|
-
const tokenizer = await fromFile(zipFilePath);
|
|
55
|
-
const zipHandler = new ZipHandler(tokenizer);
|
|
56
|
-
await zipHandler.unzip(fileFilter);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
extractFiles('example.zip').catch(console.error);
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
## API
|
|
63
|
-
|
|
64
|
-
### `ZipHandler`
|
|
65
|
-
A class for handling ZIP file parsing and extraction.
|
|
66
|
-
#### Constructor
|
|
67
|
-
```ts
|
|
68
|
-
new ZipHandler(tokenizer: ITokenizer)
|
|
69
|
-
```
|
|
70
|
-
- **tokenizer**: An instance of ITokenizer to read the ZIP archive.
|
|
71
|
-
#### Methods
|
|
72
|
-
|
|
73
|
-
- `isZip(): Promise<boolean>`
|
|
74
|
-
|
|
75
|
-
Determines whether the input file is a ZIP archive.
|
|
76
|
-
|
|
77
|
-
- `unzip(fileCb: InflateFileFilter): Promise<void>`
|
|
78
|
-
|
|
79
|
-
Extracts files from the ZIP archive, applying the provided `InflateFileFilter` callback to each file.
|
|
80
|
-
|
|
81
|
-
```InflatedDataHandler```
|
|
82
|
-
|
|
83
|
-
## Types
|
|
84
|
-
|
|
85
|
-
### `InflateFileFilter`
|
|
86
|
-
```ts
|
|
87
|
-
type InflateFileFilter = (file: IFullZipHeader) => InflateFileFilterResult;
|
|
88
|
-
```
|
|
89
|
-
Callback function to determine whether a file should be handled or ignored.
|
|
90
|
-
|
|
91
|
-
### `InflateFileFilterResult`
|
|
92
|
-
```ts
|
|
93
|
-
type InflateFileFilterResult = {
|
|
94
|
-
handler: InflatedDataHandler | false; // Handle file data or ignore
|
|
95
|
-
stop?: boolean; // Stop processing further files
|
|
96
|
-
};
|
|
97
|
-
|
|
98
|
-
```
|
|
99
|
-
Returned from `InflateFileFilter` to control file handling and extraction flow.
|
|
100
|
-
|
|
101
|
-
### `InflatedDataHandler`
|
|
102
|
-
```ts
|
|
103
|
-
type InflatedDataHandler = (fileData: Uint8Array) => Promise<void>;
|
|
104
|
-
```
|
|
105
|
-
Handler for processing uncompressed file data.
|
|
106
|
-
|
|
107
|
-
## Compatibility
|
|
108
|
-
|
|
109
|
-
This module is a [pure ECMAScript Module (ESM)](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c).
|
|
110
|
-
The distributed JavaScript codebase is compliant with the [ECMAScript 2020 (11th Edition)](https://en.wikipedia.org/wiki/ECMAScript_version_history#11th_Edition_%E2%80%93_ECMAScript_2020) standard.
|
|
111
|
-
If used with Node.js, it requires version ≥ 18.
|
|
112
|
-
|
|
113
|
-
## License
|
|
114
|
-
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
[](https://www.npmjs.com/package/@tokenizer/token)
|
|
2
|
-
[](https://npmcharts.com/compare/@tokenizer/token?interval=30)
|
|
3
|
-
|
|
4
|
-
# @tokenizer/token
|
|
5
|
-
|
|
6
|
-
TypeScript definition of an [strtok3](https://github.com/Borewit/strtok3) token.
|
|
7
|
-
|
|
8
|
-
## Licence
|
|
9
|
-
|
|
10
|
-
(The MIT License)
|
|
11
|
-
|
|
12
|
-
Copyright (c) 2020 Borewit
|
|
13
|
-
|
|
14
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
15
|
-
|
|
16
|
-
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
17
|
-
|
|
18
|
-
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
19
|
-
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
# await-to-js
|
|
2
|
-
|
|
3
|
-
[![NPM version][npm-image]][npm-url]
|
|
4
|
-
[![Downloads][download-badge]][npm-url]
|
|
5
|
-
|
|
6
|
-
> Async await wrapper for easy error handling
|
|
7
|
-
|
|
8
|
-
## Pre-requisites
|
|
9
|
-
You need to use Node 7.6 (or later) or an ES7 transpiler in order to use async/await functionality.
|
|
10
|
-
You can use babel or typescript for that.
|
|
11
|
-
|
|
12
|
-
## Install
|
|
13
|
-
|
|
14
|
-
```sh
|
|
15
|
-
npm i await-to-js --save
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
## Usage
|
|
19
|
-
|
|
20
|
-
```js
|
|
21
|
-
import to from 'await-to-js';
|
|
22
|
-
// If you use CommonJS (i.e NodeJS environment), it should be:
|
|
23
|
-
// const to = require('await-to-js').default;
|
|
24
|
-
|
|
25
|
-
async function asyncTaskWithCb(cb) {
|
|
26
|
-
let err, user, savedTask, notification;
|
|
27
|
-
|
|
28
|
-
[ err, user ] = await to(UserModel.findById(1));
|
|
29
|
-
if(!user) return cb('No user found');
|
|
30
|
-
|
|
31
|
-
[ err, savedTask ] = await to(TaskModel({userId: user.id, name: 'Demo Task'}));
|
|
32
|
-
if(err) return cb('Error occurred while saving task');
|
|
33
|
-
|
|
34
|
-
if(user.notificationsEnabled) {
|
|
35
|
-
[ err ] = await to(NotificationService.sendNotification(user.id, 'Task Created'));
|
|
36
|
-
if(err) return cb('Error while sending notification');
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
if(savedTask.assignedUser.id !== user.id) {
|
|
40
|
-
[ err, notification ] = await to(NotificationService.sendNotification(savedTask.assignedUser.id, 'Task was created for you'));
|
|
41
|
-
if(err) return cb('Error while sending notification');
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
cb(null, savedTask);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
async function asyncFunctionWithThrow() {
|
|
48
|
-
const [err, user] = await to(UserModel.findById(1));
|
|
49
|
-
if (!user) throw new Error('User not found');
|
|
50
|
-
|
|
51
|
-
}
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
## TypeScript usage
|
|
55
|
-
```javascript
|
|
56
|
-
interface ServerResponse {
|
|
57
|
-
test: number;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
const p = Promise.resolve({test: 123});
|
|
61
|
-
|
|
62
|
-
const [err, data] = await to<ServerResponse>(p);
|
|
63
|
-
console.log(data.test);
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
## License
|
|
67
|
-
|
|
68
|
-
MIT © [Dima Grossman](http://blog.grossman.io) && Tomer Barnea
|
|
69
|
-
|
|
70
|
-
[npm-url]: https://npmjs.org/package/await-to-js
|
|
71
|
-
[npm-image]: https://img.shields.io/npm/v/await-to-js.svg?style=flat-square
|
|
72
|
-
|
|
73
|
-
[travis-url]: https://travis-ci.org/scopsy/await-to-js
|
|
74
|
-
[travis-image]: https://img.shields.io/travis/scopsy/await-to-js.svg?style=flat-square
|
|
75
|
-
|
|
76
|
-
[coveralls-url]: https://coveralls.io/r/scopsy/await-to-js
|
|
77
|
-
[coveralls-image]: https://img.shields.io/coveralls/scopsy/await-to-js.svg?style=flat-square
|
|
78
|
-
|
|
79
|
-
[depstat-url]: https://david-dm.org/scopsy/await-to-js
|
|
80
|
-
[depstat-image]: https://david-dm.org/scopsy/await-to-js.svg?style=flat-square
|
|
81
|
-
|
|
82
|
-
[download-badge]: http://img.shields.io/npm/dm/await-to-js.svg?style=flat-square
|