@voidagency/skills 1.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.
@@ -0,0 +1,54 @@
1
+ import { t as __commonJSMin } from "../../rolldown-runtime.mjs";
2
+ //#region ../../node_modules/@kwsites/promise-deferred/dist/index.js
3
+ var require_dist = /* @__PURE__ */ __commonJSMin(((exports) => {
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.createDeferred = exports.deferred = void 0;
6
+ /**
7
+ * Creates a new `DeferredPromise`
8
+ *
9
+ * ```typescript
10
+ import {deferred} from '@kwsites/promise-deferred`;
11
+ ```
12
+ */
13
+ function deferred() {
14
+ let done;
15
+ let fail;
16
+ let status = "pending";
17
+ return {
18
+ promise: new Promise((_done, _fail) => {
19
+ done = _done;
20
+ fail = _fail;
21
+ }),
22
+ done(result) {
23
+ if (status === "pending") {
24
+ status = "resolved";
25
+ done(result);
26
+ }
27
+ },
28
+ fail(error) {
29
+ if (status === "pending") {
30
+ status = "rejected";
31
+ fail(error);
32
+ }
33
+ },
34
+ get fulfilled() {
35
+ return status !== "pending";
36
+ },
37
+ get status() {
38
+ return status;
39
+ }
40
+ };
41
+ }
42
+ exports.deferred = deferred;
43
+ /**
44
+ * Alias of the exported `deferred` function, to help consumers wanting to use `deferred` as the
45
+ * local variable name rather than the factory import name, without needing to rename on import.
46
+ *
47
+ * ```typescript
48
+ import {createDeferred} from '@kwsites/promise-deferred`;
49
+ ```
50
+ */
51
+ exports.createDeferred = deferred;
52
+ }));
53
+ //#endregion
54
+ export { require_dist as t };