inferred-types 0.49.6 → 0.49.8

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.
@@ -28,6 +28,7 @@ export * from "./isNumber";
28
28
  export * from "./isNothing";
29
29
  export * from "./isScalar";
30
30
  export * from "./isTypeToken";
31
+ export * from "./isThenable";
31
32
  export * from "./isErrorCondition";
32
33
  export * from "./isSymbol";
33
34
  export * from "./hasKeys";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/runtime/type-guards/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAA;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAA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ACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAE1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC"}
@@ -28,6 +28,7 @@ export * from "./isNumber.js";
28
28
  export * from "./isNothing.js";
29
29
  export * from "./isScalar.js";
30
30
  export * from "./isTypeToken.js";
31
+ export * from "./isThenable.js";
31
32
  export * from "./isErrorCondition.js";
32
33
  export * from "./isSymbol.js";
33
34
  export * from "./hasKeys.js";
@@ -0,0 +1,6 @@
1
+ import { Thenable } from "../../types/index";
2
+ /**
3
+ * type guard which checks whether passed in `val` is a `Thenable` object
4
+ */
5
+ export declare const isThenable: (val: unknown) => val is Thenable;
6
+ //# sourceMappingURL=isThenable.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isThenable.d.ts","sourceRoot":"","sources":["../../../src/runtime/type-guards/isThenable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,0BAAwB;AAE3C;;EAEE;AACF,eAAO,MAAM,UAAU,QAAS,OAAO,KAAG,GAAG,IAAI,QAEhD,CAAA"}
@@ -0,0 +1,7 @@
1
+ import { isObject } from "./isObject.js";
2
+ /**
3
+ * type guard which checks whether passed in `val` is a `Thenable` object
4
+ */
5
+ export const isThenable = (val) => {
6
+ return isObject(val) && "then" in val && "catch" in val && typeof val.then === "function";
7
+ };
@@ -0,0 +1,12 @@
1
+ import { Dictionary } from "./Dictionary";
2
+ /**
3
+ * **Thenable**`<T>`
4
+ *
5
+ * An object which resembles a promise and is guarenteed to provide a `.then` and `.catch`
6
+ * callback hook.
7
+ */
8
+ export type Thenable<T = unknown> = Dictionary & {
9
+ then: (cb: T) => void;
10
+ catch: (err: string) => void;
11
+ };
12
+ //# sourceMappingURL=Thenable.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Thenable.d.ts","sourceRoot":"","sources":["../../../src/types/base-types/Thenable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C;;;;;GAKG;AACH,MAAM,MAAM,QAAQ,CAAC,CAAC,GAAG,OAAO,IAAI,UAAU,GAAG;IAC/C,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,KAAK,IAAI,CAAC;IACtB,KAAK,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;CAC9B,CAAA"}
@@ -0,0 +1 @@
1
+ export {};
@@ -10,6 +10,7 @@ export * from "./Scalar";
10
10
  export * from "./ScalarNotSymbol";
11
11
  export * from "./Container";
12
12
  export * from "./Tuple";
13
+ export * from "./Thenable";
13
14
  export * from "./NumericSign";
14
15
  export * from "./Digital";
15
16
  export * from "./Indexable";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/base-types/index.ts"],"names":[],"mappings":"AACA,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,C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AAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC"}
@@ -10,6 +10,7 @@ export * from "./Scalar.js";
10
10
  export * from "./ScalarNotSymbol.js";
11
11
  export * from "./Container.js";
12
12
  export * from "./Tuple.js";
13
+ export * from "./Thenable.js";
13
14
  export * from "./NumericSign.js";
14
15
  export * from "./Digital.js";
15
16
  export * from "./Indexable.js";