@inox-tools/utils 0.1.0 → 0.1.2

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/README.md CHANGED
@@ -4,10 +4,14 @@
4
4
 
5
5
  # Utils
6
6
 
7
- A collection of utilities used throughout Inox Tools
7
+ A collection of utilities used throughout Inox Tools.
8
8
 
9
9
  ## Install
10
10
 
11
11
  ```js
12
12
  npm i -D @inox-tools/utils
13
13
  ```
14
+
15
+ ### License
16
+
17
+ These utilities are available under the MIT license.
package/dist/once.d.ts ADDED
@@ -0,0 +1,6 @@
1
+ declare class Once {
2
+ #private;
3
+ do(callback: () => void): void;
4
+ }
5
+
6
+ export { Once };
package/dist/once.js ADDED
@@ -0,0 +1,5 @@
1
+ class e{#o=!1;do(o){this.#o||o();}}
2
+
3
+ export { e as Once };
4
+ //# sourceMappingURL=out.js.map
5
+ //# sourceMappingURL=once.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/once.ts"],"names":["Once","#done","callback"],"mappings":"AAAO,MAAMA,CAAK,CACRC,GAAQ,GAEV,GAAGC,EAA4B,CAChC,KAAKD,IACTC,EAAS,CAEX,CACD","sourcesContent":["export class Once {\n\treadonly #done = false;\n\n\tpublic do(callback: () => void): void {\n\t\tif (!this.#done) {\n\t\t\tcallback();\n\t\t}\n\t}\n}\n"]}
@@ -0,0 +1,5 @@
1
+ type Prettify<T> = {
2
+ [K in keyof T]: T[K];
3
+ } & {};
4
+
5
+ export type { Prettify };
package/dist/types.js ADDED
@@ -0,0 +1,3 @@
1
+
2
+ //# sourceMappingURL=out.js.map
3
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inox-tools/utils",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "A collection of utilities used throughout Inox Tools",
5
5
  "keywords": [
6
6
  "utilities"
@@ -20,15 +20,15 @@
20
20
  "src"
21
21
  ],
22
22
  "devDependencies": {
23
- "@types/node": "^20",
24
- "@vitest/coverage-v8": "^1.5.0",
25
- "@vitest/ui": "^1.5.0",
23
+ "@types/node": "^20.14.10",
24
+ "@vitest/coverage-v8": "^1.6.0",
25
+ "@vitest/ui": "^1.6.0",
26
+ "astro": "^4.11.5",
26
27
  "jest-extended": "^4.0.2",
27
- "astro": "^4",
28
- "tsup": "^8",
29
- "typescript": "^5",
30
- "vite": "^5",
31
- "vitest": "^1.5.0"
28
+ "tsup": "^8.1.0",
29
+ "typescript": "^5.5.3",
30
+ "vite": "^5.3.3",
31
+ "vitest": "^1.6.0"
32
32
  },
33
33
  "scripts": {
34
34
  "build": "tsup",
package/src/once.ts ADDED
@@ -0,0 +1,9 @@
1
+ export class Once {
2
+ readonly #done = false;
3
+
4
+ public do(callback: () => void): void {
5
+ if (!this.#done) {
6
+ callback();
7
+ }
8
+ }
9
+ }
package/src/types.ts ADDED
@@ -0,0 +1,4 @@
1
+ // Source: https://www.totaltypescript.com/concepts/the-prettify-helper
2
+ export type Prettify<T> = {
3
+ [K in keyof T]: T[K];
4
+ } & {};