@alwatr/flatomise 5.5.29 → 6.0.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/main.js ADDED
@@ -0,0 +1,5 @@
1
+ /* 📦 @alwatr/flatomise v6.0.0 */
2
+ function B(){let k={settled:!1};return k.promise=new Promise((q,z)=>{k.resolve=q,k.reject=z}),k.promise.finally(()=>{k.settled=!0}),k}export{B as newFlatomise};
3
+
4
+ //# debugId=006E1984DAD5F3D864756E2164756E21
5
+ //# sourceMappingURL=main.js.map
@@ -0,0 +1,10 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/main.ts"],
4
+ "sourcesContent": [
5
+ "/* eslint-disable @typescript-eslint/no-explicit-any */\n\nimport type {} from '@alwatr/type-helper';\n\n/**\n * Flat promise that can be resolved or rejected from outside.\n */\nexport interface Flatomise<T> {\n /**\n * The promise.\n */\n readonly promise: Promise<T>;\n\n /**\n * Resolve the promise.\n */\n readonly resolve: (value: T | PromiseLike<T>) => void;\n\n /**\n * Reject the promise.\n */\n readonly reject: (reason?: any) => void;\n\n /**\n * Whether the promise is settled (resolved or rejected).\n */\n readonly settled: boolean;\n}\n\n/**\n * Create a new Flatomise is a promise that can be resolved or rejected from outside.\n *\n * @returns A new Flatomise.\n *\n * @example\n * ```typescript\n * const flatomise = newFlatomise();\n * flatomise.promise.then(() => {\n * console.log('flatomise resolved');\n * });\n * flatomise.resolve();\n * ```\n */\nexport function newFlatomise<T>(): Flatomise<T> {\n const flatomise: Partial<Mutable<Flatomise<T>>> = {settled: false};\n flatomise.promise = new Promise<T>((resolve, reject) => {\n flatomise.resolve = resolve;\n flatomise.reject = reject;\n });\n flatomise.promise.finally(() => {\n flatomise.settled = true;\n });\n return flatomise as Flatomise<T>;\n}\n"
6
+ ],
7
+ "mappings": ";AA2CO,SAAS,CAAe,EAAiB,CAC9C,IAAM,EAA4C,CAAC,QAAS,EAAK,EAQjE,OAPA,EAAU,QAAU,IAAI,QAAW,CAAC,EAAS,IAAW,CACtD,EAAU,QAAU,EACpB,EAAU,OAAS,EACpB,EACD,EAAU,QAAQ,QAAQ,IAAM,CAC9B,EAAU,QAAU,GACrB,EACM",
8
+ "debugId": "006E1984DAD5F3D864756E2164756E21",
9
+ "names": []
10
+ }
package/package.json CHANGED
@@ -1,25 +1,25 @@
1
1
  {
2
2
  "name": "@alwatr/flatomise",
3
3
  "description": "A utility for creating promises that can be externally resolved or rejected.",
4
- "version": "5.5.29",
4
+ "version": "6.0.0",
5
5
  "author": "S. Ali Mihandoost <ali.mihandoost@gmail.com>",
6
6
  "bugs": "https://github.com/Alwatr/nanolib/issues",
7
7
  "devDependencies": {
8
- "@alwatr/nano-build": "6.4.2",
9
- "@alwatr/prettier-config": "6.0.2",
10
- "@alwatr/tsconfig-base": "6.0.4",
11
- "@alwatr/type-helper": "7.0.2",
8
+ "@alwatr/nano-build": "7.0.0",
9
+ "@alwatr/prettier-config": "7.0.0",
10
+ "@alwatr/tsconfig-base": "7.0.0",
11
+ "@alwatr/type-helper": "8.0.0",
12
12
  "typescript": "^5.9.3"
13
13
  },
14
14
  "exports": {
15
15
  ".": {
16
16
  "types": "./dist/main.d.ts",
17
- "import": "./dist/main.mjs",
18
- "require": "./dist/main.cjs"
17
+ "default": "./dist/main.js"
19
18
  }
20
19
  },
21
20
  "files": [
22
- "**/*.{js,mjs,cjs,map,d.ts,html,md,LEGAL.txt}",
21
+ "**/*.{js,mjs,cjs,ts,map,d.ts,html,LEGAL.txt}",
22
+ "README.md",
23
23
  "LICENSE",
24
24
  "!demo/**/*",
25
25
  "!**/*.test.js"
@@ -44,8 +44,6 @@
44
44
  "utils"
45
45
  ],
46
46
  "license": "MPL-2.0",
47
- "main": "./dist/main.cjs",
48
- "module": "./dist/main.mjs",
49
47
  "prettier": "@alwatr/prettier-config",
50
48
  "publishConfig": {
51
49
  "access": "public"
@@ -58,12 +56,12 @@
58
56
  "scripts": {
59
57
  "b": "bun run build",
60
58
  "build": "bun run build:ts && bun run build:es",
61
- "build:es": "nano-build --preset=module",
59
+ "build:es": "nano-build --preset=module src/main.ts",
62
60
  "build:ts": "tsc --build",
63
61
  "c": "bun run clean",
64
62
  "cb": "bun run clean && bun run build",
65
63
  "clean": "rm -rfv dist *.tsbuildinfo",
66
- "d": "bun run build:es && bun --enable-source-maps --trace-warnings",
64
+ "d": "bun run build:es && bun",
67
65
  "w": "bun run watch",
68
66
  "watch": "bun run watch:ts & bun run watch:es",
69
67
  "watch:es": "bun run build:es --watch",
@@ -72,5 +70,5 @@
72
70
  "sideEffects": false,
73
71
  "type": "module",
74
72
  "types": "./dist/main.d.ts",
75
- "gitHead": "c3889e3756b0a0f9b935a1b702a1373ac52cb379"
73
+ "gitHead": "056102a1c8a563bbae8a290b6830450f467322a3"
76
74
  }
package/src/main.ts ADDED
@@ -0,0 +1,54 @@
1
+ /* eslint-disable @typescript-eslint/no-explicit-any */
2
+
3
+ import type {} from '@alwatr/type-helper';
4
+
5
+ /**
6
+ * Flat promise that can be resolved or rejected from outside.
7
+ */
8
+ export interface Flatomise<T> {
9
+ /**
10
+ * The promise.
11
+ */
12
+ readonly promise: Promise<T>;
13
+
14
+ /**
15
+ * Resolve the promise.
16
+ */
17
+ readonly resolve: (value: T | PromiseLike<T>) => void;
18
+
19
+ /**
20
+ * Reject the promise.
21
+ */
22
+ readonly reject: (reason?: any) => void;
23
+
24
+ /**
25
+ * Whether the promise is settled (resolved or rejected).
26
+ */
27
+ readonly settled: boolean;
28
+ }
29
+
30
+ /**
31
+ * Create a new Flatomise is a promise that can be resolved or rejected from outside.
32
+ *
33
+ * @returns A new Flatomise.
34
+ *
35
+ * @example
36
+ * ```typescript
37
+ * const flatomise = newFlatomise();
38
+ * flatomise.promise.then(() => {
39
+ * console.log('flatomise resolved');
40
+ * });
41
+ * flatomise.resolve();
42
+ * ```
43
+ */
44
+ export function newFlatomise<T>(): Flatomise<T> {
45
+ const flatomise: Partial<Mutable<Flatomise<T>>> = {settled: false};
46
+ flatomise.promise = new Promise<T>((resolve, reject) => {
47
+ flatomise.resolve = resolve;
48
+ flatomise.reject = reject;
49
+ });
50
+ flatomise.promise.finally(() => {
51
+ flatomise.settled = true;
52
+ });
53
+ return flatomise as Flatomise<T>;
54
+ }
package/CHANGELOG.md DELETED
@@ -1,401 +0,0 @@
1
- # Change Log
2
-
3
- All notable changes to this project will be documented in this file.
4
- See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
-
6
- ## [5.5.29](https://github.com/Alwatr/nanolib/compare/@alwatr/flatomise@5.5.28...@alwatr/flatomise@5.5.29) (2026-03-16)
7
-
8
- ### 🔨 Code Refactoring
9
-
10
- * migrate build scripts from yarn to bun across multiple packages ([d90e962](https://github.com/Alwatr/nanolib/commit/d90e962f15e5c951e191d5f02341279b6472abc3))
11
-
12
- ## [5.5.28](https://github.com/Alwatr/nanolib/compare/@alwatr/flatomise@5.5.27...@alwatr/flatomise@5.5.28) (2026-02-18)
13
-
14
- **Note:** Version bump only for package @alwatr/flatomise
15
-
16
- ## [5.5.27](https://github.com/Alwatr/nanolib/compare/@alwatr/flatomise@5.5.26...@alwatr/flatomise@5.5.27) (2025-12-23)
17
-
18
- **Note:** Version bump only for package @alwatr/flatomise
19
-
20
- ## [5.5.26](https://github.com/Alwatr/nanolib/compare/@alwatr/flatomise@5.5.25...@alwatr/flatomise@5.5.26) (2025-12-13)
21
-
22
- **Note:** Version bump only for package @alwatr/flatomise
23
-
24
- ## [5.5.25](https://github.com/Alwatr/nanolib/compare/@alwatr/flatomise@5.5.24...@alwatr/flatomise@5.5.25) (2025-12-10)
25
-
26
- **Note:** Version bump only for package @alwatr/flatomise
27
-
28
- ## [5.5.24](https://github.com/Alwatr/nanolib/compare/@alwatr/flatomise@5.5.23...@alwatr/flatomise@5.5.24) (2025-11-18)
29
-
30
- ### 🐛 Bug Fixes
31
-
32
- * add type imports from @alwatr/nano-build and @alwatr/type-helper across multiple packages ([5ab7f15](https://github.com/Alwatr/nanolib/commit/5ab7f159ba57788bf8df40fa96a3027f589d5a77))
33
-
34
- ### 🔨 Code Refactoring
35
-
36
- * remove unnecessary type declarations from tsconfig.json files ([89bcc7d](https://github.com/Alwatr/nanolib/commit/89bcc7db839807110b80f8ba34414ea9734d9c75))
37
-
38
- ## [5.5.23](https://github.com/Alwatr/nanolib/compare/@alwatr/flatomise@5.5.22...@alwatr/flatomise@5.5.23) (2025-11-15)
39
-
40
- **Note:** Version bump only for package @alwatr/flatomise
41
-
42
- ## [5.5.22](https://github.com/Alwatr/nanolib/compare/@alwatr/flatomise@5.5.21...@alwatr/flatomise@5.5.22) (2025-11-15)
43
-
44
- **Note:** Version bump only for package @alwatr/flatomise
45
-
46
- ## [5.5.21](https://github.com/Alwatr/nanolib/compare/@alwatr/flatomise@5.5.20...@alwatr/flatomise@5.5.21) (2025-11-04)
47
-
48
- **Note:** Version bump only for package @alwatr/flatomise
49
-
50
- ## [5.5.20](https://github.com/Alwatr/nanolib/compare/@alwatr/flatomise@5.5.19...@alwatr/flatomise@5.5.20) (2025-10-06)
51
-
52
- ### 🔗 Dependencies update
53
-
54
- * bump the npm-dependencies group with 4 updates ([9825815](https://github.com/Alwatr/nanolib/commit/982581552bbb4b97dca52af5e93a80937f0c3109))
55
-
56
- ## [5.5.19](https://github.com/Alwatr/nanolib/compare/@alwatr/flatomise@5.5.18...@alwatr/flatomise@5.5.19) (2025-09-27)
57
-
58
- ### 🧹 Miscellaneous Chores
59
-
60
- * exclude test files from package distribution ([86f4f2f](https://github.com/Alwatr/nanolib/commit/86f4f2f5985845c5cf3a3a9398de7b2f98ce53e7))
61
-
62
- ## [5.5.18](https://github.com/Alwatr/nanolib/compare/@alwatr/flatomise@5.5.17...@alwatr/flatomise@5.5.18) (2025-09-22)
63
-
64
- **Note:** Version bump only for package @alwatr/flatomise
65
-
66
- ## [5.5.17](https://github.com/Alwatr/nanolib/compare/@alwatr/flatomise@5.5.16...@alwatr/flatomise@5.5.17) (2025-09-22)
67
-
68
- **Note:** Version bump only for package @alwatr/flatomise
69
-
70
- ## [5.5.16](https://github.com/Alwatr/nanolib/compare/@alwatr/flatomise@5.5.15...@alwatr/flatomise@5.5.16) (2025-09-21)
71
-
72
- **Note:** Version bump only for package @alwatr/flatomise
73
-
74
- ## [5.5.15](https://github.com/Alwatr/nanolib/compare/@alwatr/flatomise@5.5.14...@alwatr/flatomise@5.5.15) (2025-09-20)
75
-
76
- ### 🐛 Bug Fixes
77
-
78
- * add sideEffects property to package.json files for better tree-shaking ([c7b9e74](https://github.com/Alwatr/nanolib/commit/c7b9e74e1920c8e35b438742de61883ca62da58c))
79
- * add sideEffects property to package.json files for better tree-shaking ([e8402c4](https://github.com/Alwatr/nanolib/commit/e8402c481a14a1f807a37aaa862a936713d26176))
80
-
81
- ### 🧹 Miscellaneous Chores
82
-
83
- * remove duplicate sideEffects property from multiple package.json files ([b123f86](https://github.com/Alwatr/nanolib/commit/b123f86be81481de2314aae9bb2eeb629743d24c))
84
-
85
- ## [5.5.14](https://github.com/Alwatr/nanolib/compare/@alwatr/flatomise@5.5.13...@alwatr/flatomise@5.5.14) (2025-09-19)
86
-
87
- **Note:** Version bump only for package @alwatr/flatomise
88
-
89
- ## [5.5.13](https://github.com/Alwatr/nanolib/compare/@alwatr/flatomise@5.5.12...@alwatr/flatomise@5.5.13) (2025-09-15)
90
-
91
- **Note:** Version bump only for package @alwatr/flatomise
92
-
93
- ## [5.5.12](https://github.com/Alwatr/nanolib/compare/@alwatr/flatomise@5.5.11...@alwatr/flatomise@5.5.12) (2025-09-13)
94
-
95
- **Note:** Version bump only for package @alwatr/flatomise
96
-
97
- ## [5.5.11](https://github.com/Alwatr/nanolib/compare/@alwatr/flatomise@5.5.10...@alwatr/flatomise@5.5.11) (2025-09-13)
98
-
99
- ### 🧹 Miscellaneous Chores
100
-
101
- * remove package-tracer dependency and related code from fetch package ([96fe4e9](https://github.com/Alwatr/nanolib/commit/96fe4e9552a205f218ceed187c55e4e904a07089))
102
-
103
- ## [5.5.10](https://github.com/Alwatr/nanolib/compare/@alwatr/flatomise@5.5.9...@alwatr/flatomise@5.5.10) (2025-09-09)
104
-
105
- ### 🧹 Miscellaneous Chores
106
-
107
- * remove trailing newlines from contributing sections in README files ([e8ab1bc](https://github.com/Alwatr/nanolib/commit/e8ab1bc43e0addea5ccd4c897c2cec597cb9e15f))
108
-
109
- ## [5.5.9](https://github.com/Alwatr/nanolib/compare/@alwatr/flatomise@5.5.8...@alwatr/flatomise@5.5.9) (2025-09-06)
110
-
111
- **Note:** Version bump only for package @alwatr/flatomise
112
-
113
- ## [5.5.8](https://github.com/Alwatr/nanolib/compare/@alwatr/flatomise@5.5.7...@alwatr/flatomise@5.5.8) (2025-09-05)
114
-
115
- **Note:** Version bump only for package @alwatr/flatomise
116
-
117
- ## [5.5.7](https://github.com/Alwatr/nanolib/compare/@alwatr/flatomise@5.5.6...@alwatr/flatomise@5.5.7) (2025-09-01)
118
-
119
- **Note:** Version bump only for package @alwatr/flatomise
120
-
121
- ## [5.5.6](https://github.com/Alwatr/nanolib/compare/@alwatr/flatomise@5.5.5...@alwatr/flatomise@5.5.6) (2025-08-23)
122
-
123
- **Note:** Version bump only for package @alwatr/flatomise
124
-
125
- ## [5.5.5](https://github.com/Alwatr/nanolib/compare/@alwatr/flatomise@5.5.3...@alwatr/flatomise@5.5.5) (2025-08-23)
126
-
127
- ### 🐛 Bug Fixes
128
-
129
- * update license from AGPL-3.0-only to MPL-2.0 ([d20968e](https://github.com/Alwatr/nanolib/commit/d20968e60cc89b1dcdf9b96507178da6ed562f55))
130
- * update package versions in multiple package.json files ([7638b1c](https://github.com/Alwatr/nanolib/commit/7638b1cafee2b4e0f97db7a89ac9fba6384b9b10))
131
-
132
- ### 🔨 Code Refactoring
133
-
134
- * Updated all package.json files in the project to change dependency version specifiers from "workspace:^" to "workspace:*" for consistency and to allow for more flexible version resolution. ([db6a4f7](https://github.com/Alwatr/nanolib/commit/db6a4f76deec2d1d8039978144e4bc51b6f1a0e3))
135
-
136
- ### 🧹 Miscellaneous Chores
137
-
138
- * reformat all package.json files ([ceda45d](https://github.com/Alwatr/nanolib/commit/ceda45de186667790474f729cb4b161a5148ce19))
139
-
140
- ### 🔗 Dependencies update
141
-
142
- * update TypeScript and Jest versions across all packages to improve compatibility and performance ([31baf36](https://github.com/Alwatr/nanolib/commit/31baf366101e92e27db66a21c849fb101f19be47))
143
-
144
- ## [5.5.4](https://github.com/Alwatr/nanolib/compare/@alwatr/flatomise@5.5.3...@alwatr/flatomise@5.5.4) (2025-08-23)
145
-
146
- ### Code Refactoring
147
-
148
- * Updated all package.json files in the project to change dependency version specifiers from "workspace:^" to "workspace:*" for consistency and to allow for more flexible version resolution. ([db6a4f7](https://github.com/Alwatr/nanolib/commit/db6a4f76deec2d1d8039978144e4bc51b6f1a0e3)) by @alimd
149
-
150
- ## <small>5.5.3 (2025-04-15)</small>
151
-
152
- **Note:** Version bump only for package @alwatr/flatomise
153
-
154
- ## [5.5.2](https://github.com/Alwatr/nanolib/compare/@alwatr/flatomise@5.5.1...@alwatr/flatomise@5.5.2) (2025-04-01)
155
-
156
- **Note:** Version bump only for package @alwatr/flatomise
157
-
158
- ## [5.5.1](https://github.com/Alwatr/nanolib/compare/@alwatr/flatomise@5.5.0...@alwatr/flatomise@5.5.1) (2025-03-18)
159
-
160
- **Note:** Version bump only for package @alwatr/flatomise
161
-
162
- ## [5.5.0](https://github.com/Alwatr/nanolib/compare/@alwatr/flatomise@5.4.0...@alwatr/flatomise@5.5.0) (2025-03-06)
163
-
164
- ### Miscellaneous Chores
165
-
166
- * update username casing in changelog entries ([9722ac9](https://github.com/Alwatr/nanolib/commit/9722ac9a078438a4e8ebfa5826ea70e0e3a52ca6)) by @
167
-
168
- ### Dependencies update
169
-
170
- * bump the development-dependencies group across 1 directory with 11 updates ([720c395](https://github.com/Alwatr/nanolib/commit/720c3954da55c929fe8fb16957121f4c51fb7f0c)) by @dependabot[bot]
171
-
172
- ## [5.4.0](https://github.com/Alwatr/nanolib/compare/@alwatr/flatomise@1.2.8...@alwatr/flatomise@5.4.0) (2025-02-18)
173
-
174
- ### Features
175
-
176
- * enhance Flatomise interface with promise settlement tracking ([692e7ff](https://github.com/Alwatr/nanolib/commit/692e7ff5ddbc2efef16aaa2ecbeff90e55d63e2a)) by @
177
-
178
- ### Code Refactoring
179
-
180
- * make Flatomise properties readonly for immutability ([14dd30f](https://github.com/Alwatr/nanolib/commit/14dd30f6615d6e4cddf125803267fc9a817f59ac)) by @
181
-
182
- ### Dependencies update
183
-
184
- * **flatomise:** add @alwatr/type-helper to dependencies and TypeScript types ([7a489ab](https://github.com/Alwatr/nanolib/commit/7a489abd39aac2c1189e6697025f82af196e2fe9)) by @
185
-
186
- ## 5.3.0 (2025-02-03)
187
-
188
- ### Miscellaneous Chores
189
-
190
- * edit README ([3860b3d](https://github.com/Alwatr/nanolib/commit/3860b3df48ab82dc479d5236c2e8579df614aabf)) by @
191
-
192
- ### Dependencies update
193
-
194
- * bump the development-dependencies group across 1 directory with 11 updates ([cb79d07](https://github.com/Alwatr/nanolib/commit/cb79d072a57c79e1c01abff1a293d6757bb65350)) by @
195
- * update typescript and @types/node to version 5.7.3 and 22.13.0 respectively across multiple packages ([ddab05b](https://github.com/Alwatr/nanolib/commit/ddab05b5d767c30191f36a065e4bc88744e8e3fe)) by @
196
-
197
- ## 5.0.0 (2024-11-02)
198
-
199
- ### ⚠ BREAKING CHANGES
200
-
201
- * To simplify version management and ensure consistency, all nanolib packages now use the same version as @alwatr/nanolib. This may require updates to your project's dependencies.
202
-
203
- ### Code Refactoring
204
-
205
- * use the same version as @alwatr/nanolib ([60eb860](https://github.com/Alwatr/nanolib/commit/60eb860a0e33dfffe2d1d95e63ce54c60876be06)) by @
206
-
207
- ## [5.3.0](https://github.com/Alwatr/nanolib/compare/v5.2.1...v5.3.0) (2025-02-03)
208
-
209
- ### Miscellaneous Chores
210
-
211
- * edit README ([3860b3d](https://github.com/Alwatr/nanolib/commit/3860b3df48ab82dc479d5236c2e8579df614aabf)) by @ArmanAsadian
212
-
213
- ### Dependencies update
214
-
215
- * bump the development-dependencies group across 1 directory with 11 updates ([cb79d07](https://github.com/Alwatr/nanolib/commit/cb79d072a57c79e1c01abff1a293d6757bb65350)) by @dependabot[bot]
216
- * update typescript and @types/node to version 5.7.3 and 22.13.0 respectively across multiple packages ([ddab05b](https://github.com/Alwatr/nanolib/commit/ddab05b5d767c30191f36a065e4bc88744e8e3fe)) by @alimd
217
-
218
- ## 5.0.0 (2024-11-02)
219
-
220
- ### ⚠ BREAKING CHANGES
221
-
222
- * To simplify version management and ensure consistency, all nanolib packages now use the same version as @alwatr/nanolib. This may require updates to your project's dependencies.
223
-
224
- ### Features
225
-
226
- * **flatomise:** A utility for creating promises that can be externally resolved or rejected. ([1bc4478](https://github.com/Alwatr/nanolib/commit/1bc4478327f156b5e45650590aea013590443723)) by @
227
- * **flatomise:** generic type ([3193b43](https://github.com/Alwatr/nanolib/commit/3193b4378681ec7c840d6d7806dad041a1db7573)) by @
228
- * use `package-tracer` ([cc3c5f9](https://github.com/Alwatr/nanolib/commit/cc3c5f9c1a3d03f0d81b46835665f16a0426fd0d)) by @
229
-
230
- ### Bug Fixes
231
-
232
- * all dependeny topology ([1c17f34](https://github.com/Alwatr/nanolib/commit/1c17f349adf3e98e2a80ab2da4f0f81028dc9c5f)) by @
233
-
234
- ### Code Refactoring
235
-
236
- * prevent side-effects ([01e00e1](https://github.com/Alwatr/nanolib/commit/01e00e191385cc92b28677df0c01a085916ae677)) by @
237
- * use the same version as @alwatr/nanolib ([60eb860](https://github.com/Alwatr/nanolib/commit/60eb860a0e33dfffe2d1d95e63ce54c60876be06)) by @
238
-
239
- ### Miscellaneous Chores
240
-
241
- * **deps-dev:** bump the development-dependencies group with 3 updates ([0e0ec0f](https://github.com/Alwatr/nanolib/commit/0e0ec0f7c66c849727563cabe0e88606aee49035)) by @
242
- * **deps:** update ([1a45030](https://github.com/Alwatr/nanolib/commit/1a450305440b710a300787d4ca24b1ed8c6a39d7)) by @
243
- * **deps:** update ([8e70dff](https://github.com/Alwatr/nanolib/commit/8e70dffb1e751496ef2e72d6cffd685f1fea44e3)) by @
244
- * **deps:** update ([f0b60d2](https://github.com/Alwatr/nanolib/commit/f0b60d24c9fae6190940baf95167a1175360d4b3)) by @
245
- * **flatomise:** change the license to AGPL-3.0 ([bc9d81b](https://github.com/Alwatr/nanolib/commit/bc9d81b7a3f62113559be6dbd002cf4f2e301583)) by @
246
- * include LICENSE and LEGAL files to publish ([09f366f](https://github.com/Alwatr/nanolib/commit/09f366f680bfa9fb26acb2cd1ccbc68c5a9e9ad8)) by @
247
- * rename logger env ([38443ad](https://github.com/Alwatr/nanolib/commit/38443ade4677e857b5ebd4be417f5f2eb1818c87)) by @
248
- * Update build and lint scripts ([392d0b7](https://github.com/Alwatr/nanolib/commit/392d0b71f446bce336b0256119a80f07aff794ba)) by @
249
- * Update debug command in package.json ([be8403d](https://github.com/Alwatr/nanolib/commit/be8403dec754f2117259bb915b110ea386596401)) by @
250
- * Update package.json exports for [@alwatr](https://github.com/alwatr) packages ([dacb362](https://github.com/Alwatr/nanolib/commit/dacb362b145e3c51b4aba00ff643687a3fac11d2)) by @
251
-
252
- ### Dependencies update
253
-
254
- * bump @types/node ([3d80fed](https://github.com/Alwatr/nanolib/commit/3d80fedaf720af792feb060c2f81c737ebb84e11)) by @
255
- * bump the development-dependencies group across 1 directory with 10 updates ([9ed98ff](https://github.com/Alwatr/nanolib/commit/9ed98ffd0668d5a36e255c82edab3af53bffda8f)) by @
256
- * bump the development-dependencies group with 10 updates ([fa4aaf0](https://github.com/Alwatr/nanolib/commit/fa4aaf04c907ecae06aa14000ce35216170c15ad)) by @
257
- * bump the development-dependencies group with 2 updates ([be5d6c2](https://github.com/Alwatr/nanolib/commit/be5d6c2d86b937f32cebc6848aaff85af07055dd)) by @
258
- * upd ([451d025](https://github.com/Alwatr/nanolib/commit/451d0255ba96ed55f897a6f44f62cf4e6d2b12be)) by @
259
- * update ([c36ed50](https://github.com/Alwatr/nanolib/commit/c36ed50f68da2f5608ccd96119963a16cfacb4ce)) by @
260
- * update all ([53342f6](https://github.com/Alwatr/nanolib/commit/53342f67a8a013127f073540bc11929f1813c05c)) by @
261
- * update all dependencies ([1e0c30e](https://github.com/Alwatr/nanolib/commit/1e0c30e6a3a8e19deb5185814e24ab6c08dca573)) by @
262
- * update all dependencies ([0e908b4](https://github.com/Alwatr/nanolib/commit/0e908b476a6b976ec2447f864c8cafcbb8a0f099)) by @
263
- * upgrade ([6dbd300](https://github.com/Alwatr/nanolib/commit/6dbd300642c9bcc9e7d0b281e244bf1b06eb1c38)) by @
264
-
265
- ## [1.2.8](https://github.com/Alwatr/nanolib/compare/@alwatr/flatomise@1.2.7...@alwatr/flatomise@1.2.8) (2024-11-02)
266
-
267
- **Note:** Version bump only for package @alwatr/flatomise
268
-
269
- ## [1.2.7](https://github.com/Alwatr/nanolib/compare/@alwatr/flatomise@1.2.6...@alwatr/flatomise@1.2.7) (2024-10-25)
270
-
271
- **Note:** Version bump only for package @alwatr/flatomise
272
-
273
- ## [1.2.6](https://github.com/Alwatr/nanolib/compare/@alwatr/flatomise@1.2.5...@alwatr/flatomise@1.2.6) (2024-10-12)
274
-
275
- **Note:** Version bump only for package @alwatr/flatomise
276
-
277
- ## [1.2.5](https://github.com/Alwatr/nanolib/compare/@alwatr/flatomise@1.2.4...@alwatr/flatomise@1.2.5) (2024-10-11)
278
-
279
- ### Code Refactoring
280
-
281
- - prevent side-effects ([01e00e1](https://github.com/Alwatr/nanolib/commit/01e00e191385cc92b28677df0c01a085916ae677)) by @mohammadhonarvar
282
-
283
- ## [1.2.4](https://github.com/Alwatr/nanolib/compare/@alwatr/flatomise@1.2.3...@alwatr/flatomise@1.2.4) (2024-10-11)
284
-
285
- ### Miscellaneous Chores
286
-
287
- - include LICENSE and LEGAL files to publish ([09f366f](https://github.com/Alwatr/nanolib/commit/09f366f680bfa9fb26acb2cd1ccbc68c5a9e9ad8)) by @alimd
288
-
289
- ## [1.2.3](https://github.com/Alwatr/nanolib/compare/@alwatr/flatomise@1.2.2...@alwatr/flatomise@1.2.3) (2024-10-11)
290
-
291
- **Note:** Version bump only for package @alwatr/flatomise
292
-
293
- ## [1.2.2](https://github.com/Alwatr/nanolib/compare/@alwatr/flatomise@1.2.1...@alwatr/flatomise@1.2.2) (2024-10-10)
294
-
295
- ### Dependencies update
296
-
297
- - bump the development-dependencies group with 10 updates ([fa4aaf0](https://github.com/Alwatr/nanolib/commit/fa4aaf04c907ecae06aa14000ce35216170c15ad)) by @dependabot[bot]
298
-
299
- ## [1.2.1](https://github.com/Alwatr/nanolib/compare/@alwatr/flatomise@1.2.0...@alwatr/flatomise@1.2.1) (2024-10-08)
300
-
301
- **Note:** Version bump only for package @alwatr/flatomise
302
-
303
- ## [1.2.0](https://github.com/Alwatr/nanolib/compare/@alwatr/flatomise@1.1.12...@alwatr/flatomise@1.2.0) (2024-09-29)
304
-
305
- ### Features
306
-
307
- - use `package-tracer` ([cc3c5f9](https://github.com/Alwatr/nanolib/commit/cc3c5f9c1a3d03f0d81b46835665f16a0426fd0d)) by @mohammadhonarvar
308
-
309
- ### Bug Fixes
310
-
311
- - all dependeny topology ([1c17f34](https://github.com/Alwatr/nanolib/commit/1c17f349adf3e98e2a80ab2da4f0f81028dc9c5f)) by @mohammadhonarvar
312
-
313
- ### Miscellaneous Chores
314
-
315
- - **flatomise:** change the license to AGPL-3.0 ([bc9d81b](https://github.com/Alwatr/nanolib/commit/bc9d81b7a3f62113559be6dbd002cf4f2e301583)) by @ArmanAsadian
316
- - Update build and lint scripts ([392d0b7](https://github.com/Alwatr/nanolib/commit/392d0b71f446bce336b0256119a80f07aff794ba)) by @alimd
317
-
318
- ### Dependencies update
319
-
320
- - bump @types/node ([3d80fed](https://github.com/Alwatr/nanolib/commit/3d80fedaf720af792feb060c2f81c737ebb84e11)) by @dependabot[bot]
321
-
322
- ## [1.1.12](https://github.com/Alwatr/nanolib/compare/@alwatr/flatomise@1.1.11...@alwatr/flatomise@1.1.12) (2024-09-21)
323
-
324
- **Note:** Version bump only for package @alwatr/flatomise
325
-
326
- ## [1.1.11](https://github.com/Alwatr/nanolib/compare/@alwatr/flatomise@1.1.10...@alwatr/flatomise@1.1.11) (2024-09-15)
327
-
328
- ### Dependencies update
329
-
330
- - bump the development-dependencies group across 1 directory with 10 updates ([9ed98ff](https://github.com/Alwatr/nanolib/commit/9ed98ffd0668d5a36e255c82edab3af53bffda8f)) by @dependabot[bot]
331
- - update ([c36ed50](https://github.com/Alwatr/nanolib/commit/c36ed50f68da2f5608ccd96119963a16cfacb4ce)) by @alimd
332
-
333
- ## [1.1.10](https://github.com/Alwatr/nanolib/compare/@alwatr/flatomise@1.1.9...@alwatr/flatomise@1.1.10) (2024-08-31)
334
-
335
- ### Miscellaneous Chores
336
-
337
- - Update package.json exports for [@alwatr](https://github.com/alwatr) packages ([dacb362](https://github.com/Alwatr/nanolib/commit/dacb362b145e3c51b4aba00ff643687a3fac11d2)) by @
338
-
339
- ## [1.1.9](https://github.com/Alwatr/nanolib/compare/@alwatr/flatomise@1.1.8...@alwatr/flatomise@1.1.9) (2024-08-31)
340
-
341
- ### Dependencies update
342
-
343
- - update all dependencies ([1e0c30e](https://github.com/Alwatr/nanolib/commit/1e0c30e6a3a8e19deb5185814e24ab6c08dca573)) by @alimd
344
-
345
- ## [1.1.8](https://github.com/Alwatr/nanolib/compare/@alwatr/flatomise@1.1.7...@alwatr/flatomise@1.1.8) (2024-07-04)
346
-
347
- ### Dependencies update
348
-
349
- - update all dependencies ([0e908b4](https://github.com/Alwatr/nanolib/commit/0e908b476a6b976ec2447f864c8cafcbb8a0f099)) by @
350
-
351
- ## [1.1.7](https://github.com/Alwatr/nanolib/compare/@alwatr/flatomise@1.1.6...@alwatr/flatomise@1.1.7) (2024-05-12)
352
-
353
- ### Dependencies update
354
-
355
- - upgrade ([6dbd300](https://github.com/Alwatr/nanolib/commit/6dbd300642c9bcc9e7d0b281e244bf1b06eb1c38)) by @alimd
356
-
357
- ## [1.1.6](https://github.com/Alwatr/nanolib/compare/@alwatr/flatomise@1.1.5...@alwatr/flatomise@1.1.6) (2024-04-25)
358
-
359
- **Note:** Version bump only for package @alwatr/flatomise
360
-
361
- ## [1.1.5](https://github.com/Alwatr/nanolib/compare/@alwatr/flatomise@1.1.4...@alwatr/flatomise@1.1.5) (2024-03-28)
362
-
363
- **Note:** Version bump only for package @alwatr/flatomise
364
-
365
- ## [1.1.4](https://github.com/Alwatr/nanolib/compare/@alwatr/flatomise@1.1.3...@alwatr/flatomise@1.1.4) (2024-01-31)
366
-
367
- ### Miscellaneous Chores
368
-
369
- - **deps:** update ([1a45030](https://github.com/Alwatr/nanolib/commit/1a450305440b710a300787d4ca24b1ed8c6a39d7)) by @alimd
370
-
371
- ## [1.1.3](https://github.com/Alwatr/nanolib/compare/@alwatr/flatomise@1.1.2...@alwatr/flatomise@1.1.3) (2024-01-24)
372
-
373
- **Note:** Version bump only for package @alwatr/flatomise
374
-
375
- ## [1.1.2](https://github.com/Alwatr/nanolib/compare/@alwatr/flatomise@1.1.1...@alwatr/flatomise@1.1.2) (2024-01-20)
376
-
377
- **Note:** Version bump only for package @alwatr/flatomise
378
-
379
- ## [1.1.1](https://github.com/Alwatr/nanolib/compare/@alwatr/flatomise@1.1.0...@alwatr/flatomise@1.1.1) (2024-01-16)
380
-
381
- **Note:** Version bump only for package @alwatr/flatomise
382
-
383
- # [1.1.0](https://github.com/Alwatr/nanolib/compare/@alwatr/flatomise@1.0.2...@alwatr/flatomise@1.1.0) (2024-01-08)
384
-
385
- ### Features
386
-
387
- - **flatomise:** generic type ([3193b43](https://github.com/Alwatr/nanolib/commit/3193b4378681ec7c840d6d7806dad041a1db7573)) by @alimd
388
-
389
- ## [1.0.2](https://github.com/Alwatr/nanolib/compare/@alwatr/flatomise@1.0.1...@alwatr/flatomise@1.0.2) (2024-01-08)
390
-
391
- **Note:** Version bump only for package @alwatr/flatomise
392
-
393
- ## [1.0.1](https://github.com/Alwatr/nanolib/compare/@alwatr/flatomise@1.0.0...@alwatr/flatomise@1.0.1) (2024-01-03)
394
-
395
- **Note:** Version bump only for package @alwatr/flatomise
396
-
397
- # 1.0.0 (2024-01-03)
398
-
399
- ### Features
400
-
401
- - **flatomise:** A utility for creating promises that can be externally resolved or rejected. ([1bc4478](https://github.com/Alwatr/nanolib/commit/1bc4478327f156b5e45650590aea013590443723)) by @alimd
package/dist/main.cjs DELETED
@@ -1,3 +0,0 @@
1
- /** 📦 @alwatr/flatomise v5.5.29 */
2
- "use strict";var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __hasOwnProp=Object.prototype.hasOwnProperty;var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:true})};var __copyProps=(to,from,except,desc)=>{if(from&&typeof from==="object"||typeof from==="function"){for(let key of __getOwnPropNames(from))if(!__hasOwnProp.call(to,key)&&key!==except)__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable})}return to};var __toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:true}),mod);var main_exports={};__export(main_exports,{newFlatomise:()=>newFlatomise});module.exports=__toCommonJS(main_exports);function newFlatomise(){const flatomise={settled:false};flatomise.promise=new Promise((resolve,reject)=>{flatomise.resolve=resolve;flatomise.reject=reject});flatomise.promise.finally(()=>{flatomise.settled=true});return flatomise}0&&(module.exports={newFlatomise});
3
- //# sourceMappingURL=main.cjs.map
package/dist/main.cjs.map DELETED
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/main.ts"],
4
- "sourcesContent": ["/* eslint-disable @typescript-eslint/no-explicit-any */\n\nimport type {} from '@alwatr/type-helper';\n\n/**\n * Flat promise that can be resolved or rejected from outside.\n */\nexport interface Flatomise<T> {\n /**\n * The promise.\n */\n readonly promise: Promise<T>;\n\n /**\n * Resolve the promise.\n */\n readonly resolve: (value: T | PromiseLike<T>) => void;\n\n /**\n * Reject the promise.\n */\n readonly reject: (reason?: any) => void;\n\n /**\n * Whether the promise is settled (resolved or rejected).\n */\n readonly settled: boolean;\n}\n\n/**\n * Create a new Flatomise is a promise that can be resolved or rejected from outside.\n *\n * @returns A new Flatomise.\n *\n * @example\n * ```typescript\n * const flatomise = newFlatomise();\n * flatomise.promise.then(() => {\n * console.log('flatomise resolved');\n * });\n * flatomise.resolve();\n * ```\n */\nexport function newFlatomise<T>(): Flatomise<T> {\n const flatomise: Partial<Mutable<Flatomise<T>>> = {settled: false};\n flatomise.promise = new Promise<T>((resolve, reject) => {\n flatomise.resolve = resolve;\n flatomise.reject = reject;\n });\n flatomise.promise.finally(() => {\n flatomise.settled = true;\n });\n return flatomise as Flatomise<T>;\n}\n"],
5
- "mappings": ";qqBAAA,qHA2CO,SAAS,cAAgC,CAC9C,MAAM,UAA4C,CAAC,QAAS,KAAK,EACjE,UAAU,QAAU,IAAI,QAAW,CAAC,QAAS,SAAW,CACtD,UAAU,QAAU,QACpB,UAAU,OAAS,MACrB,CAAC,EACD,UAAU,QAAQ,QAAQ,IAAM,CAC9B,UAAU,QAAU,IACtB,CAAC,EACD,OAAO,SACT",
6
- "names": []
7
- }
package/dist/main.mjs DELETED
@@ -1,3 +0,0 @@
1
- /** 📦 @alwatr/flatomise v5.5.29 */
2
- function newFlatomise(){const flatomise={settled:false};flatomise.promise=new Promise((resolve,reject)=>{flatomise.resolve=resolve;flatomise.reject=reject});flatomise.promise.finally(()=>{flatomise.settled=true});return flatomise}export{newFlatomise};
3
- //# sourceMappingURL=main.mjs.map
package/dist/main.mjs.map DELETED
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/main.ts"],
4
- "sourcesContent": ["/* eslint-disable @typescript-eslint/no-explicit-any */\n\nimport type {} from '@alwatr/type-helper';\n\n/**\n * Flat promise that can be resolved or rejected from outside.\n */\nexport interface Flatomise<T> {\n /**\n * The promise.\n */\n readonly promise: Promise<T>;\n\n /**\n * Resolve the promise.\n */\n readonly resolve: (value: T | PromiseLike<T>) => void;\n\n /**\n * Reject the promise.\n */\n readonly reject: (reason?: any) => void;\n\n /**\n * Whether the promise is settled (resolved or rejected).\n */\n readonly settled: boolean;\n}\n\n/**\n * Create a new Flatomise is a promise that can be resolved or rejected from outside.\n *\n * @returns A new Flatomise.\n *\n * @example\n * ```typescript\n * const flatomise = newFlatomise();\n * flatomise.promise.then(() => {\n * console.log('flatomise resolved');\n * });\n * flatomise.resolve();\n * ```\n */\nexport function newFlatomise<T>(): Flatomise<T> {\n const flatomise: Partial<Mutable<Flatomise<T>>> = {settled: false};\n flatomise.promise = new Promise<T>((resolve, reject) => {\n flatomise.resolve = resolve;\n flatomise.reject = reject;\n });\n flatomise.promise.finally(() => {\n flatomise.settled = true;\n });\n return flatomise as Flatomise<T>;\n}\n"],
5
- "mappings": ";AA2CO,SAAS,cAAgC,CAC9C,MAAM,UAA4C,CAAC,QAAS,KAAK,EACjE,UAAU,QAAU,IAAI,QAAW,CAAC,QAAS,SAAW,CACtD,UAAU,QAAU,QACpB,UAAU,OAAS,MACrB,CAAC,EACD,UAAU,QAAQ,QAAQ,IAAM,CAC9B,UAAU,QAAU,IACtB,CAAC,EACD,OAAO,SACT",
6
- "names": []
7
- }