@alwatr/flatomise 5.5.28 → 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.28",
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.1",
9
- "@alwatr/prettier-config": "6.0.2",
10
- "@alwatr/tsconfig-base": "6.0.4",
11
- "@alwatr/type-helper": "7.0.1",
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"
@@ -56,21 +54,21 @@
56
54
  "directory": "packages/flatomise"
57
55
  },
58
56
  "scripts": {
59
- "b": "yarn run build",
60
- "build": "yarn run build:ts && yarn run build:es",
61
- "build:es": "nano-build --preset=module",
57
+ "b": "bun run build",
58
+ "build": "bun run build:ts && bun run build:es",
59
+ "build:es": "nano-build --preset=module src/main.ts",
62
60
  "build:ts": "tsc --build",
63
- "c": "yarn run clean",
64
- "cb": "yarn run clean && yarn run build",
61
+ "c": "bun run clean",
62
+ "cb": "bun run clean && bun run build",
65
63
  "clean": "rm -rfv dist *.tsbuildinfo",
66
- "d": "yarn run build:es && yarn node --enable-source-maps --trace-warnings",
67
- "w": "yarn run watch",
68
- "watch": "yarn run watch:ts & yarn run watch:es",
69
- "watch:es": "yarn run build:es --watch",
70
- "watch:ts": "yarn run build:ts --watch --preserveWatchOutput"
64
+ "d": "bun run build:es && bun",
65
+ "w": "bun run watch",
66
+ "watch": "bun run watch:ts & bun run watch:es",
67
+ "watch:es": "bun run build:es --watch",
68
+ "watch:ts": "bun run build:ts --watch --preserveWatchOutput"
71
69
  },
72
70
  "sideEffects": false,
73
71
  "type": "module",
74
72
  "types": "./dist/main.d.ts",
