@xsai/shared 0.5.0-beta.1 → 0.5.0-beta.3

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.
Files changed (2) hide show
  1. package/dist/index.js +9 -11
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -86,17 +86,15 @@ const clean = (obj) => Object.fromEntries(
86
86
 
87
87
  class DelayedPromise {
88
88
  get promise() {
89
- if (this._promise == null) {
90
- this._promise = new Promise((resolve, reject) => {
91
- if (this.status.type === "resolved") {
92
- resolve(this.status.value);
93
- } else if (this.status.type === "rejected") {
94
- reject(this.status.error);
95
- }
96
- this._resolve = resolve;
97
- this._reject = reject;
98
- });
99
- }
89
+ this._promise ??= new Promise((resolve, reject) => {
90
+ if (this.status.type === "resolved") {
91
+ resolve(this.status.value);
92
+ } else if (this.status.type === "rejected") {
93
+ reject(this.status.error);
94
+ }
95
+ this._resolve = resolve;
96
+ this._reject = reject;
97
+ });
100
98
  return this._promise;
101
99
  }
102
100
  _promise;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@xsai/shared",
3
3
  "type": "module",
4
- "version": "0.5.0-beta.1",
4
+ "version": "0.5.0-beta.3",
5
5
  "description": "extra-small AI SDK.",
6
6
  "author": "Moeru AI",
7
7
  "license": "MIT",
@@ -29,7 +29,7 @@
29
29
  "dist"
30
30
  ],
31
31
  "devDependencies": {
32
- "@moeru/std": "^0.1.0-beta.17"
32
+ "@moeru/std": "^0.1.0-beta.18"
33
33
  },
34
34
  "scripts": {
35
35
  "build": "pkgroll"