inferred-types 0.49.6 → 0.49.7

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,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,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAE7B,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/base-types/index.ts"],"names":[],"mappings":"AACA,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAE7B,cAAc,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";