75
- "gitHead": "f9f9ba54b319ce8ccc6968059b222e89f4b5d149"
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,395 +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.28](https://github.com/Alwatr/nanolib/compare/@alwatr/flatomise@5.5.27...@alwatr/flatomise@5.5.28) (2026-02-18)
7
-
8
- **Note:** Version bump only for package @alwatr/flatomise
9
-
10
- ## [5.5.27](https://github.com/Alwatr/nanolib/compare/@alwatr/flatomise@5.5.26...@alwatr/flatomise@5.5.27) (2025-12-23)
11
-
12
- **Note:** Version bump only for package @alwatr/flatomise
13
-
14
- ## [5.5.26](https://github.com/Alwatr/nanolib/compare/@alwatr/flatomise@5.5.25...@alwatr/flatomise@5.5.26) (2025-12-13)
15
-
16
- **Note:** Version bump only for package @alwatr/flatomise
17
-
18
- ## [5.5.25](https://github.com/Alwatr/nanolib/compare/@alwatr/flatomise@5.5.24...@alwatr/flatomise@5.5.25) (2025-12-10)
19
-
20
- **Note:** Version bump only for package @alwatr/flatomise
21
-
22
- ## [5.5.24](https://github.com/Alwatr/nanolib/compare/@alwatr/flatomise@5.5.23...@alwatr/flatomise@5.5.24) (2025-11-18)
23
-
24
- ### 🐛 Bug Fixes
25
-
26
- * add type imports from @alwatr/nano-build and @alwatr/type-helper across multiple packages ([5ab7f15](https://github.com/Alwatr/nanolib/commit/5ab7f159ba57788bf8df40fa96a3027f589d5a77))
27
-
28
- ### 🔨 Code Refactoring
29
-
30
- * remove unnecessary type declarations from tsconfig.json files ([89bcc7d](https://github.com/Alwatr/nanolib/commit/89bcc7db839807110b80f8ba34414ea9734d9c75))
31
-
32
- ## [5.5.23](https://github.com/Alwatr/nanolib/compare/@alwatr/flatomise@5.5.22...@alwatr/flatomise@5.5.23) (2025-11-15)
33
-
34
- **Note:** Version bump only for package @alwatr/flatomise
35
-
36
- ## [5.5.22](https://github.com/Alwatr/nanolib/compare/@alwatr/flatomise@5.5.21...@alwatr/flatomise@5.5.22) (2025-11-15)
37
-
38
- **Note:** Version bump only for package @alwatr/flatomise
39
-
40
- ## [5.5.21](https://github.com/Alwatr/nanolib/compare/@alwatr/flatomise@5.5.20...@alwatr/flatomise@5.5.21) (2025-11-04)
41
-
42
- **Note:** Version bump only for package @alwatr/flatomise
43
-
44
- ## [5.5.20](https://github.com/Alwatr/nanolib/compare/@alwatr/flatomise@5.5.19...@alwatr/flatomise@5.5.20) (2025-10-06)
45
-
46
- ### 🔗 Dependencies update
47
-
48
- * bump the npm-dependencies group with 4 updates ([9825815](https://github.com/Alwatr/nanolib/commit/982581552bbb4b97dca52af5e93a80937f0c3109))
49
-
50
- ## [5.5.19](https://github.com/Alwatr/nanolib/compare/@alwatr/flatomise@5.5.18...@alwatr/flatomise@5.5.19) (2025-09-27)
51
-
52
- ### 🧹 Miscellaneous Chores
53
-
54
- * exclude test files from package distribution ([86f4f2f](https://github.com/Alwatr/nanolib/commit/86f4f2f5985845c5cf3a3a9398de7b2f98ce53e7))
55
-
56
- ## [5.5.18](https://github.com/Alwatr/nanolib/compare/@alwatr/flatomise@5.5.17...@alwatr/flatomise@5.5.18) (2025-09-22)
57
-
58
- **Note:** Version bump only for package @alwatr/flatomise
59
-
60
- ## [5.5.17](https://github.com/Alwatr/nanolib/compare/@alwatr/flatomise@5.5.16...@alwatr/flatomise@5.5.17) (2025-09-22)
61
-
62
- **Note:** Version bump only for package @alwatr/flatomise
63
-
64
- ## [5.5.16](https://github.com/Alwatr/nanolib/compare/@alwatr/flatomise@5.5.15...@alwatr/flatomise@5.5.16) (2025-09-21)
65
-
66
- **Note:** Version bump only for package @alwatr/flatomise
67
-
68
- ## [5.5.15](https://github.com/Alwatr/nanolib/compare/@alwatr/flatomise@5.5.14...@alwatr/flatomise@5.5.15) (2025-09-20)
69
-
70
- ### 🐛 Bug Fixes
71
-
72
- * add sideEffects property to package.json files for better tree-shaking ([c7b9e74](https://github.com/Alwatr/nanolib/commit/c7b9e74e1920c8e35b438742de61883ca62da58c))
73
- * add sideEffects property to package.json files for better tree-shaking ([e8402c4](https://github.com/Alwatr/nanolib/commit/e8402c481a14a1f807a37aaa862a936713d26176))
74
-
75
- ### 🧹 Miscellaneous Chores
76
-
77
- * remove duplicate sideEffects property from multiple package.json files ([b123f86](https://github.com/Alwatr/nanolib/commit/b123f86be81481de2314aae9bb2eeb629743d24c))
78
-
79
- ## [5.5.14](https://github.com/Alwatr/nanolib/compare/@alwatr/flatomise@5.5.13...@alwatr/flatomise@5.5.14) (2025-09-19)
80
-
81
- **Note:** Version bump only for package @alwatr/flatomise
82
-
83
- ## [5.5.13](https://github.com/Alwatr/nanolib/compare/@alwatr/flatomise@5.5.12...@alwatr/flatomise@5.5.13) (2025-09-15)
84
-
85
- **Note:** Version bump only for package @alwatr/flatomise
86
-
87
- ## [5.5.12](https://github.com/Alwatr/nanolib/compare/@alwatr/flatomise@5.5.11...@alwatr/flatomise@5.5.12) (2025-09-13)
88
-
89
- **Note:** Version bump only for package @alwatr/flatomise
90
-
91
- ## [5.5.11](https://github.com/Alwatr/nanolib/compare/@alwatr/flatomise@5.5.10...@alwatr/flatomise@5.5.11) (2025-09-13)
92
-
93
- ### 🧹 Miscellaneous Chores
94
-
95
- * remove package-tracer dependency and related code from fetch package ([96fe4e9](https://github.com/Alwatr/nanolib/commit/96fe4e9552a205f218ceed187c55e4e904a07089))
96
-
97
- ## [5.5.10](https://github.com/Alwatr/nanolib/compare/@alwatr/flatomise@5.5.9...@alwatr/flatomise@5.5.10) (2025-09-09)
98
-
99
- ### 🧹 Miscellaneous Chores
100
-
101
- * remove trailing newlines from contributing sections in README files ([e8ab1bc](https://github.com/Alwatr/nanolib/commit/e8ab1bc43e0addea5ccd4c897c2cec597cb9e15f))
102
-
103
- ## [5.5.9](https://github.com/Alwatr/nanolib/compare/@alwatr/flatomise@5.5.8...@alwatr/flatomise@5.5.9) (2025-09-06)
104
-
105
- **Note:** Version bump only for package @alwatr/flatomise
106
-
107
- ## [5.5.8](https://github.com/Alwatr/nanolib/compare/@alwatr/flatomise@5.5.7...@alwatr/flatomise@5.5.8) (2025-09-05)
108
-
109
- **Note:** Version bump only for package @alwatr/flatomise
110
-
111
- ## [5.5.7](https://github.com/Alwatr/nanolib/compare/@alwatr/flatomise@5.5.6...@alwatr/flatomise@5.5.7) (2025-09-01)
112
-
113
- **Note:** Version bump only for package @alwatr/flatomise
114
-
115
- ## [5.5.6](https://github.com/Alwatr/nanolib/compare/@alwatr/flatomise@5.5.5...@alwatr/flatomise@5.5.6) (2025-08-23)
116
-
117
- **Note:** Version bump only for package @alwatr/flatomise
118
-
119
- ## [5.5.5](https://github.com/Alwatr/nanolib/compare/@alwatr/flatomise@5.5.3...@alwatr/flatomise@5.5.5) (2025-08-23)
120
-
121
- ### 🐛 Bug Fixes
122
-
123
- * update license from AGPL-3.0-only to MPL-2.0 ([d20968e](https://github.com/Alwatr/nanolib/commit/d20968e60cc89b1dcdf9b96507178da6ed562f55))
124
- * update package versions in multiple package.json files ([7638b1c](https://github.com/Alwatr/nanolib/commit/7638b1cafee2b4e0f97db7a89ac9fba6384b9b10))
125
-
126
- ### 🔨 Code Refactoring
127
-
128
- * 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))
129
-
130
- ### 🧹 Miscellaneous Chores
131
-
132
- * reformat all package.json files ([ceda45d](https://github.com/Alwatr/nanolib/commit/ceda45de186667790474f729cb4b161a5148ce19))
133
-
134
- ### 🔗 Dependencies update
135
-
136
- * update TypeScript and Jest versions across all packages to improve compatibility and performance ([31baf36](https://github.com/Alwatr/nanolib/commit/31baf366101e92e27db66a21c849fb101f19be47))
137
-
138
- ## [5.5.4](https://github.com/Alwatr/nanolib/compare/@alwatr/flatomise@5.5.3...@alwatr/flatomise@5.5.4) (2025-08-23)
139
-
140
- ### Code Refactoring
141
-
142
- * 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
143
-
144
- ## <small>5.5.3 (2025-04-15)</small>
145
-
146
- **Note:** Version bump only for package @alwatr/flatomise
147
-
148
- ## [5.5.2](https://github.com/Alwatr/nanolib/compare/@alwatr/flatomise@5.5.1...@alwatr/flatomise@5.5.2) (2025-04-01)
149
-
150
- **Note:** Version bump only for package @alwatr/flatomise
151
-
152
- ## [5.5.1](https://github.com/Alwatr/nanolib/compare/@alwatr/flatomise@5.5.0...@alwatr/flatomise@5.5.1) (2025-03-18)
153
-
154
- **Note:** Version bump only for package @alwatr/flatomise
155
-
156
- ## [5.5.0](https://github.com/Alwatr/nanolib/compare/@alwatr/flatomise@5.4.0...@alwatr/flatomise@5.5.0) (2025-03-06)
157
-
158
- ### Miscellaneous Chores
159
-
160
- * update username casing in changelog entries ([9722ac9](https://github.com/Alwatr/nanolib/commit/9722ac9a078438a4e8ebfa5826ea70e0e3a52ca6)) by @
161
-
162
- ### Dependencies update
163
-
164
- * bump the development-dependencies group across 1 directory with 11 updates ([720c395](https://github.com/Alwatr/nanolib/commit/720c3954da55c929fe8fb16957121f4c51fb7f0c)) by @dependabot[bot]
165
-
166
- ## [5.4.0](https://github.com/Alwatr/nanolib/compare/@alwatr/flatomise@1.2.8...@alwatr/flatomise@5.4.0) (2025-02-18)
167
-
168
- ### Features
169
-
170
- * enhance Flatomise interface with promise settlement tracking ([692e7ff](https://github.com/Alwatr/nanolib/commit/692e7ff5ddbc2efef16aaa2ecbeff90e55d63e2a)) by @
171
-
172
- ### Code Refactoring
173
-
174
- * make Flatomise properties readonly for immutability ([14dd30f](https://github.com/Alwatr/nanolib/commit/14dd30f6615d6e4cddf125803267fc9a817f59ac)) by @
175
-
176
- ### Dependencies update
177
-
178
- * **flatomise:** add @alwatr/type-helper to dependencies and TypeScript types ([7a489ab](https://github.com/Alwatr/nanolib/commit/7a489abd39aac2c1189e6697025f82af196e2fe9)) by @
179
-
180
- ## 5.3.0 (2025-02-03)
181
-
182
- ### Miscellaneous Chores
183
-
184
- * edit README ([3860b3d](https://github.com/Alwatr/nanolib/commit/3860b3df48ab82dc479d5236c2e8579df614aabf)) by @
185
-
186
- ### Dependencies update
187
-
188
- * bump the development-dependencies group across 1 directory with 11 updates ([cb79d07](https://github.com/Alwatr/nanolib/commit/cb79d072a57c79e1c01abff1a293d6757bb65350)) by @
189
- * 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 @
190
-
191
- ## 5.0.0 (2024-11-02)
192
-
193
- ### ⚠ BREAKING CHANGES
194
-
195
- * 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.
196
-
197
- ### Code Refactoring
198
-
199
- * use the same version as @alwatr/nanolib ([60eb860](https://github.com/Alwatr/nanolib/commit/60eb860a0e33dfffe2d1d95e63ce54c60876be06)) by @
200
-
201
- ## [5.3.0](https://github.com/Alwatr/nanolib/compare/v5.2.1...v5.3.0) (2025-02-03)
202
-
203
- ### Miscellaneous Chores
204
-
205
- * edit README ([3860b3d](https://github.com/Alwatr/nanolib/commit/3860b3df48ab82dc479d5236c2e8579df614aabf)) by @ArmanAsadian
206
-
207
- ### Dependencies update
208
-
209
- * bump the development-dependencies group across 1 directory with 11 updates ([cb79d07](https://github.com/Alwatr/nanolib/commit/cb79d072a57c79e1c01abff1a293d6757bb65350)) by @dependabot[bot]
210
- * 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
211
-
212
- ## 5.0.0 (2024-11-02)
213
-
214
- ### ⚠ BREAKING CHANGES
215
-
216
- * 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.
217
-
218
- ### Features
219
-
220
- * **flatomise:** A utility for creating promises that can be externally resolved or rejected. ([1bc4478](https://github.com/Alwatr/nanolib/commit/1bc4478327f156b5e45650590aea013590443723)) by @
221
- * **flatomise:** generic type ([3193b43](https://github.com/Alwatr/nanolib/commit/3193b4378681ec7c840d6d7806dad041a1db7573)) by @
222
- * use `package-tracer` ([cc3c5f9](https://github.com/Alwatr/nanolib/commit/cc3c5f9c1a3d03f0d81b46835665f16a0426fd0d)) by @
223
-
224
- ### Bug Fixes
225
-
226
- * all dependeny topology ([1c17f34](https://github.com/Alwatr/nanolib/commit/1c17f349adf3e98e2a80ab2da4f0f81028dc9c5f)) by @
227
-
228
- ### Code Refactoring
229
-
230
- * prevent side-effects ([01e00e1](https://github.com/Alwatr/nanolib/commit/01e00e191385cc92b28677df0c01a085916ae677)) by @
231
- * use the same version as @alwatr/nanolib ([60eb860](https://github.com/Alwatr/nanolib/commit/60eb860a0e33dfffe2d1d95e63ce54c60876be06)) by @
232
-
233
- ### Miscellaneous Chores
234
-
235
- * **deps-dev:** bump the development-dependencies group with 3 updates ([0e0ec0f](https://github.com/Alwatr/nanolib/commit/0e0ec0f7c66c849727563cabe0e88606aee49035)) by @
236
- * **deps:** update ([1a45030](https://github.com/Alwatr/nanolib/commit/1a450305440b710a300787d4ca24b1ed8c6a39d7)) by @
237
- * **deps:** update ([8e70dff](https://github.com/Alwatr/nanolib/commit/8e70dffb1e751496ef2e72d6cffd685f1fea44e3)) by @
238
- * **deps:** update ([f0b60d2](https://github.com/Alwatr/nanolib/commit/f0b60d24c9fae6190940baf95167a1175360d4b3)) by @
239
- * **flatomise:** change the license to AGPL-3.0 ([bc9d81b](https://github.com/Alwatr/nanolib/commit/bc9d81b7a3f62113559be6dbd002cf4f2e301583)) by @
240
- * include LICENSE and LEGAL files to publish ([09f366f](https://github.com/Alwatr/nanolib/commit/09f366f680bfa9fb26acb2cd1ccbc68c5a9e9ad8)) by @
241
- * rename logger env ([38443ad](https://github.com/Alwatr/nanolib/commit/38443ade4677e857b5ebd4be417f5f2eb1818c87)) by @
242
- * Update build and lint scripts ([392d0b7](https://github.com/Alwatr/nanolib/commit/392d0b71f446bce336b0256119a80f07aff794ba)) by @
243
- * Update debug command in package.json ([be8403d](https://github.com/Alwatr/nanolib/commit/be8403dec754f2117259bb915b110ea386596401)) by @
244
- * Update package.json exports for [@alwatr](https://github.com/alwatr) packages ([dacb362](https://github.com/Alwatr/nanolib/commit/dacb362b145e3c51b4aba00ff643687a3fac11d2)) by @
245
-
246
- ### Dependencies update
247
-
248
- * bump @types/node ([3d80fed](https://github.com/Alwatr/nanolib/commit/3d80fedaf720af792feb060c2f81c737ebb84e11)) by @
249
- * bump the development-dependencies group across 1 directory with 10 updates ([9ed98ff](https://github.com/Alwatr/nanolib/commit/9ed98ffd0668d5a36e255c82edab3af53bffda8f)) by @
250
- * bump the development-dependencies group with 10 updates ([fa4aaf0](https://github.com/Alwatr/nanolib/commit/fa4aaf04c907ecae06aa14000ce35216170c15ad)) by @
251
- * bump the development-dependencies group with 2 updates ([be5d6c2](https://github.com/Alwatr/nanolib/commit/be5d6c2d86b937f32cebc6848aaff85af07055dd)) by @
252
- * upd ([451d025](https://github.com/Alwatr/nanolib/commit/451d0255ba96ed55f897a6f44f62cf4e6d2b12be)) by @
253
- * update ([c36ed50](https://github.com/Alwatr/nanolib/commit/c36ed50f68da2f5608ccd96119963a16cfacb4ce)) by @
254
- * update all ([53342f6](https://github.com/Alwatr/nanolib/commit/53342f67a8a013127f073540bc11929f1813c05c)) by @
255
- * update all dependencies ([1e0c30e](https://github.com/Alwatr/nanolib/commit/1e0c30e6a3a8e19deb5185814e24ab6c08dca573)) by @
256
- * update all dependencies ([0e908b4](https://github.com/Alwatr/nanolib/commit/0e908b476a6b976ec2447f864c8cafcbb8a0f099)) by @
257
- * upgrade ([6dbd300](https://github.com/Alwatr/nanolib/commit/6dbd300642c9bcc9e7d0b281e244bf1b06eb1c38)) by @
258
-
259
- ## [1.2.8](https://github.com/Alwatr/nanolib/compare/@alwatr/flatomise@1.2.7...@alwatr/flatomise@1.2.8) (2024-11-02)
260
-
261
- **Note:** Version bump only for package @alwatr/flatomise
262
-
263
- ## [1.2.7](https://github.com/Alwatr/nanolib/compare/@alwatr/flatomise@1.2.6...@alwatr/flatomise@1.2.7) (2024-10-25)
264
-
265
- **Note:** Version bump only for package @alwatr/flatomise
266
-
267
- ## [1.2.6](https://github.com/Alwatr/nanolib/compare/@alwatr/flatomise@1.2.5...@alwatr/flatomise@1.2.6) (2024-10-12)
268
-
269
- **Note:** Version bump only for package @alwatr/flatomise
270
-
271
- ## [1.2.5](https://github.com/Alwatr/nanolib/compare/@alwatr/flatomise@1.2.4...@alwatr/flatomise@1.2.5) (2024-10-11)
272
-
273
- ### Code Refactoring
274
-
275
- - prevent side-effects ([01e00e1](https://github.com/Alwatr/nanolib/commit/01e00e191385cc92b28677df0c01a085916ae677)) by @mohammadhonarvar
276
-
277
- ## [1.2.4](https://github.com/Alwatr/nanolib/compare/@alwatr/flatomise@1.2.3...@alwatr/flatomise@1.2.4) (2024-10-11)
278
-
279
- ### Miscellaneous Chores
280
-
281
- - include LICENSE and LEGAL files to publish ([09f366f](https://github.com/Alwatr/nanolib/commit/09f366f680bfa9fb26acb2cd1ccbc68c5a9e9ad8)) by @alimd
282
-
283
- ## [1.2.3](https://github.com/Alwatr/nanolib/compare/@alwatr/flatomise@1.2.2...@alwatr/flatomise@1.2.3) (2024-10-11)
284
-
285
- **Note:** Version bump only for package @alwatr/flatomise
286
-
287
- ## [1.2.2](https://github.com/Alwatr/nanolib/compare/@alwatr/flatomise@1.2.1...@alwatr/flatomise@1.2.2) (2024-10-10)
288
-
289
- ### Dependencies update
290
-
291
- - bump the development-dependencies group with 10 updates ([fa4aaf0](https://github.com/Alwatr/nanolib/commit/fa4aaf04c907ecae06aa14000ce35216170c15ad)) by @dependabot[bot]
292
-
293
- ## [1.2.1](https://github.com/Alwatr/nanolib/compare/@alwatr/flatomise@1.2.0...@alwatr/flatomise@1.2.1) (2024-10-08)
294
-
295
- **Note:** Version bump only for package @alwatr/flatomise
296
-
297
- ## [1.2.0](https://github.com/Alwatr/nanolib/compare/@alwatr/flatomise@1.1.12...@alwatr/flatomise@1.2.0) (2024-09-29)
298
-
299
- ### Features
300
-
301
- - use `package-tracer` ([cc3c5f9](https://github.com/Alwatr/nanolib/commit/cc3c5f9c1a3d03f0d81b46835665f16a0426fd0d)) by @mohammadhonarvar
302
-
303
- ### Bug Fixes
304
-
305
- - all dependeny topology ([1c17f34](https://github.com/Alwatr/nanolib/commit/1c17f349adf3e98e2a80ab2da4f0f81028dc9c5f)) by @mohammadhonarvar
306
-
307
- ### Miscellaneous Chores
308
-
309
- - **flatomise:** change the license to AGPL-3.0 ([bc9d81b](https://github.com/Alwatr/nanolib/commit/bc9d81b7a3f62113559be6dbd002cf4f2e301583)) by @ArmanAsadian
310
- - Update build and lint scripts ([392d0b7](https://github.com/Alwatr/nanolib/commit/392d0b71f446bce336b0256119a80f07aff794ba)) by @alimd
311
-
312
- ### Dependencies update
313
-
314
- - bump @types/node ([3d80fed](https://github.com/Alwatr/nanolib/commit/3d80fedaf720af792feb060c2f81c737ebb84e11)) by @dependabot[bot]
315
-
316
- ## [1.1.12](https://github.com/Alwatr/nanolib/compare/@alwatr/flatomise@1.1.11...@alwatr/flatomise@1.1.12) (2024-09-21)
317
-
318
- **Note:** Version bump only for package @alwatr/flatomise
319
-
320
- ## [1.1.11](https://github.com/Alwatr/nanolib/compare/@alwatr/flatomise@1.1.10...@alwatr/flatomise@1.1.11) (2024-09-15)
321
-
322
- ### Dependencies update
323
-
324
- - bump the development-dependencies group across 1 directory with 10 updates ([9ed98ff](https://github.com/Alwatr/nanolib/commit/9ed98ffd0668d5a36e255c82edab3af53bffda8f)) by @dependabot[bot]
325
- - update ([c36ed50](https://github.com/Alwatr/nanolib/commit/c36ed50f68da2f5608ccd96119963a16cfacb4ce)) by @alimd
326
-
327
- ## [1.1.10](https://github.com/Alwatr/nanolib/compare/@alwatr/flatomise@1.1.9...@alwatr/flatomise@1.1.10) (2024-08-31)
328
-
329
- ### Miscellaneous Chores
330
-
331
- - Update package.json exports for [@alwatr](https://github.com/alwatr) packages ([dacb362](https://github.com/Alwatr/nanolib/commit/dacb362b145e3c51b4aba00ff643687a3fac11d2)) by @
332
-
333
- ## [1.1.9](https://github.com/Alwatr/nanolib/compare/@alwatr/flatomise@1.1.8...@alwatr/flatomise@1.1.9) (2024-08-31)
334
-
335
- ### Dependencies update
336
-
337
- - update all dependencies ([1e0c30e](https://github.com/Alwatr/nanolib/commit/1e0c30e6a3a8e19deb5185814e24ab6c08dca573)) by @alimd
338
-
339
- ## [1.1.8](https://github.com/Alwatr/nanolib/compare/@alwatr/flatomise@1.1.7...@alwatr/flatomise@1.1.8) (2024-07-04)
340
-
341
- ### Dependencies update
342
-
343
- - update all dependencies ([0e908b4](https://github.com/Alwatr/nanolib/commit/0e908b476a6b976ec2447f864c8cafcbb8a0f099)) by @
344
-
345
- ## [1.1.7](https://github.com/Alwatr/nanolib/compare/@alwatr/flatomise@1.1.6...@alwatr/flatomise@1.1.7) (2024-05-12)
346
-
347
- ### Dependencies update
348
-
349
- - upgrade ([6dbd300](https://github.com/Alwatr/nanolib/commit/6dbd300642c9bcc9e7d0b281e244bf1b06eb1c38)) by @alimd
350
-
351
- ## [1.1.6](https://github.com/Alwatr/nanolib/compare/@alwatr/flatomise@1.1.5...@alwatr/flatomise@1.1.6) (2024-04-25)
352
-
353
- **Note:** Version bump only for package @alwatr/flatomise
354
-
355
- ## [1.1.5](https://github.com/Alwatr/nanolib/compare/@alwatr/flatomise@1.1.4...@alwatr/flatomise@1.1.5) (2024-03-28)
356
-
357
- **Note:** Version bump only for package @alwatr/flatomise
358
-
359
- ## [1.1.4](https://github.com/Alwatr/nanolib/compare/@alwatr/flatomise@1.1.3...@alwatr/flatomise@1.1.4) (2024-01-31)
360
-
361
- ### Miscellaneous Chores
362
-
363
- - **deps:** update ([1a45030](https://github.com/Alwatr/nanolib/commit/1a450305440b710a300787d4ca24b1ed8c6a39d7)) by @alimd
364
-
365
- ## [1.1.3](https://github.com/Alwatr/nanolib/compare/@alwatr/flatomise@1.1.2...@alwatr/flatomise@1.1.3) (2024-01-24)
366
-
367
- **Note:** Version bump only for package @alwatr/flatomise
368
-
369
- ## [1.1.2](https://github.com/Alwatr/nanolib/compare/@alwatr/flatomise@1.1.1...@alwatr/flatomise@1.1.2) (2024-01-20)
370
-
371
- **Note:** Version bump only for package @alwatr/flatomise
372
-
373
- ## [1.1.1](https://github.com/Alwatr/nanolib/compare/@alwatr/flatomise@1.1.0...@alwatr/flatomise@1.1.1) (2024-01-16)
374
-
375
- **Note:** Version bump only for package @alwatr/flatomise
376
-
377
- # [1.1.0](https://github.com/Alwatr/nanolib/compare/@alwatr/flatomise@1.0.2...@alwatr/flatomise@1.1.0) (2024-01-08)
378
-
379
- ### Features
380
-
381
- - **flatomise:** generic type ([3193b43](https://github.com/Alwatr/nanolib/commit/3193b4378681ec7c840d6d7806dad041a1db7573)) by @alimd
382
-
383
- ## [1.0.2](https://github.com/Alwatr/nanolib/compare/@alwatr/flatomise@1.0.1...@alwatr/flatomise@1.0.2) (2024-01-08)
384
-
385
- **Note:** Version bump only for package @alwatr/flatomise
386
-
387
- ## [1.0.1](https://github.com/Alwatr/nanolib/compare/@alwatr/flatomise@1.0.0...@alwatr/flatomise@1.0.1) (2024-01-03)
388
-
389
- **Note:** Version bump only for package @alwatr/flatomise
390
-
391
- # 1.0.0 (2024-01-03)
392
-
393
- ### Features
394
-
395
- - **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,4 +0,0 @@
1
- /** 📦 @alwatr/flatomise v5.5.28 */
2
- __dev_mode__: console.debug("📦 @alwatr/flatomise v5.5.28");
3
- "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});
4
- //# 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,4 +0,0 @@
1
- /** 📦 @alwatr/flatomise v5.5.28 */
2
- __dev_mode__: console.debug("📦 @alwatr/flatomise v5.5.28");
3
- 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};
4
- //# 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
- }