diff --git a/package.json b/package.json index 40f6cb7..5103df5 100644 --- a/package.json +++ b/package.json @@ -2,9 +2,11 @@ "name": "kojima", "version": "2.0.0", "main": "src/index.js", + "types": "types/index.d.ts", "type": "module", "scripts": { - "test": "node --test" + "test": "node --test", + "emit": "npx -p typescript tsc" }, "repository": { "type": "git", diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..267619e --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,11 @@ +{ + "include": ["./src/*", "./src/**/*"], + "compilerOptions": { + "allowJs": true, + "declaration": true, + "emitDeclarationOnly": true, + "outDir": "types", + "declarationMap": true + } +} + diff --git a/types/alias.d.ts b/types/alias.d.ts new file mode 100644 index 0000000..4abea89 --- /dev/null +++ b/types/alias.d.ts @@ -0,0 +1,2 @@ +export function alias(type: any, aliases: any): void; +//# sourceMappingURL=alias.d.ts.map \ No newline at end of file diff --git a/types/alias.d.ts.map b/types/alias.d.ts.map new file mode 100644 index 0000000..6c39cf5 --- /dev/null +++ b/types/alias.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"alias.d.ts","sourceRoot":"","sources":["../src/alias.js"],"names":[],"mappings":"AAEO,qDAIN"} \ No newline at end of file diff --git a/types/common.d.ts b/types/common.d.ts new file mode 100644 index 0000000..cbefe66 --- /dev/null +++ b/types/common.d.ts @@ -0,0 +1,2 @@ +export function id(value: T): T; +//# sourceMappingURL=common.d.ts.map \ No newline at end of file diff --git a/types/common.d.ts.map b/types/common.d.ts.map new file mode 100644 index 0000000..76208bd --- /dev/null +++ b/types/common.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../src/common.js"],"names":[],"mappings":"AAKO,mBAJM,CAAC,SACH,CAAC,GACC,CAAC,CAEkB"} \ No newline at end of file diff --git a/types/error.d.ts b/types/error.d.ts new file mode 100644 index 0000000..25282d3 --- /dev/null +++ b/types/error.d.ts @@ -0,0 +1,4 @@ +export class UnwrapError extends Error { + constructor(desc: any); +} +//# sourceMappingURL=error.d.ts.map \ No newline at end of file diff --git a/types/error.d.ts.map b/types/error.d.ts.map new file mode 100644 index 0000000..f5121cb --- /dev/null +++ b/types/error.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../src/error.js"],"names":[],"mappings":"AAAA;IAGE,uBAEC;CACF"} \ No newline at end of file diff --git a/types/index.d.ts b/types/index.d.ts new file mode 100644 index 0000000..12029b2 --- /dev/null +++ b/types/index.d.ts @@ -0,0 +1,3 @@ +export * from "./option.js"; +export * from "./result.js"; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/types/index.d.ts.map b/types/index.d.ts.map new file mode 100644 index 0000000..6e08bd5 --- /dev/null +++ b/types/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/option.d.ts b/types/option.d.ts new file mode 100644 index 0000000..c32bb50 --- /dev/null +++ b/types/option.d.ts @@ -0,0 +1,290 @@ +export class Option { + /** + * @template T + * @param {T} value + * @returns {Some} + */ + static some(value: T): Some; + /** @returns {None} */ + static none(): _None; + /** + * @param {(value: T) => Option} fn + * @param {Option} self + * @returns {Option} + */ + static chain(fn: (value: T) => Option, self: Option): Option; + /** + * @param {(value: T) => bool} fn + * @param {Option} self + * @returns {Option} + */ + static filter(predicate: any, self: Option): Option; + /** + * @template V + * @param {(value: T) => V} fn + * @param {Option} self + * @returns {Option} + */ + static map(fn: (value: T) => V, self: Option): Option; + /** + * @param {Option} other + * @param {Option} self + * @returns {Option} + */ + static alt(other: Option, self: Option): Option; + /** + * @param {Option} other + * @param {Option} self + * @returns {Option} + */ + static equals(other: Option, self: Option): Option; + /** + * @param {Option} other + * @param {Option} self + * @returns {Option} + */ + static lte(other: Option, self: Option): Option; +} +/** @template T */ +export class Some extends Option { + /** @param {T} value */ + constructor(value: T); + /** + * @returns {this is Some} + */ + isSome(): this is Some; + /** + * @returns {this is _None} + */ + isNone(): this is _None; + /** + * @param {(value: T) => Option} fn + * @returns {Option} + */ + andThen(fn: (value: T) => Option): Option; + /** + * @param {Option} other + * @returns {Option} + */ + and(other: Option): Option; + /** + * @param {Option} other + * @returns {Option} + */ + or(_other: any): Option; + /** + * @param {() => Option} other + * @returns {Option} + */ + orElse(_fn: any): Option; + /** + * @template T + * @param {(value: T) => bool} predicate + * @returns {Option} + */ + filter(predicate: (value: T_1) => bool): Option; + /** + * @param {Option} other + * @returns {bool} + */ + equals(other: Option): bool; + /** + * @param {Option} other + * @returns {bool} + */ + lte(other: Option): bool; + /** + * @template [V=T] + * @param {(acc: V, value: T) => V} reducer + * @param {V} init + * @returns {V} + */ + reduce(reducer: (acc: V, value: T) => V, init: V): V; + /** + * @returns {Option} + */ + flatten(): Option; + /** + * @template V + * @param {(value: T) => V} fn + * @returns {Option} + */ + map(fn: (value: T) => V): Option; + /** + * @template V + * @param {V} _default + * @param {(value: T) => V} fn + * @returns {V} + */ + mapOr(_default: V, fn: (value: T) => V): V; + /** + * @template V + * @param {() => V} _defaultFn + * @param {(value: T) => V} fn + * @returns {V} + */ + mapOrElse(_defaultFn: () => V, fn: (value: T) => V): V; + /** + * @template E + * @param {E} _err + * @returns {Result} + */ + okOr(_err: E): Result; + /** + * @template E + * @template {() => E} F + * @param {F} _err + * @returns {Result} + */ + okOrElse E>(_err: F): Result; + /** + * @param {(value: T) => void} fn + * @returns {this} + */ + inspect(fn: (value: T) => void): this; + /** + * @returns {T} + * @throws {UnwrapError} + */ + unwrap(): T; + /** + * @param {T} _value + * @returns {T} + */ + unwrapOr(_value: T): T; + /** + * @param {() => T} _fn + * @returns {T} + */ + unwrapOrElse(_fn: () => T): T; + #private; +} +export const None: _None; +declare class _None extends Option { + /** + * @returns {this is Some} + */ + isSome(): this is Some; + /** + * @returns {this is _None} + */ + isNone(): this is _None; + /** + * @template T + * @param {Option} _other + * @returns {Option} + */ + and(_other: Option): Option; + /** + * @template T + * @template {Option} R + * @param {(value: T) => R} fn + * @returns {R} + */ + andThen>(_fn: any): R; + /** + * @template T + * @param {Option} other + * @returns {Option} + */ + or(other: Option): Option; + /** + * @template T + * @param {() => Option} other + * @returns {Option} + */ + orElse(fn: any): Option; + /** + * @template T + * @param {(value: T) => bool} _predicate + * @returns {Option} + */ + filter(_predicate: (value: T) => bool): Option; + /** + * @template T + * @param {Option} other + * @returns {bool} + */ + equals(other: Option): bool; + /** + * @template T + * @param {Option} _other + * @returns {bool} + */ + lte(_other: Option): bool; + /** + * @template T, [V=T] + * @param {(acc: V, value: T) => V} _reducer + * @param {V} init + * @returns {V} + */ + reduce(_reducer: (acc: V, value: T) => V, init: V): V; + /** + * @template T + * @template {Option} R + * @returns {R} + */ + flatten>(): R; + /** + * @template V + * @template {Option} R + * @param {(value: T) => V} fn + * @returns {R} + */ + map>(_fn: any): R; + /** + * @template V + * @param {V} defaultValue + * @param {(value: T) => V} _fn + * @returns {V} + */ + mapOr(defaultValue: V, _fn: (value: T) => V): V; + /** + * @template V + * @param {() => V} defaultFn + * @param {(value: T) => V} _fn + * @returns {V} + */ + mapOrElse(defaultFn: () => V, _fn: (value: T) => V): V; + /** + * @template T, E + * @template {Result} R + * @param {E} err + * @returns {R} + */ + okOr>(err: E): R; + /** + * @template T, E + * @template {Result} R + * @template {() => E} F + * @param {F} err + * @returns {R} + */ + okOrElse, F extends () => E>(err: F): R; + /** + * @template T + * @param {(value: T) => void} _fn + * @returns {this} + */ + inspect(_fn: (value: T) => void): this; + /** + * @template T + * @returns {T} + * @throws {UnwrapError} + */ + unwrap(): T; + /** + * @param {T} value + * @returns {T} + */ + unwrapOr(value: T): T; + /** + * @template T + * @param {() => T} fn + * @returns {T} + */ + unwrapOrElse(fn: () => T): T; +} +import { Result } from './result.js'; +export {}; +//# sourceMappingURL=option.d.ts.map \ No newline at end of file diff --git a/types/option.d.ts.map b/types/option.d.ts.map new file mode 100644 index 0000000..d71cd3e --- /dev/null +++ b/types/option.d.ts.map @@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a,CAAC,aACH,MAAM,CAAC,OACP,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,GACb,CAAC,CAIb;IAED;;;;;OAKG;IACH,KALa,CAAC,EAAE,CAAC,EACW,CAAC,SAAf,MAAM,CAAC,CAAC,EAAE,CAAC,CAAE,OAChB,CAAC,GACC,CAAC,CAIb;IAED;;;;;;OAMG;IACH,SANa,CAAC,EAAE,CAAC,EACW,CAAC,SAAf,MAAM,CAAC,CAAC,EAAE,CAAC,CAAE,EACJ,CAAC,SAAX,MAAO,CAAE,OACX,CAAC,GACC,CAAC,CAIb;IAED;;;;OAIG;IACH,QAJa,CAAC,OACH,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,GAChB,IAAI,CAIhB;IAED;;;;OAIG;IACH,OAJa,CAAC,KACD,CAAC,CAKb;IAED;;;OAGG;IACH,gBAHW,CAAC,GACC,CAAC,CAIb;IAED;;;;OAIG;IACH,aAJa,CAAC,MACH,MAAM,CAAC,GACL,CAAC,CAIb;CAMF;uBAtcsB,aAAa"} \ No newline at end of file diff --git a/types/result.d.ts b/types/result.d.ts new file mode 100644 index 0000000..f24ace9 --- /dev/null +++ b/types/result.d.ts @@ -0,0 +1,251 @@ +export class Result { + /** + * @template T + * @param {T} value + */ + static ok(value: T): Ok; + /** + * @template E + * @param {E} error + */ + static err(error: E): Err; + static chain(fn: any, self: any): any; + static map(fn: any, self: any): any; + static alt(other: any, self: any): any; + static equals(other: any, self: any): any; + static lte(other: any, self: any): any; +} +/** @template T */ +export class Ok extends Result { + /** @param {T} value */ + constructor(value: T); + /** + * @returns {bool} + */ + isOk(): bool; + /** + * @returns {bool} + */ + isErr(): bool; + /** + * @template E + * @template {Result} R + * @param {(value: T) => R} fn + * @returns {R} + */ + andThen>(fn: (value: T) => R): R; + /** + * @template V, E + * @template {Result} R + * @param {(value: T) => V} fn + * @returns {R} + */ + map>(fn: (value: T) => V): R; + /** + * @template V + * @param {V} _defaultValue + * @param {(value: T) => V} fn + * @returns {V} + */ + mapOr(_defaultValue: V, fn: (value: T) => V): V; + /** + * @template E + * @param {Result} other + * @returns {Result} + */ + and(other: Result): Result; + /** + * @template E + * @param {Result} other + * @returns {Result} + */ + or(_other: any): Result; + /** + * @template E, F + * @param {(error: E) => Result} other + * @returns {Result} + */ + orElse(_fn: any): Result; + /** + * @template E + * @param {Result} other + * @returns {bool} + */ + equals(other: Result): bool; + /** + * @template E + * @param {Result} other + * @returns {bool} + */ + lte(other: Result): bool; + /** + * @template [V=T] + * @param {(acc: V, value: T) => V} reducer + * @param {V} init + * @returns {V} + */ + reduce(reducer: (acc: V, value: T) => V, init: V): V; + /** + * @template E + * @template {Result} R + * @returns {R} + */ + flatten>(): R; + /** + * @returns {Option} + */ + ok(): Option; + /** + * @returns {Option} + */ + err(): Option; + /** + * @param {(value: T) => void} fn + * @returns {this} + */ + inspect(fn: (value: T) => void): this; + /** + * @returns {T} + * @throws {UnwrapError} + */ + unwrap(): T; + /** + * @returns {E} + * @throws {UnwrapError} + */ + unwrapErr(): E; + /** + * @param {T} _value + * @returns {T} + */ + unwrapOr(_value: T): T; + /** + * @param {() => T} _fn + * @returns {T} + */ + unwrapOrElse(_fn: () => T): T; + #private; +} +/** @template E */ +export class Err extends Result { + /** @param {E} value */ + constructor(error: any); + /** + * @returns {bool} + */ + isOk(): bool; + /** + * @returns {bool} + */ + isErr(): bool; + /** + * @template T + * @template {Result} R + * @param {(value: T) => R} fn + * @returns {R} + */ + andThen>(_fn: any): R; + /** + * @template V, E + * @template {Result} R + * @param {(value: T) => V} _fn + * @returns {R} + */ + map>(_fn: (value: T) => V): R; + /** + * @template V + * @param {V} defaultValue + * @param {(value: T) => V} _fn + * @returns {V} + */ + mapOr(defaultValue: V, _fn: (value: T) => V): V; + /** + * @template V + * @param {() => V} defaultFn + * @param {(value: T) => V} _fn + * @returns {V} + */ + mapOrElse(defaultFn: () => V, _fn: (value: T) => V): V; + /** + * @template T + * @param {Result} _other + * @returns {Result} + */ + and(_other: Result): Result; + /** + * @template T + * @param {Result} other + * @returns {Result} + */ + or(other: Result): Result; + /** + * @template T, F + * @param {(error: E) => Result} other + * @returns {Result} + */ + orElse(fn: any): Result; + /** + * @template T + * @param {Result} other + * @returns {bool} + */ + equals(other: Result): bool; + /** + * @template T + * @param {Result} other + * @returns {bool} + */ + lte(other: Result): bool; + /** + * @template [V=T] + * @param {(acc: V, value: T) => V} _reducer + * @param {V} init + * @returns {V} + */ + reduce(_reducer: (acc: V, value: T) => V, init: V): V; + /** + * @template T + * @template {Result} R + * @returns {R} + */ + flatten>(): R; + /** + * @returns {Option} + */ + ok(): Option; + /** + * @returns {Option} + */ + err(): Option; + /** + * @template T + * @param {(value: T) => void} _fn + * @returns {this} + */ + inspect(_fn: (value: T) => void): this; + /** + * @template T + * @returns {T} + * @throws {UnwrapError} + */ + unwrap(): T; + /** + * @returns {E} + * @throws {UnwrapError} + */ + unwrapErr(): E; + /** + * @param {T} value + * @returns {T} + */ + unwrapOr(value: T): T; + /** + * @template T + * @param {() => T} fn + * @returns {T} + */ + unwrapOrElse(fn: () => T): T; + #private; +} +import { Option } from './option.js'; +//# sourceMappingURL=result.d.ts.map \ No newline at end of file diff --git a/types/result.d.ts.map b/types/result.d.ts.map new file mode 100644 index 0000000..2d6e75e --- /dev/null +++ b/types/result.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"result.d.ts","sourceRoot":"","sources":["../src/result.js"],"names":[],"mappings":"AAOA;IACE;;;OAGG;IACH,UAHa,CAAC,SACH,CAAC,SAIX;IAED;;;OAGG;IACH,WAHa,CAAC,SACH,CAAC,YAIX;IAGD,sCAEC;IAED,oCAEC;IAED,uCAEC;IAED,0CAEC;IAED,uCAEC;CACF;AAED,kBAAkB;AAClB,gBADc,CAAC;IAKb,uBAAuB;IACvB,mBADY,CAAC,EAIZ;IAED;;OAEG;IACH,QAFa,IAAI,CAIhB;IAED;;OAEG;IACH,SAFa,IAAI,CAIhB;IAED;;;;;OAKG;IACH,QALa,CAAC,EACc,CAAC,S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AAC,SACH,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,GACV,IAAI,CAIhB;IAED;;;;;OAKG;IACH,OALc,CAAC,gBACJ,CAAC,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,KAAK,CAAC,QACvB,CAAC,GACC,CAAC,CAIb;IAED;;;;OAIG;IACH,QAJa,CAAC,EACc,CAAC,SAAf,MAAM,CAAC,CAAC,EAAE,CAAC,CAAE,KACd,CAAC,CAQb;IAED;;OAEG;IACH,MAFa,MAAM,CAAC,CAAC,CAAC,CAIrB;IAED;;OAEG;IACH,OAFa,MAAM,CAAC,CAAC,CAAC,CAIrB;IAED;;;;OAIG;IACH,QAJa,CAAC,OACH,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,GAChB,IAAI,CAIhB;IAED;;;;OAIG;IACH,OAJa,CAAC,KACD,CAAC,CAKb;IAED;;;OAGG;IACH,aAHa,CAAC,CAKb;IAED;;;OAGG;IACH,gBAHW,CAAC,GACC,CAAC,CAIb;IAED;;;;OAIG;IACH,aAJa,CAAC,MACH,MAAM,CAAC,GACL,CAAC,CAIb;;CAMF;uBA7a4B,aAAa"} \ No newline at end of file diff --git a/types/specification/fantasy-land.d.ts b/types/specification/fantasy-land.d.ts new file mode 100644 index 0000000..c2e43c2 --- /dev/null +++ b/types/specification/fantasy-land.d.ts @@ -0,0 +1,3 @@ +export const FantasyLand: Specification; +import { Specification } from './index.js'; +//# sourceMappingURL=fantasy-land.d.ts.map \ No newline at end of file diff --git a/types/specification/fantasy-land.d.ts.map b/types/specification/fantasy-land.d.ts.map new file mode 100644 index 0000000..67a5b7d --- /dev/null +++ b/types/specification/fantasy-land.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"fantasy-land.d.ts","sourceRoot":"","sources":["../../src/specification/fantasy-land.js"],"names":[],"mappings":"AAiBA,wCAAwE;8BAhB1C,YAAY"} \ No newline at end of file diff --git a/types/specification/index.d.ts b/types/specification/index.d.ts new file mode 100644 index 0000000..8e9c6f0 --- /dev/null +++ b/types/specification/index.d.ts @@ -0,0 +1,50 @@ +export class Method { + static from(value: any, options: any): Method; + static asStatic(value: any, options: any): Method; + constructor(name: any, method?: any, { isStatic }?: { + isStatic?: boolean; + }); + name: any; + method: any; + isStatic: boolean; + bind(target: any, impl: any): void; + clone(): Method; + #private; +} +export class Structure { + constructor(name: any, methods?: any[], dependencies?: any[]); + name: any; + methods: any[]; + dependencies: any[]; + hasMethod(method: any, options: any): this; + dependsOn(...algebras: any[]): this; + getMethod(name: any): any; + clone(): Structure; + with(aliases: any): Structure; + #private; +} +export class Specification { + constructor(name: any, structures: any); + name: any; + structures: any; + implementedBy(target: any): Implementor; + getOverrides(structs: any): any; + getAllMethods(): any; + #private; +} +export class Implementor { + constructor(target: any, specification?: any); + target: any; + structures: any[]; + specification: any; + implements(...structures: any[]): this; + specifiedBy(specification: any): this; + with(aliases: any): void; +} +export class AliasMap { + static from(iterable: any): AliasMap; + constructor(schema?: any); + schema: any; +} +export function implementor(target: any, specification?: any): Implementor; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/types/specification/index.d.ts.map b/types/specification/index.d.ts.map new file mode 100644 index 0000000..d03258c --- /dev/null +++ b/types/specification/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/specification/index.js"],"names":[],"mappings":"AAEA;IAWE,8CAMC;IAED,kDAEC;IAhBD;;OAIC;IARD,UAAI;IACJ,YAAM;IACN,kBAAQ;IA4BR,mCAEC;IAED,gBAEC;;CACF;AAED;IAME,8DAOC;IAZD,UAAI;IACJ,eAAO;IACP,oBAAY;IAYZ,2CASC;IAED,oCAGC;IAED,0BAEC;IAED,mBAKC;IAED,8BAiBC;;CACF;AAmDD;IAKE,wCAiBC;IArBD,UAAI;IACJ,gBAAU;IAsBV,wCAEC;IAED,gCAEC;IAED,qBAEC;;CACF;AAED;IAKE,8CAGC;IAPD,YAAM;IACN,kBAAe;IACf,mBAAa;IAOb,uCAsBC;IAED,sCAGC;IAED,yBAwCC;CACF;AAED;IAOE,qCAUC;IAdD,0BAEC;IAJD,YAAM;CAiBP;AAEM,2EAA4F"} \ No newline at end of file diff --git a/types/specification/static-land.d.ts b/types/specification/static-land.d.ts new file mode 100644 index 0000000..a672f3d --- /dev/null +++ b/types/specification/static-land.d.ts @@ -0,0 +1 @@ +//# sourceMappingURL=static-land.d.ts.map \ No newline at end of file diff --git a/types/specification/static-land.d.ts.map b/types/specification/static-land.d.ts.map new file mode 100644 index 0000000..744cf30 --- /dev/null +++ b/types/specification/static-land.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"static-land.d.ts","sourceRoot":"","sources":["../../src/specification/static-land.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/specification/structures.d.ts b/types/specification/structures.d.ts new file mode 100644 index 0000000..82b80ff --- /dev/null +++ b/types/specification/structures.d.ts @@ -0,0 +1,26 @@ +export const Setoid: Structure; +export const Ord: Structure; +export const Semigroupoid: Structure; +export const Category: Structure; +export const Semigroup: Structure; +export const Monoid: Structure; +export const Group: Structure; +export const Foldable: Structure; +export const Functor: Structure; +export const Traversable: Structure; +export const Profunctor: Structure; +export const Alt: Structure; +export const Plus: Structure; +export const Apply: Structure; +export const Applicative: Structure; +export const Chain: Structure; +export const ChainRec: Structure; +export const Alternative: Structure; +export const Monad: Structure; +export const Bifunctor: Structure; +export const Extend: Structure; +export const Comonad: Structure; +export const Contravariant: Structure; +export const Filterable: Structure; +import { Structure } from './index.js'; +//# sourceMappingURL=structures.d.ts.map \ No newline at end of file diff --git a/types/specification/structures.d.ts.map b/types/specification/structures.d.ts.map new file mode 100644 index 0000000..0b5af31 --- /dev/null +++ b/types/specification/structures.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"structures.d.ts","sourceRoot":"","sources":["../../src/specification/structures.js"],"names":[],"mappings":"AAIA,+BAC8B;AAE9B,4BAEoB;AAEpB,qCAC+B;AAE/B,iCAE0B;AAE1B,kCAC8B;AAE9B,+BAEuB;AAEvB,8BAEoB;AAEpB,iCAC8B;AAE9B,gCAC2B;AAE3B,oCAE+B;AAE/B,mCAEqB;AAErB,4BAEqB;AAErB,6BAEiB;AAEjB,8BAEqB;AAErB,oCAEmB;AAEnB,8BAEmB;AAEnB,iCAEmB;AAEnB,oCAC+B;AAE/B,8BACgC;AAEhC,kCAEqB;AAErB,+BAEqB;AAErB,gCAEoB;AAEpB,sCACiC;AAEjC,mCAC8B;0BAzFI,YAAY"} \ No newline at end of file diff --git a/types/utils.d.ts b/types/utils.d.ts new file mode 100644 index 0000000..0598285 --- /dev/null +++ b/types/utils.d.ts @@ -0,0 +1,3 @@ +export function path(path: any, obj: any): boolean; +export function zip(...xs: any[]): any; +//# sourceMappingURL=utils.d.ts.map \ No newline at end of file diff --git a/types/utils.d.ts.map b/types/utils.d.ts.map new file mode 100644 index 0000000..6dbc757 --- /dev/null +++ b/types/utils.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.js"],"names":[],"mappings":"AAAO,mDAcN;AAEM,uCAKN"} \ No newline at end of file