@willbooster/shared-lib 2.0.1 → 2.2.0
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/cjs/{error.js → error.cjs} +1 -1
- package/dist/cjs/error.cjs.map +1 -0
- package/dist/cjs/{error.d.ts → error.d.cts} +0 -0
- package/dist/cjs/index.cjs +2 -0
- package/dist/cjs/index.cjs.map +1 -0
- package/dist/cjs/{index.d.ts → index.d.cts} +0 -0
- package/dist/cjs/{shuffle.js → shuffle.cjs} +1 -1
- package/dist/cjs/shuffle.cjs.map +1 -0
- package/dist/cjs/{shuffle.d.ts → shuffle.d.cts} +0 -0
- package/dist/cjs/{zenkaku.js → zenkaku.cjs} +1 -1
- package/dist/cjs/zenkaku.cjs.map +1 -0
- package/dist/cjs/{zenkaku.d.ts → zenkaku.d.cts} +0 -0
- package/package.json +18 -13
- package/dist/cjs/error.js.map +0 -1
- package/dist/cjs/index.js +0 -2
- package/dist/cjs/index.js.map +0 -1
- package/dist/cjs/shuffle.js.map +0 -1
- package/dist/cjs/zenkaku.js.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use strict";exports.ignoreEnoent=function(t){try{return t()}catch(t){if("object"==typeof t&&t&&"code"in t&&"ENOENT"===t.code)return;throw t}},exports.ignoreEnoentAsync=async function(t){try{return await t()}catch(t){if("object"==typeof t&&t&&"code"in t&&"ENOENT"===t.code)return;throw t}},exports.ignoreError=function(t){try{return t()}catch(t){}},exports.ignoreErrorAsync=async function(t){try{return await t()}catch(t){}};
|
|
2
|
-
//# sourceMappingURL=error.
|
|
2
|
+
//# sourceMappingURL=error.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error.cjs","sources":["../../src/error.ts"],"sourcesContent":["export function ignoreError<T>(fn: () => T): T | undefined {\n try {\n return fn();\n } catch {\n // do nothing\n }\n}\n\nexport function ignoreEnoent<T>(fn: () => T): T | undefined {\n try {\n return fn();\n } catch (error) {\n if (typeof error === 'object' && error && 'code' in error && error.code === 'ENOENT') {\n return;\n }\n throw error;\n }\n}\n\nexport async function ignoreErrorAsync<T>(fn: () => Promise<T>): Promise<T | undefined> {\n try {\n return await fn();\n } catch {\n // do nothing\n }\n}\n\nexport async function ignoreEnoentAsync<T>(fn: () => Promise<T>): Promise<T | undefined> {\n try {\n return await fn();\n } catch (error) {\n if (typeof error === 'object' && error && 'code' in error && error.code === 'ENOENT') {\n return;\n }\n throw error;\n }\n}\n"],"names":["fn","error","code","async","_unused","_unused2"],"mappings":"kCAQO,SAAyBA,GAC9B,IACE,OAAOA,GAMT,CALE,MAAOC,GACP,GAAqB,iBAAVA,GAAsBA,GAAS,SAAUA,GAAwB,WAAfA,EAAMC,KACjE,OAEF,MAAMD,CACR,CACF,4BAUOE,eAAoCH,GACzC,IACE,aAAaA,GAMf,CALE,MAAOC,GACP,GAAqB,iBAAVA,GAAsBA,GAAS,SAAUA,GAAwB,WAAfA,EAAMC,KACjE,OAEF,MAAMD,CACR,CACF,sBApCO,SAAwBD,GAC7B,IACE,OAAOA,GAEP,CADA,MAAMI,GACN,CAEJ,2BAaOD,eAAmCH,GACxC,IACE,aAAaA,GAEb,CADA,MAAMK,GACN,CAEJ"}
|
|
File without changes
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var r=require("./error.cjs"),e=require("./shuffle.cjs"),n=require("./zenkaku.cjs");exports.ignoreEnoent=r.ignoreEnoent,exports.ignoreEnoentAsync=r.ignoreEnoentAsync,exports.ignoreError=r.ignoreError,exports.ignoreErrorAsync=r.ignoreErrorAsync,exports.shuffle=e.shuffle,exports.zenkakuAlphanumericalsToHankaku=n.zenkakuAlphanumericalsToHankaku;
|
|
2
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
File without changes
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use strict";exports.shuffle=function(t){for(let o=t.length-1;o>0;o--){const r=Math.floor(Math.random()*(o+1));[t[o],t[r]]=[t[r],t[o]]}return t};
|
|
2
|
-
//# sourceMappingURL=shuffle.
|
|
2
|
+
//# sourceMappingURL=shuffle.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shuffle.cjs","sources":["../../src/shuffle.ts"],"sourcesContent":["export function shuffle<T>(array: T[]): T[] {\n for (let index = array.length - 1; index > 0; index--) {\n const index_ = Math.floor(Math.random() * (index + 1));\n [array[index], array[index_]] = [array[index_], array[index]];\n }\n return array;\n}\n"],"names":["array","index","length","index_","Math","floor","random"],"mappings":"6BAAO,SAAoBA,GACzB,IAAK,IAAIC,EAAQD,EAAME,OAAS,EAAGD,EAAQ,EAAGA,IAAS,CACrD,MAAME,EAASC,KAAKC,MAAMD,KAAKE,UAAYL,EAAQ,KAClDD,EAAMC,GAAQD,EAAMG,IAAW,CAACH,EAAMG,GAASH,EAAMC,GACxD,CACA,OAAOD,CACT"}
|
|
File without changes
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use strict";exports.zenkakuAlphanumericalsToHankaku=function(n){return n.replace(/[0-9A-Za-z]/g,(n=>{var r;return String.fromCodePoint((null!==(r=n.codePointAt(0))&&void 0!==r?r:0)-65248)}))};
|
|
2
|
-
//# sourceMappingURL=zenkaku.
|
|
2
|
+
//# sourceMappingURL=zenkaku.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zenkaku.cjs","sources":["../../src/zenkaku.ts"],"sourcesContent":["export function zenkakuAlphanumericalsToHankaku(str: string): string {\n return str.replace(/[0-9A-Za-z]/g, (s: string) => {\n return String.fromCodePoint((s.codePointAt(0) ?? 0) - 0xfe_e0);\n });\n}\n"],"names":["str","replace","s","_s$codePointAt","String","fromCodePoint","codePointAt"],"mappings":"qDAAO,SAAyCA,GAC9C,OAAOA,EAAIC,QAAQ,gBAAiBC,IAAc,IAAAC,EAChD,OAAOC,OAAOC,eAA+B,UAAhBH,EAAEI,YAAY,UAAE,IAAAH,EAAAA,EAAI,GAAK,MAAQ,GAElE"}
|
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,20 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@willbooster/shared-lib",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.2.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"author": "WillBooster Inc.",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"type": "module",
|
|
8
8
|
"exports": {
|
|
9
9
|
".": {
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
"
|
|
10
|
+
"require": "./dist/cjs/index.cjs",
|
|
11
|
+
"import": "./dist/esm/index.js",
|
|
12
|
+
"types": "./dist/esm/index.d.ts"
|
|
13
|
+
},
|
|
14
|
+
"./src": {
|
|
15
|
+
"require": "./src/index.ts",
|
|
16
|
+
"import": "./src/index.ts",
|
|
17
|
+
"types": "./src/index.ts"
|
|
13
18
|
}
|
|
14
19
|
},
|
|
15
|
-
"main": "dist/cjs/index.
|
|
20
|
+
"main": "dist/cjs/index.cjs",
|
|
16
21
|
"module": "dist/esm/index.js",
|
|
17
|
-
"types": "dist/
|
|
22
|
+
"types": "dist/esm/index.d.ts",
|
|
18
23
|
"files": [
|
|
19
24
|
"bin/",
|
|
20
25
|
"dist/"
|
|
@@ -31,14 +36,14 @@
|
|
|
31
36
|
},
|
|
32
37
|
"prettier": "@willbooster/prettier-config",
|
|
33
38
|
"devDependencies": {
|
|
34
|
-
"@types/eslint": "8.
|
|
39
|
+
"@types/eslint": "8.21.0",
|
|
35
40
|
"@types/micromatch": "4.0.2",
|
|
36
41
|
"@types/prettier": "2.7.2",
|
|
37
|
-
"@typescript-eslint/eslint-plugin": "5.
|
|
38
|
-
"@typescript-eslint/parser": "5.
|
|
42
|
+
"@typescript-eslint/eslint-plugin": "5.51.0",
|
|
43
|
+
"@typescript-eslint/parser": "5.51.0",
|
|
39
44
|
"@willbooster/eslint-config-ts": "10.0.8",
|
|
40
45
|
"@willbooster/prettier-config": "9.1.1",
|
|
41
|
-
"build-ts": "5.
|
|
46
|
+
"build-ts": "5.5.0",
|
|
42
47
|
"eslint": "8.33.0",
|
|
43
48
|
"eslint-config-prettier": "8.6.0",
|
|
44
49
|
"eslint-import-resolver-typescript": "3.5.3",
|
|
@@ -46,12 +51,12 @@
|
|
|
46
51
|
"eslint-plugin-sort-class-members": "1.16.0",
|
|
47
52
|
"eslint-plugin-sort-destructure-keys": "1.4.0",
|
|
48
53
|
"eslint-plugin-unicorn": "45.0.2",
|
|
49
|
-
"lint-staged": "13.1.
|
|
54
|
+
"lint-staged": "13.1.1",
|
|
50
55
|
"micromatch": "4.0.5",
|
|
51
56
|
"prettier": "2.8.3",
|
|
52
|
-
"sort-package-json": "2.
|
|
57
|
+
"sort-package-json": "2.4.1",
|
|
53
58
|
"typescript": "4.9.5",
|
|
54
|
-
"vitest": "0.28.
|
|
59
|
+
"vitest": "0.28.4"
|
|
55
60
|
},
|
|
56
61
|
"publishConfig": {
|
|
57
62
|
"access": "public"
|
package/dist/cjs/error.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"error.js","sources":["../../src/error.ts"],"sourcesContent":["export function ignoreError<T>(fn: () => T): T | undefined {\n try {\n return fn();\n } catch {\n // do nothing\n }\n}\n\nexport function ignoreEnoent<T>(fn: () => T): T | undefined {\n try {\n return fn();\n } catch (error) {\n if (typeof error === 'object' && error && 'code' in error && error.code === 'ENOENT') {\n return;\n }\n throw error;\n }\n}\n\nexport async function ignoreErrorAsync<T>(fn: () => Promise<T>): Promise<T | undefined> {\n try {\n return await fn();\n } catch {\n // do nothing\n }\n}\n\nexport async function ignoreEnoentAsync<T>(fn: () => Promise<T>): Promise<T | undefined> {\n try {\n return await fn();\n } catch (error) {\n if (typeof error === 'object' && error && 'code' in error && error.code === 'ENOENT') {\n return;\n }\n throw error;\n }\n}\n"],"names":["fn","error","code","async","_unused","_unused2"],"mappings":"kCAQO,SAAyBA,GAC9B,IACE,OAAOA,GAMT,CALE,MAAOC,GACP,GAAqB,iBAAVA,GAAsBA,GAAS,SAAUA,GAAwB,WAAfA,EAAMC,KACjE,OAEF,MAAMD,CACR,CACF,4BAUOE,eAAoCH,GACzC,IACE,aAAaA,GAMf,CALE,MAAOC,GACP,GAAqB,iBAAVA,GAAsBA,GAAS,SAAUA,GAAwB,WAAfA,EAAMC,KACjE,OAEF,MAAMD,CACR,CACF,sBApCO,SAAwBD,GAC7B,IACE,OAAOA,GAEP,CADA,MAAMI,GACN,CAEJ,2BAaOD,eAAmCH,GACxC,IACE,aAAaA,GAEb,CADA,MAAMK,GACN,CAEJ"}
|
package/dist/cjs/index.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";var r=require("./error.js"),e=require("./shuffle.js"),n=require("./zenkaku.js");exports.ignoreEnoent=r.ignoreEnoent,exports.ignoreEnoentAsync=r.ignoreEnoentAsync,exports.ignoreError=r.ignoreError,exports.ignoreErrorAsync=r.ignoreErrorAsync,exports.shuffle=e.shuffle,exports.zenkakuAlphanumericalsToHankaku=n.zenkakuAlphanumericalsToHankaku;
|
|
2
|
-
//# sourceMappingURL=index.js.map
|
package/dist/cjs/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
package/dist/cjs/shuffle.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"shuffle.js","sources":["../../src/shuffle.ts"],"sourcesContent":["export function shuffle<T>(array: T[]): T[] {\n for (let index = array.length - 1; index > 0; index--) {\n const index_ = Math.floor(Math.random() * (index + 1));\n [array[index], array[index_]] = [array[index_], array[index]];\n }\n return array;\n}\n"],"names":["array","index","length","index_","Math","floor","random"],"mappings":"6BAAO,SAAoBA,GACzB,IAAK,IAAIC,EAAQD,EAAME,OAAS,EAAGD,EAAQ,EAAGA,IAAS,CACrD,MAAME,EAASC,KAAKC,MAAMD,KAAKE,UAAYL,EAAQ,KAClDD,EAAMC,GAAQD,EAAMG,IAAW,CAACH,EAAMG,GAASH,EAAMC,GACxD,CACA,OAAOD,CACT"}
|
package/dist/cjs/zenkaku.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"zenkaku.js","sources":["../../src/zenkaku.ts"],"sourcesContent":["export function zenkakuAlphanumericalsToHankaku(str: string): string {\n return str.replace(/[0-9A-Za-z]/g, (s: string) => {\n return String.fromCodePoint((s.codePointAt(0) ?? 0) - 0xfe_e0);\n });\n}\n"],"names":["str","replace","s","_s$codePointAt","String","fromCodePoint","codePointAt"],"mappings":"qDAAO,SAAyCA,GAC9C,OAAOA,EAAIC,QAAQ,gBAAiBC,IAAc,IAAAC,EAChD,OAAOC,OAAOC,eAA+B,UAAhBH,EAAEI,YAAY,UAAE,IAAAH,EAAAA,EAAI,GAAK,MAAQ,GAElE"}
|