@webreflection/utils 0.1.1 → 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.
@@ -15,7 +15,7 @@ jobs:
15
15
  node-version: [22]
16
16
 
17
17
  steps:
18
- - uses: actions/checkout@v4
18
+ - uses: actions/checkout@v5
19
19
  - name: Use Node.js ${{ matrix.node-version }}
20
20
  uses: actions/setup-node@v4
21
21
  with:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webreflection/utils",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  "./shared-array-buffer": "./src/shared-array-buffer.js",
@@ -5,8 +5,15 @@
5
5
  * @typedef {{promise: Promise<T>, resolve: (value: T) => void, reject: (reason?: any) => void}} Resolvers
6
6
  */
7
7
 
8
+ // fallback for Android WebView
8
9
  //@ts-ignore
9
- const withResolvers = Promise.withResolvers;
10
+ const withResolvers = Promise.withResolvers || function withResolvers() {
11
+ var a, b, c = new this((resolve, reject) => {
12
+ a = resolve;
13
+ b = reject;
14
+ });
15
+ return {resolve: a, reject: b, promise: c};
16
+ };
10
17
 
11
18
  /**
12
19
  * @template T
@@ -1,4 +1,6 @@
1
- import withResolvers from '../src/with-resolvers.js';
1
+ Promise.withResolvers = undefined;
2
+
3
+ const { default: withResolvers } = await import('../src/with-resolvers.js');
2
4
 
3
5
  const { promise, resolve, reject } = withResolvers();
4
6