@yaasl/utils 0.11.0 → 0.12.1
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/@types/index.d.ts +5 -5
- package/dist/cjs/index.js +5 -5
- package/dist/cjs/{Thenable.js → thenable.js} +3 -3
- package/dist/esm/index.js +5 -5
- package/dist/esm/{Thenable.js → thenable.js} +1 -1
- package/package.json +1 -1
- /package/dist/@types/{getWindow.d.ts → get-window.d.ts} +0 -0
- /package/dist/@types/{isPromiseLike.d.ts → is-promise-like.d.ts} +0 -0
- /package/dist/@types/{Thenable.d.ts → thenable.d.ts} +0 -0
- /package/dist/@types/{toVoid.d.ts → to-void.d.ts} +0 -0
- /package/dist/@types/{utilTypes.d.ts → util-types.d.ts} +0 -0
- /package/dist/cjs/{getWindow.js → get-window.js} +0 -0
- /package/dist/cjs/{isPromiseLike.js → is-promise-like.js} +0 -0
- /package/dist/cjs/{toVoid.js → to-void.js} +0 -0
- /package/dist/cjs/{utilTypes.js → util-types.js} +0 -0
- /package/dist/esm/{getWindow.js → get-window.js} +0 -0
- /package/dist/esm/{isPromiseLike.js → is-promise-like.js} +0 -0
- /package/dist/esm/{toVoid.js → to-void.js} +0 -0
- /package/dist/esm/{utilTypes.js → util-types.js} +0 -0
package/dist/@types/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export * from "./
|
|
2
|
-
export * from "./
|
|
1
|
+
export * from "./get-window";
|
|
2
|
+
export * from "./is-promise-like";
|
|
3
3
|
export * from "./log";
|
|
4
4
|
export * from "./sleep";
|
|
5
|
-
export * from "./
|
|
6
|
-
export * from "./
|
|
5
|
+
export * from "./thenable";
|
|
6
|
+
export * from "./to-void";
|
|
7
7
|
export * from "./updater";
|
|
8
|
-
export * from "./
|
|
8
|
+
export * from "./util-types";
|
package/dist/cjs/index.js
CHANGED
|
@@ -14,11 +14,11 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./
|
|
18
|
-
__exportStar(require("./
|
|
17
|
+
__exportStar(require("./get-window"), exports);
|
|
18
|
+
__exportStar(require("./is-promise-like"), exports);
|
|
19
19
|
__exportStar(require("./log"), exports);
|
|
20
20
|
__exportStar(require("./sleep"), exports);
|
|
21
|
-
__exportStar(require("./
|
|
22
|
-
__exportStar(require("./
|
|
21
|
+
__exportStar(require("./thenable"), exports);
|
|
22
|
+
__exportStar(require("./to-void"), exports);
|
|
23
23
|
__exportStar(require("./updater"), exports);
|
|
24
|
-
__exportStar(require("./
|
|
24
|
+
__exportStar(require("./util-types"), exports);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Thenable = void 0;
|
|
4
|
-
const
|
|
4
|
+
const is_promise_like_1 = require("./is-promise-like");
|
|
5
5
|
class Thenable {
|
|
6
6
|
constructor(value) {
|
|
7
7
|
this.value = value;
|
|
@@ -9,13 +9,13 @@ class Thenable {
|
|
|
9
9
|
then(onfulfilled, onrejected) {
|
|
10
10
|
try {
|
|
11
11
|
const result = !onfulfilled ? this.value : onfulfilled(this.value);
|
|
12
|
-
return (0,
|
|
12
|
+
return (0, is_promise_like_1.isPromiseLike)(result) ? result : new Thenable(result);
|
|
13
13
|
}
|
|
14
14
|
catch (error) {
|
|
15
15
|
if (!onrejected)
|
|
16
16
|
throw error;
|
|
17
17
|
const result = onrejected(error);
|
|
18
|
-
return (0,
|
|
18
|
+
return (0, is_promise_like_1.isPromiseLike)(result) ? result : new Thenable(result);
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
static isThenable(item) {
|
package/dist/esm/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export * from "./
|
|
2
|
-
export * from "./
|
|
1
|
+
export * from "./get-window";
|
|
2
|
+
export * from "./is-promise-like";
|
|
3
3
|
export * from "./log";
|
|
4
4
|
export * from "./sleep";
|
|
5
|
-
export * from "./
|
|
6
|
-
export * from "./
|
|
5
|
+
export * from "./thenable";
|
|
6
|
+
export * from "./to-void";
|
|
7
7
|
export * from "./updater";
|
|
8
|
-
export * from "./
|
|
8
|
+
export * from "./util-types";
|
package/package.json
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|