From bf2022b56e3e118f63590896fee35e98d6ae8f12 Mon Sep 17 00:00:00 2001 From: Matei Adriel Date: Mon, 23 Dec 2019 16:06:26 +0200 Subject: [PATCH] typescript(option): chore: WHY WASNT LIB GITIGNORED Signed-off-by: prescientmoon --- typescript/option/lib/index.amd.d.ts | 36 ----------------------- typescript/option/lib/index.amd.d.ts.map | 1 - typescript/option/lib/index.amd.js | 2 -- typescript/option/lib/index.amd.js.map | 1 - typescript/option/lib/index.cjs.d.ts | 36 ----------------------- typescript/option/lib/index.cjs.d.ts.map | 1 - typescript/option/lib/index.cjs.js | 2 -- typescript/option/lib/index.cjs.js.map | 1 - typescript/option/lib/index.d.ts | 34 --------------------- typescript/option/lib/index.esm.d.ts | 34 --------------------- typescript/option/lib/index.esm.js | 2 -- typescript/option/lib/index.esm.js.map | 1 - typescript/option/lib/index.js | 2 -- typescript/option/lib/index.js.map | 1 - typescript/option/lib/tsdoc-metadata.json | 11 ------- 15 files changed, 165 deletions(-) delete mode 100644 typescript/option/lib/index.amd.d.ts delete mode 100644 typescript/option/lib/index.amd.d.ts.map delete mode 100644 typescript/option/lib/index.amd.js delete mode 100644 typescript/option/lib/index.amd.js.map delete mode 100644 typescript/option/lib/index.cjs.d.ts delete mode 100644 typescript/option/lib/index.cjs.d.ts.map delete mode 100644 typescript/option/lib/index.cjs.js delete mode 100644 typescript/option/lib/index.cjs.js.map delete mode 100644 typescript/option/lib/index.d.ts delete mode 100644 typescript/option/lib/index.esm.d.ts delete mode 100644 typescript/option/lib/index.esm.js delete mode 100644 typescript/option/lib/index.esm.js.map delete mode 100644 typescript/option/lib/index.js delete mode 100644 typescript/option/lib/index.js.map delete mode 100644 typescript/option/lib/tsdoc-metadata.json diff --git a/typescript/option/lib/index.amd.d.ts b/typescript/option/lib/index.amd.d.ts deleted file mode 100644 index cccb910..0000000 --- a/typescript/option/lib/index.amd.d.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { Brand } from "utility-types"; -declare const none: unique symbol; -declare const some: unique symbol; -declare type None = Brand; -declare type Some = Brand; -declare type Option = Some | None; -declare const None: Brand; -declare const Some: (value: T) => Option; -declare const isNone: (option: Option) => boolean; -declare const isSome: (option: Option) => boolean; -declare type Mapper = (v: T) => U; -declare type Binder = (v: T) => Option; -declare type Predicate = (v: T) => boolean; -declare type Folder = (s: U, v: T) => U; -declare type BackFolder = (v: T, s: U) => U; -declare type Nullable = T | null; -declare const bind: (binder: Binder, option: Option) => Option; -declare const bindAsync: (binder: Mapper>>, option: Option) => Promise>; -declare const count: (option: Option) => number; -declare const exists: (predicate: Predicate, option: Option) => boolean; -declare const filter: (predicate: Predicate, option: Option) => Option; -declare const flat: (option: Option>) => Option; -declare const fold: (folder: Folder, initial: U, option: Option) => U; -declare const foldback: (folder: BackFolder, option: Option, initial: U) => U; -declare const forall: (predicate: Predicate, option: Option) => boolean; -declare const fromArray: (value: [T] | []) => Option; -declare const fromNullable: (value: Nullable) => Option; -declare const get: (option: Option) => T; -declare const iter: (mapper: Mapper, option: Option) => void; -declare const map: (mapper: Mapper, option: Option) => Option; -declare const mapAsync: (mapper: Mapper>, option: Option) => Promise>; -declare const toArray: (option: Option) => T[]; -declare const toNullable: (option: Option) => T | null; -declare const withDefault: (_default: T, option: Option) => T; -export { bind, bindAsync, count, exists, filter, flat, fold, foldback, forall, fromArray, fromNullable, get, isNone, isSome, iter, map, mapAsync, toArray, toNullable, withDefault, Option, None, Some }; -//# sourceMappingURL=index.amd.d.ts.map \ No newline at end of file diff --git a/typescript/option/lib/index.amd.d.ts.map b/typescript/option/lib/index.amd.d.ts.map deleted file mode 100644 index 4f43cc4..0000000 --- a/typescript/option/lib/index.amd.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.amd.d.ts","sourceRoot":"","sources":["../src/internals.ts","../src/types.ts","../src/helpers/isNone.ts","../src/helpers/isSome.ts","../src/internalTypes.ts","../src/helpers/match.ts","../src/helpers/bind.ts","../src/helpers/bindAsync.ts","../src/helpers/count.ts","../src/helpers/exists.ts","../src/helpers/filter.ts","../src/helpers/flat.ts","../src/helpers/fold.ts","../src/helpers/foldback.ts","../src/helpers/forall.ts","../src/helpers/fromArray.ts","../src/helpers/fromNullable.ts","../src/helpers/get.ts","../src/helpers/iter.ts","../src/helpers/map.ts","../src/helpers/mapAsync.ts","../src/helpers/toArray.ts","../src/helpers/toNullable.ts","../src/helpers/withDefault.ts","../src/helpers/external.ts","../src/index.ts"],"names":[],"mappings":"AAAA,QAAO,MAAM,QAAQ,gBAAiB,CAAA;AAEtC,QAAO,MAAM,IAAI,eAAiB,CAAAAAIA,OAAO,CAAC,MAAM,IAAI,EAAE,OAAO,MAAM,CAAA;AAEjC,aAAK,IAAI,GAAG,KAAK,CAAC,IAAI,EAAE,OAAO,IAAI,CAAC,CAAA;AACpC,aAAK,IAAI,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,EAAE,OAAO,IAAI,CAAC,CAAA;AAEpC,aAAY,MAAM,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,CAAA;AAEtC,QAAO,MAAM,IAAI,0BAGR,CAAA;AACT,QAAO,MAAM,IAAI,4BAAyC,CAAAAAGA,QAAO,MAAM,MAAM,mCAAoD,CAAAAAGA,QAAO,MAAM,MAAM,mCAA4C,CAAAAAEA,aAAY,MAAM,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAA;AACtC,aAAY,MAAM,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,KAAK,MAAM,CAAC,CAAC,CAAC,CAAA;AAC9C,aAAY,SAAS,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,KAAK,OAAO,CAAA;AAC5C,aAAY,MAAM,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,CAAA;AAC5C,aAAY,UAAU,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,CAAA;AAChD,aAAY,QAAQ,CAAC,CAAC,IAAI,CAAC,GAAG,IAAI,CAAAAAIA,QAAO,MAAM,KAAK,qEAUjB,CAAAAAIA,QAAO,MAAM,IAAI,8DAKhB,CAAAAAIA,QAAO,MAAM,SAAS,wFAKrB,CAAAAAGA,QAAO,MAAM,KAAK,kCAAmD,CAAAAAIA,QAAO,MAAM,MAAM,4DAElB,CAAAAAIA,QAAO,MAAM,MAAM,8DAElB,CAAAAAIA,QAAO,MAAM,IAAI,6CAEhB,CAAAAAIA,QAAO,MAAM,IAAI,kEAMhB,CAAAAAIA,QAAO,MAAM,QAAQ,sEAMpB,CAAAAAIA,QAAO,MAAM,MAAM,4DAElB,CAAAAAEA,QAAO,MAAM,SAAS,mCAErB,CAAAAAGA,QAAO,MAAM,YAAY,sCAExB,CAAAAAGA,QAAO,MAAM,GAAG,6BAMf,CAAAAAIA,QAAO,MAAM,IAAI,yDAIhB,CAAAAAIA,QAAO,MAAM,GAAG,8DAKf,CAAAAAIA,QAAO,MAAM,QAAQ,gFASpB,CAAAAAGA,QAAO,MAAM,OAAO,+BAEnB,CAAAAAIA,QAAO,MAAM,UAAU,oCAEtB,CAAAAAIA,QAAO,MAAM,WAAW,0CAEvB,CAAA"} \ No newline at end of file diff --git a/typescript/option/lib/index.amd.js b/typescript/option/lib/index.amd.js deleted file mode 100644 index 2cf8aa0..0000000 --- a/typescript/option/lib/index.amd.js +++ /dev/null @@ -1,2 +0,0 @@ -define(["exports"],(function(e){"use strict";const o=e=>e,r=Symbol("none"),n={__brand:r,toString:()=>"None"},t=o,l=e=>e.__brand===r,i=e=>!l(e),a=(e,o,r)=>i(r)?e(r):o,s=(e,o)=>a(e,n,o);e.None=n,e.Some=t,e.bind=s,e.bindAsync=(e,o)=>a(e,Promise.resolve(n),o),e.count=e=>Number(i(e)),e.exists=(e,o)=>a(e,!1,o),e.filter=(e,o)=>a(o=>e(o)?t(o):n,n,o),e.flat=e=>s(o,e),e.fold=(e,o,r)=>a(r=>e(o,r),o,r),e.foldback=(e,o,r)=>a(o=>e(o,r),r,o),e.forall=(e,o)=>a(e,!0,o),e.fromArray=e=>void 0===e[0]?n:t(e[0]),e.fromNullable=e=>null===e?n:t(e),e.get=e=>{if(i(e))return e;throw new Error("Cannot get value of None")},e.isNone=l,e.isSome=i,e.iter=(e,o)=>{i(o)&&e(o)},e.map=(e,o)=>a(o=>t(e(o)),n,o),e.mapAsync=(e,o)=>a(o=>e(o).then(t),Promise.resolve(n),o),e.toArray=e=>a(e=>[e],[],e),e.toNullable=e=>a(o,null,e),e.withDefault=(e,r)=>a(o,e,r),Object.defineProperty(e,"__esModule",{value:!0})})); -//# sourceMappingURL=index.amd.js.map diff --git a/typescript/option/lib/index.amd.js.map b/typescript/option/lib/index.amd.js.map deleted file mode 100644 index 5aa1aed..0000000 --- a/typescript/option/lib/index.amd.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.amd.js","sources":["../src/internals.ts","../src/types.ts","../src/helpers/isNone.ts","../src/helpers/isSome.ts","../src/helpers/match.ts","../src/helpers/bind.ts","../src/helpers/bindAsync.ts","../src/helpers/count.ts","../src/helpers/exists.ts","../src/helpers/filter.ts","../src/helpers/flat.ts","../src/helpers/fold.ts","../src/helpers/foldback.ts","../src/helpers/forall.ts","../src/helpers/fromArray.ts","../src/helpers/fromNullable.ts","../src/helpers/get.ts","../src/helpers/iter.ts","../src/helpers/map.ts","../src/helpers/mapAsync.ts","../src/helpers/toArray.ts","../src/helpers/toNullable.ts","../src/helpers/withDefault.ts"],"sourcesContent":["export const identity = (v: T) => v\n\nexport const none = Symbol('none')\n","import { none, identity } from './internals'\nimport { Brand } from 'utility-types'\n\n// This is never actually used outside of typing so we can just declare it\ndeclare const some: unique symbol\n\ntype None = Brand\ntype Some = Brand\n\nexport type Option = Some | None\n\nexport const None = {\n __brand: none,\n toString: () => 'None'\n} as None\nexport const Some = identity as (value: T) => Option\n","import { Option } from '../types'\nimport { none } from '../internals'\n\nexport const isNone = (option: Option) => option.__brand === none\n","import { Option } from '../types'\nimport { isNone } from './isNone'\n\nexport const isSome = (option: Option) => !isNone(option)\n","import { Option } from '../types'\nimport { Mapper } from '../internalTypes'\nimport { isSome } from './isSome'\n\nexport const match = (\n caseSome: Mapper,\n _default: U,\n option: Option\n) => {\n if (isSome(option)) {\n return caseSome(option as T)\n }\n\n return _default\n}\n","import { Binder } from '../internalTypes'\nimport { Option, None } from '../types'\nimport { match } from './match'\n\nexport const bind = (\n binder: Binder,\n option: Option\n): Option => {\n return match(binder, None, option)\n}\n","import { Mapper } from '../internalTypes'\nimport { Option, None } from '../types'\nimport { match } from './match'\n\nexport const bindAsync = (\n binder: Mapper>>,\n option: Option\n): Promise> => {\n return match(binder, Promise.resolve(None), option)\n}\n","import { Option } from '../types'\nimport { isSome } from './isSome'\n\nexport const count = (option: Option) => Number(isSome(option))\n","import { match } from './match'\nimport { Predicate } from '../internalTypes'\nimport { Option } from '../types'\n\nexport const exists = (predicate: Predicate, option: Option) => {\n return match(predicate, false, option)\n}\n","import { match } from './match'\nimport { Some, None, Option } from '../types'\nimport { Predicate } from '../internalTypes'\n\nexport const filter = (predicate: Predicate, option: Option) => {\n return match(v => (predicate(v) ? Some(v) : None), None, option)\n}\n","import { bind } from './bind'\nimport { identity } from '../internals'\nimport { Option } from '../types'\n\nexport const flat = (option: Option>): Option => {\n return bind(identity, option)\n}\n","import { match } from './match'\nimport { Option } from '../types'\nimport { Folder } from '../internalTypes'\n\nexport const fold = (\n folder: Folder,\n initial: U,\n option: Option\n) => {\n return match(v => folder(initial, v), initial, option)\n}\n","import { match } from './match'\nimport { Option } from '../types'\nimport { BackFolder } from '../internalTypes'\n\nexport const foldback = (\n folder: BackFolder,\n option: Option,\n initial: U\n) => {\n return match(v => folder(v, initial), initial, option)\n}\n","import { match } from './match'\nimport { Predicate } from '../internalTypes'\nimport { Option } from '../types'\n\nexport const forall = (predicate: Predicate, option: Option) => {\n return match(predicate, true, option)\n}\n","import { None, Some, Option } from '../types'\n\nexport const fromArray = (value: [T] | []): Option => {\n return value[0] === undefined ? None : Some(value[0])\n}\n","import { Nullable } from '../internalTypes'\nimport { Some, None, Option } from '../types'\n\nexport const fromNullable = (value: Nullable): Option => {\n return value === null ? None : Some(value)\n}\n","import { Option } from '../types'\nimport { isSome } from './isSome'\n\nexport const get = (option: Option): T => {\n if (isSome(option)) {\n return option as T\n }\n\n throw new Error(`Cannot get value of None`)\n}\n","import { Mapper } from '../internalTypes'\nimport { Option } from '../types'\nimport { isSome } from './isSome'\n\nexport const iter = (mapper: Mapper, option: Option) => {\n if (isSome(option)) {\n mapper(option as T)\n }\n}\n","import { match } from './match'\nimport { Mapper } from '../internalTypes'\nimport { Option, Some, None } from '../types'\n\nexport const map = (\n mapper: Mapper,\n option: Option\n): Option => {\n return match(v => Some(mapper(v)), None, option)\n}\n","import { Option, None, Some } from '../types'\nimport { Mapper } from '../internalTypes'\nimport { match } from './match'\n\nexport const mapAsync = (\n mapper: Mapper>,\n option: Option\n) => {\n return match(\n value => mapper(value).then(Some),\n Promise.resolve(None),\n option\n )\n}\n","import { match } from './match'\nimport { Option } from '../types'\n\nexport const toArray = (option: Option) => {\n return match(v => [v], [], option)\n}\n","import { match } from './match'\nimport { identity } from '../internals'\nimport { Option } from '../types'\n\nexport const toNullable = (option: Option) => {\n return match(identity, null, option)\n}\n","import { match } from './match'\nimport { identity } from '../internals'\nimport { Option } from '../types'\n\nexport const withDefault = (_default: T, option: Option) => {\n return match(identity, _default, option)\n}\n"],"names":["identity","v","none","Symbol","None","__brand","toString","Some","isNone","option","isSome","match","caseSome","_default","bind","binder","Promise","resolve","Number","predicate","folder","initial","value","undefined","Error","mapper","then"],"mappings":"6CAAO,MAAMA,EAAeC,GAASA,EAExBC,EAAOC,OAAO,QCSdC,EAAO,CAChBC,QAASH,EACTI,SAAU,IAAM,QAEPC,EAAOP,ECZPQ,EAAaC,GAAsBA,EAAOJ,UAAYH,ECAtDQ,EAAaD,IAAuBD,EAAOC,GCC3CE,EAAQ,CACjBC,EACAC,EACAJ,IAEIC,EAAOD,GACAG,EAASH,GAGbI,ECTEC,EAAO,CAChBC,EACAN,IAEOE,EAAMI,EAAQX,EAAMK,0CCJN,CACrBM,EACAN,IAEOE,EAAMI,EAAQC,QAAQC,QAAQb,GAAOK,WCLvBA,GAAsBS,OAAOR,EAAOD,aCCvC,CAAIU,EAAyBV,IACxCE,EAAMQ,GAAW,EAAOV,YCDb,CAAIU,EAAyBV,IACxCE,EAAMV,GAAMkB,EAAUlB,GAAKM,EAAKN,GAAKG,EAAOA,EAAMK,UCDrCA,GACbK,EAAKd,EAAUS,UCDN,CAChBW,EACAC,EACAZ,IAEOE,EAAMV,GAAKmB,EAAOC,EAASpB,GAAIoB,EAASZ,cCL3B,CACpBW,EACAX,EACAY,IAEOV,EAAMV,GAAKmB,EAAOnB,EAAGoB,GAAUA,EAASZ,YCL7B,CAAIU,EAAyBV,IACxCE,EAAMQ,GAAW,EAAMV,eCHLa,QACLC,IAAbD,EAAM,GAAmBlB,EAAOG,EAAKe,EAAM,mBCAtBA,GACX,OAAVA,EAAiBlB,EAAOG,EAAKe,SCDjBb,IACnB,GAAIC,EAAOD,GACP,OAAOA,EAGX,MAAM,IAAIe,MAAM,0DCJA,CAAIC,EAAyBhB,KACzCC,EAAOD,IACPgB,EAAOhB,UCFI,CACfgB,EACAhB,IAEOE,EAAMV,GAAKM,EAAKkB,EAAOxB,IAAKG,EAAMK,cCJrB,CACpBgB,EACAhB,IAEOE,EACHW,GAASG,EAAOH,GAAOI,KAAKnB,GAC5BS,QAAQC,QAAQb,GAChBK,aCRmBA,GAChBE,EAAMV,GAAK,CAACA,GAAI,GAAIQ,gBCADA,GACnBE,EAAMX,EAAU,KAAMS,iBCDN,CAAII,EAAaJ,IACjCE,EAAMX,EAAUa,EAAUJ"} \ No newline at end of file diff --git a/typescript/option/lib/index.cjs.d.ts b/typescript/option/lib/index.cjs.d.ts deleted file mode 100644 index c401bc5..0000000 --- a/typescript/option/lib/index.cjs.d.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { Brand } from "utility-types"; -declare const none: unique symbol; -declare const some: unique symbol; -declare type None = Brand; -declare type Some = Brand; -declare type Option = Some | None; -declare const None: Brand; -declare const Some: (value: T) => Option; -declare const isNone: (option: Option) => boolean; -declare const isSome: (option: Option) => boolean; -declare type Mapper = (v: T) => U; -declare type Binder = (v: T) => Option; -declare type Predicate = (v: T) => boolean; -declare type Folder = (s: U, v: T) => U; -declare type BackFolder = (v: T, s: U) => U; -declare type Nullable = T | null; -declare const bind: (binder: Binder, option: Option) => Option; -declare const bindAsync: (binder: Mapper>>, option: Option) => Promise>; -declare const count: (option: Option) => number; -declare const exists: (predicate: Predicate, option: Option) => boolean; -declare const filter: (predicate: Predicate, option: Option) => Option; -declare const flat: (option: Option>) => Option; -declare const fold: (folder: Folder, initial: U, option: Option) => U; -declare const foldback: (folder: BackFolder, option: Option, initial: U) => U; -declare const forall: (predicate: Predicate, option: Option) => boolean; -declare const fromArray: (value: [T] | []) => Option; -declare const fromNullable: (value: Nullable) => Option; -declare const get: (option: Option) => T; -declare const iter: (mapper: Mapper, option: Option) => void; -declare const map: (mapper: Mapper, option: Option) => Option; -declare const mapAsync: (mapper: Mapper>, option: Option) => Promise>; -declare const toArray: (option: Option) => T[]; -declare const toNullable: (option: Option) => T | null; -declare const withDefault: (_default: T, option: Option) => T; -export { bind, bindAsync, count, exists, filter, flat, fold, foldback, forall, fromArray, fromNullable, get, isNone, isSome, iter, map, mapAsync, toArray, toNullable, withDefault, Option, None, Some }; -//# sourceMappingURL=index.cjs.d.ts.map \ No newline at end of file diff --git a/typescript/option/lib/index.cjs.d.ts.map b/typescript/option/lib/index.cjs.d.ts.map deleted file mode 100644 index f11f2c2..0000000 --- a/typescript/option/lib/index.cjs.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.cjs.d.ts","sourceRoot":"","sources":["../src/internals.ts","../src/types.ts","../src/helpers/isNone.ts","../src/helpers/isSome.ts","../src/internalTypes.ts","../src/helpers/match.ts","../src/helpers/bind.ts","../src/helpers/bindAsync.ts","../src/helpers/count.ts","../src/helpers/exists.ts","../src/helpers/filter.ts","../src/helpers/flat.ts","../src/helpers/fold.ts","../src/helpers/foldback.ts","../src/helpers/forall.ts","../src/helpers/fromArray.ts","../src/helpers/fromNullable.ts","../src/helpers/get.ts","../src/helpers/iter.ts","../src/helpers/map.ts","../src/helpers/mapAsync.ts","../src/helpers/toArray.ts","../src/helpers/toNullable.ts","../src/helpers/withDefault.ts","../src/helpers/external.ts","../src/index.ts"],"names":[],"mappings":"AAAA,QAAO,MAAM,QAAQ,gBAAiB,CAAA;AAEtC,QAAO,MAAM,IAAI,eAAiB,CAAAAAIA,OAAO,CAAC,MAAM,IAAI,EAAE,OAAO,MAAM,CAAA;AAEjC,aAAK,IAAI,GAAG,KAAK,CAAC,IAAI,EAAE,OAAO,IAAI,CAAC,CAAA;AACpC,aAAK,IAAI,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,EAAE,OAAO,IAAI,CAAC,CAAA;AAEpC,aAAY,MAAM,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,CAAA;AAEtC,QAAO,MAAM,IAAI,0BAGR,CAAA;AACT,QAAO,MAAM,IAAI,4BAAyC,CAAAAAGA,QAAO,MAAM,MAAM,mCAAoD,CAAAAAGA,QAAO,MAAM,MAAM,mCAA4C,CAAAAAEA,aAAY,MAAM,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAA;AACtC,aAAY,MAAM,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,KAAK,MAAM,CAAC,CAAC,CAAC,CAAA;AAC9C,aAAY,SAAS,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,KAAK,OAAO,CAAA;AAC5C,aAAY,MAAM,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,CAAA;AAC5C,aAAY,UAAU,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,CAAA;AAChD,aAAY,QAAQ,CAAC,CAAC,IAAI,CAAC,GAAG,IAAI,CAAAAAIA,QAAO,MAAM,KAAK,qEAUjB,CAAAAAIA,QAAO,MAAM,IAAI,8DAKhB,CAAAAAIA,QAAO,MAAM,SAAS,wFAKrB,CAAAAAGA,QAAO,MAAM,KAAK,kCAAmD,CAAAAAIA,QAAO,MAAM,MAAM,4DAElB,CAAAAAIA,QAAO,MAAM,MAAM,8DAElB,CAAAAAIA,QAAO,MAAM,IAAI,6CAEhB,CAAAAAIA,QAAO,MAAM,IAAI,kEAMhB,CAAAAAIA,QAAO,MAAM,QAAQ,sEAMpB,CAAAAAIA,QAAO,MAAM,MAAM,4DAElB,CAAAAAEA,QAAO,MAAM,SAAS,mCAErB,CAAAAAGA,QAAO,MAAM,YAAY,sCAExB,CAAAAAGA,QAAO,MAAM,GAAG,6BAMf,CAAAAAIA,QAAO,MAAM,IAAI,yDAIhB,CAAAAAIA,QAAO,MAAM,GAAG,8DAKf,CAAAAAIA,QAAO,MAAM,QAAQ,gFASpB,CAAAAAGA,QAAO,MAAM,OAAO,+BAEnB,CAAAAAIA,QAAO,MAAM,UAAU,oCAEtB,CAAAAAIA,QAAO,MAAM,WAAW,0CAEvB,CAAA"} \ No newline at end of file diff --git a/typescript/option/lib/index.cjs.js b/typescript/option/lib/index.cjs.js deleted file mode 100644 index d54edff..0000000 --- a/typescript/option/lib/index.cjs.js +++ /dev/null @@ -1,2 +0,0 @@ -"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const identity=e=>e,none=Symbol("none"),None={__brand:none,toString:()=>"None"},Some=identity,isNone=e=>e.__brand===none,isSome=e=>!isNone(e),match=(e,o,t)=>isSome(t)?e(t):o,bind=(e,o)=>match(e,None,o),bindAsync=(e,o)=>match(e,Promise.resolve(None),o),count=e=>Number(isSome(e)),exists=(e,o)=>match(e,!1,o),filter=(e,o)=>match(o=>e(o)?Some(o):None,None,o),flat=e=>bind(identity,e),fold=(e,o,t)=>match(t=>e(o,t),o,t),foldback=(e,o,t)=>match(o=>e(o,t),t,o),forall=(e,o)=>match(e,!0,o),fromArray=e=>void 0===e[0]?None:Some(e[0]),fromNullable=e=>null===e?None:Some(e),get=e=>{if(isSome(e))return e;throw new Error("Cannot get value of None")},iter=(e,o)=>{isSome(o)&&e(o)},map=(e,o)=>match(o=>Some(e(o)),None,o),mapAsync=(e,o)=>match(o=>e(o).then(Some),Promise.resolve(None),o),toArray=e=>match(e=>[e],[],e),toNullable=e=>match(identity,null,e),withDefault=(e,o)=>match(identity,e,o);exports.None=None,exports.Some=Some,exports.bind=bind,exports.bindAsync=bindAsync,exports.count=count,exports.exists=exists,exports.filter=filter,exports.flat=flat,exports.fold=fold,exports.foldback=foldback,exports.forall=forall,exports.fromArray=fromArray,exports.fromNullable=fromNullable,exports.get=get,exports.isNone=isNone,exports.isSome=isSome,exports.iter=iter,exports.map=map,exports.mapAsync=mapAsync,exports.toArray=toArray,exports.toNullable=toNullable,exports.withDefault=withDefault; -//# sourceMappingURL=index.cjs.js.map diff --git a/typescript/option/lib/index.cjs.js.map b/typescript/option/lib/index.cjs.js.map deleted file mode 100644 index 5015f9b..0000000 --- a/typescript/option/lib/index.cjs.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.cjs.js","sources":["../src/internals.ts","../src/types.ts","../src/helpers/isNone.ts","../src/helpers/isSome.ts","../src/helpers/match.ts","../src/helpers/bind.ts","../src/helpers/bindAsync.ts","../src/helpers/count.ts","../src/helpers/exists.ts","../src/helpers/filter.ts","../src/helpers/flat.ts","../src/helpers/fold.ts","../src/helpers/foldback.ts","../src/helpers/forall.ts","../src/helpers/fromArray.ts","../src/helpers/fromNullable.ts","../src/helpers/get.ts","../src/helpers/iter.ts","../src/helpers/map.ts","../src/helpers/mapAsync.ts","../src/helpers/toArray.ts","../src/helpers/toNullable.ts","../src/helpers/withDefault.ts"],"sourcesContent":["export const identity = (v: T) => v\n\nexport const none = Symbol('none')\n","import { none, identity } from './internals'\nimport { Brand } from 'utility-types'\n\n// This is never actually used outside of typing so we can just declare it\ndeclare const some: unique symbol\n\ntype None = Brand\ntype Some = Brand\n\nexport type Option = Some | None\n\nexport const None = {\n __brand: none,\n toString: () => 'None'\n} as None\nexport const Some = identity as (value: T) => Option\n","import { Option } from '../types'\nimport { none } from '../internals'\n\nexport const isNone = (option: Option) => option.__brand === none\n","import { Option } from '../types'\nimport { isNone } from './isNone'\n\nexport const isSome = (option: Option) => !isNone(option)\n","import { Option } from '../types'\nimport { Mapper } from '../internalTypes'\nimport { isSome } from './isSome'\n\nexport const match = (\n caseSome: Mapper,\n _default: U,\n option: Option\n) => {\n if (isSome(option)) {\n return caseSome(option as T)\n }\n\n return _default\n}\n","import { Binder } from '../internalTypes'\nimport { Option, None } from '../types'\nimport { match } from './match'\n\nexport const bind = (\n binder: Binder,\n option: Option\n): Option => {\n return match(binder, None, option)\n}\n","import { Mapper } from '../internalTypes'\nimport { Option, None } from '../types'\nimport { match } from './match'\n\nexport const bindAsync = (\n binder: Mapper>>,\n option: Option\n): Promise> => {\n return match(binder, Promise.resolve(None), option)\n}\n","import { Option } from '../types'\nimport { isSome } from './isSome'\n\nexport const count = (option: Option) => Number(isSome(option))\n","import { match } from './match'\nimport { Predicate } from '../internalTypes'\nimport { Option } from '../types'\n\nexport const exists = (predicate: Predicate, option: Option) => {\n return match(predicate, false, option)\n}\n","import { match } from './match'\nimport { Some, None, Option } from '../types'\nimport { Predicate } from '../internalTypes'\n\nexport const filter = (predicate: Predicate, option: Option) => {\n return match(v => (predicate(v) ? Some(v) : None), None, option)\n}\n","import { bind } from './bind'\nimport { identity } from '../internals'\nimport { Option } from '../types'\n\nexport const flat = (option: Option>): Option => {\n return bind(identity, option)\n}\n","import { match } from './match'\nimport { Option } from '../types'\nimport { Folder } from '../internalTypes'\n\nexport const fold = (\n folder: Folder,\n initial: U,\n option: Option\n) => {\n return match(v => folder(initial, v), initial, option)\n}\n","import { match } from './match'\nimport { Option } from '../types'\nimport { BackFolder } from '../internalTypes'\n\nexport const foldback = (\n folder: BackFolder,\n option: Option,\n initial: U\n) => {\n return match(v => folder(v, initial), initial, option)\n}\n","import { match } from './match'\nimport { Predicate } from '../internalTypes'\nimport { Option } from '../types'\n\nexport const forall = (predicate: Predicate, option: Option) => {\n return match(predicate, true, option)\n}\n","import { None, Some, Option } from '../types'\n\nexport const fromArray = (value: [T] | []): Option => {\n return value[0] === undefined ? None : Some(value[0])\n}\n","import { Nullable } from '../internalTypes'\nimport { Some, None, Option } from '../types'\n\nexport const fromNullable = (value: Nullable): Option => {\n return value === null ? None : Some(value)\n}\n","import { Option } from '../types'\nimport { isSome } from './isSome'\n\nexport const get = (option: Option): T => {\n if (isSome(option)) {\n return option as T\n }\n\n throw new Error(`Cannot get value of None`)\n}\n","import { Mapper } from '../internalTypes'\nimport { Option } from '../types'\nimport { isSome } from './isSome'\n\nexport const iter = (mapper: Mapper, option: Option) => {\n if (isSome(option)) {\n mapper(option as T)\n }\n}\n","import { match } from './match'\nimport { Mapper } from '../internalTypes'\nimport { Option, Some, None } from '../types'\n\nexport const map = (\n mapper: Mapper,\n option: Option\n): Option => {\n return match(v => Some(mapper(v)), None, option)\n}\n","import { Option, None, Some } from '../types'\nimport { Mapper } from '../internalTypes'\nimport { match } from './match'\n\nexport const mapAsync = (\n mapper: Mapper>,\n option: Option\n) => {\n return match(\n value => mapper(value).then(Some),\n Promise.resolve(None),\n option\n )\n}\n","import { match } from './match'\nimport { Option } from '../types'\n\nexport const toArray = (option: Option) => {\n return match(v => [v], [], option)\n}\n","import { match } from './match'\nimport { identity } from '../internals'\nimport { Option } from '../types'\n\nexport const toNullable = (option: Option) => {\n return match(identity, null, option)\n}\n","import { match } from './match'\nimport { identity } from '../internals'\nimport { Option } from '../types'\n\nexport const withDefault = (_default: T, option: Option) => {\n return match(identity, _default, option)\n}\n"],"names":["identity","v","none","Symbol","None","__brand","toString","Some","isNone","option","isSome","match","caseSome","_default","bind","binder","bindAsync","Promise","resolve","count","Number","exists","predicate","filter","flat","fold","folder","initial","foldback","forall","fromArray","value","undefined","fromNullable","get","Error","iter","mapper","map","mapAsync","then","toArray","toNullable","withDefault"],"mappings":"oEAAO,MAAMA,SAAeC,GAASA,EAExBC,KAAOC,OAAO,QCSdC,KAAO,CAChBC,QAASH,KACTI,SAAU,IAAM,QAEPC,KAAOP,SCZPQ,OAAaC,GAAsBA,EAAOJ,UAAYH,KCAtDQ,OAAaD,IAAuBD,OAAOC,GCC3CE,MAAQ,CACjBC,EACAC,EACAJ,IAEIC,OAAOD,GACAG,EAASH,GAGbI,ECTEC,KAAO,CAChBC,EACAN,IAEOE,MAAMI,EAAQX,KAAMK,GCJlBO,UAAY,CACrBD,EACAN,IAEOE,MAAMI,EAAQE,QAAQC,QAAQd,MAAOK,GCLnCU,MAAYV,GAAsBW,OAAOV,OAAOD,ICChDY,OAAS,CAAIC,EAAyBb,IACxCE,MAAMW,GAAW,EAAOb,GCDtBc,OAAS,CAAID,EAAyBb,IACxCE,MAAMV,GAAMqB,EAAUrB,GAAKM,KAAKN,GAAKG,KAAOA,KAAMK,GCDhDe,KAAWf,GACbK,KAAKd,SAAUS,GCDbgB,KAAO,CAChBC,EACAC,EACAlB,IAEOE,MAAMV,GAAKyB,EAAOC,EAAS1B,GAAI0B,EAASlB,GCLtCmB,SAAW,CACpBF,EACAjB,EACAkB,IAEOhB,MAAMV,GAAKyB,EAAOzB,EAAG0B,GAAUA,EAASlB,GCLtCoB,OAAS,CAAIP,EAAyBb,IACxCE,MAAMW,GAAW,EAAMb,GCHrBqB,UAAgBC,QACLC,IAAbD,EAAM,GAAmB3B,KAAOG,KAAKwB,EAAM,ICAzCE,aAAmBF,GACX,OAAVA,EAAiB3B,KAAOG,KAAKwB,GCD3BG,IAAUzB,IACnB,GAAIC,OAAOD,GACP,OAAOA,EAGX,MAAM,IAAI0B,MAAM,6BCJPC,KAAO,CAAIC,EAAyB5B,KACzCC,OAAOD,IACP4B,EAAO5B,ICFF6B,IAAM,CACfD,EACA5B,IAEOE,MAAMV,GAAKM,KAAK8B,EAAOpC,IAAKG,KAAMK,GCJhC8B,SAAW,CACpBF,EACA5B,IAEOE,MACHoB,GAASM,EAAON,GAAOS,KAAKjC,MAC5BU,QAAQC,QAAQd,MAChBK,GCRKgC,QAAchC,GAChBE,MAAMV,GAAK,CAACA,GAAI,GAAIQ,GCAlBiC,WAAiBjC,GACnBE,MAAMX,SAAU,KAAMS,GCDpBkC,YAAc,CAAI9B,EAAaJ,IACjCE,MAAMX,SAAUa,EAAUJ"} \ No newline at end of file diff --git a/typescript/option/lib/index.d.ts b/typescript/option/lib/index.d.ts deleted file mode 100644 index 0bf8d85..0000000 --- a/typescript/option/lib/index.d.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { Brand } from "utility-types"; -declare const none: unique symbol; -declare const some: unique symbol; -declare type None = Brand; -declare type Some = Brand; -declare type Option = Some | None; -declare const None: Brand; -declare const Some: (value: T) => Option; -declare const isNone: (option: Option) => boolean; -declare const isSome: (option: Option) => boolean; -declare type Mapper = (v: T) => U; -declare type Binder = (v: T) => Option; -declare type Predicate = (v: T) => boolean; -declare type Folder = (s: U, v: T) => U; -declare type BackFolder = (v: T, s: U) => U; -declare const bind: (binder: Binder, option: Option) => Option; -declare const bindAsync: (binder: Mapper>>, option: Option) => Promise>; -declare const count: (option: Option) => number; -declare const exists: (predicate: Predicate, option: Option) => boolean; -declare const filter: (predicate: Predicate, option: Option) => Option; -declare const flat: (option: Option>) => Option; -declare const fold: (folder: Folder, initial: U, option: Option) => U; -declare const foldback: (folder: BackFolder, option: Option, initial: U) => U; -declare const forall: (predicate: Predicate, option: Option) => boolean; -declare const fromArray: (value: [T] | []) => Option; -declare const fromNullable: (value: T) => Option; -declare const get: (option: Option) => T; -declare const iter: (mapper: Mapper, option: Option) => void; -declare const map: (mapper: Mapper, option: Option) => Option; -declare const mapAsync: (mapper: Mapper>, option: Option) => Promise>; -declare const toArray: (option: Option) => T[]; -declare const toNullable: (option: Option) => T; -declare const withDefault: (_default: T, option: Option) => T; -export { bind, bindAsync, count, exists, filter, flat, fold, foldback, forall, fromArray, fromNullable, get, isNone, isSome, iter, map, mapAsync, toArray, toNullable, withDefault, Option, None, Some }; diff --git a/typescript/option/lib/index.esm.d.ts b/typescript/option/lib/index.esm.d.ts deleted file mode 100644 index 0bf8d85..0000000 --- a/typescript/option/lib/index.esm.d.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { Brand } from "utility-types"; -declare const none: unique symbol; -declare const some: unique symbol; -declare type None = Brand; -declare type Some = Brand; -declare type Option = Some | None; -declare const None: Brand; -declare const Some: (value: T) => Option; -declare const isNone: (option: Option) => boolean; -declare const isSome: (option: Option) => boolean; -declare type Mapper = (v: T) => U; -declare type Binder = (v: T) => Option; -declare type Predicate = (v: T) => boolean; -declare type Folder = (s: U, v: T) => U; -declare type BackFolder = (v: T, s: U) => U; -declare const bind: (binder: Binder, option: Option) => Option; -declare const bindAsync: (binder: Mapper>>, option: Option) => Promise>; -declare const count: (option: Option) => number; -declare const exists: (predicate: Predicate, option: Option) => boolean; -declare const filter: (predicate: Predicate, option: Option) => Option; -declare const flat: (option: Option>) => Option; -declare const fold: (folder: Folder, initial: U, option: Option) => U; -declare const foldback: (folder: BackFolder, option: Option, initial: U) => U; -declare const forall: (predicate: Predicate, option: Option) => boolean; -declare const fromArray: (value: [T] | []) => Option; -declare const fromNullable: (value: T) => Option; -declare const get: (option: Option) => T; -declare const iter: (mapper: Mapper, option: Option) => void; -declare const map: (mapper: Mapper, option: Option) => Option; -declare const mapAsync: (mapper: Mapper>, option: Option) => Promise>; -declare const toArray: (option: Option) => T[]; -declare const toNullable: (option: Option) => T; -declare const withDefault: (_default: T, option: Option) => T; -export { bind, bindAsync, count, exists, filter, flat, fold, foldback, forall, fromArray, fromNullable, get, isNone, isSome, iter, map, mapAsync, toArray, toNullable, withDefault, Option, None, Some }; diff --git a/typescript/option/lib/index.esm.js b/typescript/option/lib/index.esm.js deleted file mode 100644 index 474fb75..0000000 --- a/typescript/option/lib/index.esm.js +++ /dev/null @@ -1,2 +0,0 @@ -var n=function(n){return n},r=Symbol("none"),t={__brand:r,toString:function(){return"None"}},u=n,o=function(n){return n.__brand===r},e=function(n){return!o(n)},i=function(n,r,t){return e(t)?n(t):r},f=function(n,r){return i(n,t,r)},c=function(n,r){return i(n,Promise.resolve(t),r)},l=function(n){return Number(e(n))},a=function(n,r){return i(n,!1,r)},v=function(n,r){return i((function(r){return n(r)?u(r):t}),t,r)},b=function(r){return f(n,r)},m=function(n,r,t){return i((function(t){return n(r,t)}),r,t)},s=function(n,r,t){return i((function(r){return n(r,t)}),t,r)},_=function(n,r){return i(n,!0,r)},d=function(n){return void 0===n[0]?t:u(n[0])},N=function(n){return null===n?t:u(n)},g=function(n){if(e(n))return n;throw new Error("Cannot get value of None")},h=function(n,r){e(r)&&n(r)},w=function(n,r){return i((function(r){return u(n(r))}),t,r)},P=function(n,r){return i((function(r){return n(r).then(u)}),Promise.resolve(t),r)},S=function(n){return i((function(n){return[n]}),[],n)},p=function(r){return i(n,null,r)},x=function(r,t){return i(n,r,t)};export{t as None,u as Some,f as bind,c as bindAsync,l as count,a as exists,v as filter,b as flat,m as fold,s as foldback,_ as forall,d as fromArray,N as fromNullable,g as get,o as isNone,e as isSome,h as iter,w as map,P as mapAsync,S as toArray,p as toNullable,x as withDefault}; -//# sourceMappingURL=index.esm.js.map diff --git a/typescript/option/lib/index.esm.js.map b/typescript/option/lib/index.esm.js.map deleted file mode 100644 index acd8820..0000000 --- a/typescript/option/lib/index.esm.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.esm.js","sources":["../src/internals.ts","../src/types.ts","../src/helpers/isNone.ts","../src/helpers/isSome.ts","../src/helpers/match.ts","../src/helpers/bind.ts","../src/helpers/bindAsync.ts","../src/helpers/count.ts","../src/helpers/exists.ts","../src/helpers/filter.ts","../src/helpers/flat.ts","../src/helpers/fold.ts","../src/helpers/foldback.ts","../src/helpers/forall.ts","../src/helpers/fromArray.ts","../src/helpers/fromNullable.ts","../src/helpers/get.ts","../src/helpers/iter.ts","../src/helpers/map.ts","../src/helpers/mapAsync.ts","../src/helpers/toArray.ts","../src/helpers/toNullable.ts","../src/helpers/withDefault.ts"],"sourcesContent":["export const identity = (v: T) => v\n\nexport const none = Symbol('none')\n","import { none, identity } from './internals'\nimport { Brand } from 'utility-types'\n\n// This is never actually used outside of typing so we can just declare it\ndeclare const some: unique symbol\n\ntype None = Brand\ntype Some = Brand\n\nexport type Option = Some | None\n\nexport const None = {\n __brand: none,\n toString: () => 'None'\n} as None\nexport const Some = identity as (value: T) => Option\n","import { Option } from '../types'\nimport { none } from '../internals'\n\nexport const isNone = (option: Option) => option.__brand === none\n","import { Option } from '../types'\nimport { isNone } from './isNone'\n\nexport const isSome = (option: Option) => !isNone(option)\n","import { Option } from '../types'\nimport { Mapper } from '../internalTypes'\nimport { isSome } from './isSome'\n\nexport const match = (\n caseSome: Mapper,\n _default: U,\n option: Option\n) => {\n if (isSome(option)) {\n return caseSome(option as T)\n }\n\n return _default\n}\n","import { Binder } from '../internalTypes'\nimport { Option, None } from '../types'\nimport { match } from './match'\n\nexport const bind = (\n binder: Binder,\n option: Option\n): Option => {\n return match(binder, None, option)\n}\n","import { Mapper } from '../internalTypes'\nimport { Option, None } from '../types'\nimport { match } from './match'\n\nexport const bindAsync = (\n binder: Mapper>>,\n option: Option\n): Promise> => {\n return match(binder, Promise.resolve(None), option)\n}\n","import { Option } from '../types'\nimport { isSome } from './isSome'\n\nexport const count = (option: Option) => Number(isSome(option))\n","import { match } from './match'\nimport { Predicate } from '../internalTypes'\nimport { Option } from '../types'\n\nexport const exists = (predicate: Predicate, option: Option) => {\n return match(predicate, false, option)\n}\n","import { match } from './match'\nimport { Some, None, Option } from '../types'\nimport { Predicate } from '../internalTypes'\n\nexport const filter = (predicate: Predicate, option: Option) => {\n return match(v => (predicate(v) ? Some(v) : None), None, option)\n}\n","import { bind } from './bind'\nimport { identity } from '../internals'\nimport { Option } from '../types'\n\nexport const flat = (option: Option>): Option => {\n return bind(identity, option)\n}\n","import { match } from './match'\nimport { Option } from '../types'\nimport { Folder } from '../internalTypes'\n\nexport const fold = (\n folder: Folder,\n initial: U,\n option: Option\n) => {\n return match(v => folder(initial, v), initial, option)\n}\n","import { match } from './match'\nimport { Option } from '../types'\nimport { BackFolder } from '../internalTypes'\n\nexport const foldback = (\n folder: BackFolder,\n option: Option,\n initial: U\n) => {\n return match(v => folder(v, initial), initial, option)\n}\n","import { match } from './match'\nimport { Predicate } from '../internalTypes'\nimport { Option } from '../types'\n\nexport const forall = (predicate: Predicate, option: Option) => {\n return match(predicate, true, option)\n}\n","import { None, Some, Option } from '../types'\n\nexport const fromArray = (value: [T] | []): Option => {\n return value[0] === undefined ? None : Some(value[0])\n}\n","import { Nullable } from '../internalTypes'\nimport { Some, None, Option } from '../types'\n\nexport const fromNullable = (value: Nullable): Option => {\n return value === null ? None : Some(value)\n}\n","import { Option } from '../types'\nimport { isSome } from './isSome'\n\nexport const get = (option: Option): T => {\n if (isSome(option)) {\n return option as T\n }\n\n throw new Error(`Cannot get value of None`)\n}\n","import { Mapper } from '../internalTypes'\nimport { Option } from '../types'\nimport { isSome } from './isSome'\n\nexport const iter = (mapper: Mapper, option: Option) => {\n if (isSome(option)) {\n mapper(option as T)\n }\n}\n","import { match } from './match'\nimport { Mapper } from '../internalTypes'\nimport { Option, Some, None } from '../types'\n\nexport const map = (\n mapper: Mapper,\n option: Option\n): Option => {\n return match(v => Some(mapper(v)), None, option)\n}\n","import { Option, None, Some } from '../types'\nimport { Mapper } from '../internalTypes'\nimport { match } from './match'\n\nexport const mapAsync = (\n mapper: Mapper>,\n option: Option\n) => {\n return match(\n value => mapper(value).then(Some),\n Promise.resolve(None),\n option\n )\n}\n","import { match } from './match'\nimport { Option } from '../types'\n\nexport const toArray = (option: Option) => {\n return match(v => [v], [], option)\n}\n","import { match } from './match'\nimport { identity } from '../internals'\nimport { Option } from '../types'\n\nexport const toNullable = (option: Option) => {\n return match(identity, null, option)\n}\n","import { match } from './match'\nimport { identity } from '../internals'\nimport { Option } from '../types'\n\nexport const withDefault = (_default: T, option: Option) => {\n return match(identity, _default, option)\n}\n"],"names":["identity","v","none","Symbol","None","__brand","toString","Some","isNone","option","isSome","match","caseSome","_default","bind","binder","bindAsync","Promise","resolve","count","Number","exists","predicate","filter","flat","fold","folder","initial","foldback","forall","fromArray","value","undefined","fromNullable","get","Error","iter","mapper","map","mapAsync","then","toArray","toNullable","withDefault"],"mappings":"AAAO,IAAMA,EAAW,SAAIC,GAAS,OAAAA,GAExBC,EAAOC,OAAO,QCSdC,EAAO,CAChBC,QAASH,EACTI,SAAU,WAAM,MAAA,SAEPC,EAAOP,ECZPQ,EAAS,SAAIC,GAAsB,OAAAA,EAAOJ,UAAYH,GCAtDQ,EAAS,SAAID,GAAsB,OAACD,EAAOC,ICC3CE,EAAQ,SACjBC,EACAC,EACAJ,GAEA,OAAIC,EAAOD,GACAG,EAASH,GAGbI,GCTEC,EAAO,SAChBC,EACAN,GAEA,OAAOE,EAAMI,EAAQX,EAAMK,ICJlBO,EAAY,SACrBD,EACAN,GAEA,OAAOE,EAAMI,EAAQE,QAAQC,QAAQd,GAAOK,ICLnCU,EAAQ,SAAIV,GAAsB,OAAAW,OAAOV,EAAOD,KCChDY,EAAS,SAAIC,EAAyBb,GAC/C,OAAOE,EAAMW,GAAW,EAAOb,ICDtBc,EAAS,SAAID,EAAyBb,GAC/C,OAAOE,GAAM,SAAAV,GAAK,OAACqB,EAAUrB,GAAKM,EAAKN,GAAKG,IAAOA,EAAMK,ICDhDe,EAAO,SAAIf,GACpB,OAAOK,EAAKd,EAAUS,ICDbgB,EAAO,SAChBC,EACAC,EACAlB,GAEA,OAAOE,GAAM,SAAAV,GAAK,OAAAyB,EAAOC,EAAS1B,KAAI0B,EAASlB,ICLtCmB,EAAW,SACpBF,EACAjB,EACAkB,GAEA,OAAOhB,GAAM,SAAAV,GAAK,OAAAyB,EAAOzB,EAAG0B,KAAUA,EAASlB,ICLtCoB,EAAS,SAAIP,EAAyBb,GAC/C,OAAOE,EAAMW,GAAW,EAAMb,ICHrBqB,EAAY,SAAIC,GACzB,YAAoBC,IAAbD,EAAM,GAAmB3B,EAAOG,EAAKwB,EAAM,KCAzCE,EAAe,SAAIF,GAC5B,OAAiB,OAAVA,EAAiB3B,EAAOG,EAAKwB,ICD3BG,EAAM,SAAIzB,GACnB,GAAIC,EAAOD,GACP,OAAOA,EAGX,MAAM,IAAI0B,MAAM,6BCJPC,EAAO,SAAIC,EAAyB5B,GACzCC,EAAOD,IACP4B,EAAO5B,ICFF6B,EAAM,SACfD,EACA5B,GAEA,OAAOE,GAAM,SAAAV,GAAK,OAAAM,EAAK8B,EAAOpC,MAAKG,EAAMK,ICJhC8B,EAAW,SACpBF,EACA5B,GAEA,OAAOE,GACH,SAAAoB,GAAS,OAAAM,EAAON,GAAOS,KAAKjC,KAC5BU,QAAQC,QAAQd,GAChBK,ICRKgC,EAAU,SAAIhC,GACvB,OAAOE,GAAM,SAAAV,GAAK,MAAA,CAACA,KAAI,GAAIQ,ICAlBiC,EAAa,SAAIjC,GAC1B,OAAOE,EAAMX,EAAU,KAAMS,ICDpBkC,EAAc,SAAI9B,EAAaJ,GACxC,OAAOE,EAAMX,EAAUa,EAAUJ"} \ No newline at end of file diff --git a/typescript/option/lib/index.js b/typescript/option/lib/index.js deleted file mode 100644 index f83d25c..0000000 --- a/typescript/option/lib/index.js +++ /dev/null @@ -1,2 +0,0 @@ -var n=function(n){return n},r=Symbol("none"),t={__brand:r,toString:function(){return"None"}},u=n,o=function(n){return n.__brand===r},e=function(n){return!o(n)},i=function(n,r,t){return e(t)?n(t):r},f=function(n,r){return i(n,t,r)},c=function(n,r){return i(n,Promise.resolve(t),r)},l=function(n){return Number(e(n))},a=function(n,r){return i(n,!1,r)},v=function(n,r){return i((function(r){return n(r)?u(r):t}),t,r)},b=function(r){return f(n,r)},m=function(n,r,t){return i((function(t){return n(r,t)}),r,t)},s=function(n,r,t){return i((function(r){return n(r,t)}),t,r)},_=function(n,r){return i(n,!0,r)},d=function(n){return void 0===n[0]?t:u(n[0])},N=function(n){return null===n?t:u(n)},g=function(n){if(e(n))return n;throw new Error("Cannot get value of None")},h=function(n,r){e(r)&&n(r)},w=function(n,r){return i((function(r){return u(n(r))}),t,r)},P=function(n,r){return i((function(r){return n(r).then(u)}),Promise.resolve(t),r)},S=function(n){return i((function(n){return[n]}),[],n)},p=function(r){return i(n,null,r)},x=function(r,t){return i(n,r,t)};export{t as None,u as Some,f as bind,c as bindAsync,l as count,a as exists,v as filter,b as flat,m as fold,s as foldback,_ as forall,d as fromArray,N as fromNullable,g as get,o as isNone,e as isSome,h as iter,w as map,P as mapAsync,S as toArray,p as toNullable,x as withDefault}; -//# sourceMappingURL=index.js.map diff --git a/typescript/option/lib/index.js.map b/typescript/option/lib/index.js.map deleted file mode 100644 index 85facf1..0000000 --- a/typescript/option/lib/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sources":["../src/internals.ts","../src/types.ts","../src/helpers/isNone.ts","../src/helpers/isSome.ts","../src/helpers/match.ts","../src/helpers/bind.ts","../src/helpers/bindAsync.ts","../src/helpers/count.ts","../src/helpers/exists.ts","../src/helpers/filter.ts","../src/helpers/flat.ts","../src/helpers/fold.ts","../src/helpers/foldback.ts","../src/helpers/forall.ts","../src/helpers/fromArray.ts","../src/helpers/fromNullable.ts","../src/helpers/get.ts","../src/helpers/iter.ts","../src/helpers/map.ts","../src/helpers/mapAsync.ts","../src/helpers/toArray.ts","../src/helpers/toNullable.ts","../src/helpers/withDefault.ts"],"sourcesContent":["export const identity = (v: T) => v\n\nexport const none = Symbol('none')\n","import { none, identity } from './internals'\nimport { Brand } from 'utility-types'\n\n// This is never actually used outside of typing so we can just declare it\ndeclare const some: unique symbol\n\ntype None = Brand\ntype Some = Brand\n\nexport type Option = Some | None\n\nexport const None = {\n __brand: none,\n toString: () => 'None'\n} as None\nexport const Some = identity as (value: T) => Option\n","import { Option } from '../types'\nimport { none } from '../internals'\n\nexport const isNone = (option: Option) => option.__brand === none\n","import { Option } from '../types'\nimport { isNone } from './isNone'\n\nexport const isSome = (option: Option) => !isNone(option)\n","import { Option } from '../types'\nimport { Mapper } from '../internalTypes'\nimport { isSome } from './isSome'\n\nexport const match = (\n caseSome: Mapper,\n _default: U,\n option: Option\n) => {\n if (isSome(option)) {\n return caseSome(option as T)\n }\n\n return _default\n}\n","import { Binder } from '../internalTypes'\nimport { Option, None } from '../types'\nimport { match } from './match'\n\nexport const bind = (\n binder: Binder,\n option: Option\n): Option => {\n return match(binder, None, option)\n}\n","import { Mapper } from '../internalTypes'\nimport { Option, None } from '../types'\nimport { match } from './match'\n\nexport const bindAsync = (\n binder: Mapper>>,\n option: Option\n): Promise> => {\n return match(binder, Promise.resolve(None), option)\n}\n","import { Option } from '../types'\nimport { isSome } from './isSome'\n\nexport const count = (option: Option) => Number(isSome(option))\n","import { match } from './match'\nimport { Predicate } from '../internalTypes'\nimport { Option } from '../types'\n\nexport const exists = (predicate: Predicate, option: Option) => {\n return match(predicate, false, option)\n}\n","import { match } from './match'\nimport { Some, None, Option } from '../types'\nimport { Predicate } from '../internalTypes'\n\nexport const filter = (predicate: Predicate, option: Option) => {\n return match(v => (predicate(v) ? Some(v) : None), None, option)\n}\n","import { bind } from './bind'\nimport { identity } from '../internals'\nimport { Option } from '../types'\n\nexport const flat = (option: Option>): Option => {\n return bind(identity, option)\n}\n","import { match } from './match'\nimport { Option } from '../types'\nimport { Folder } from '../internalTypes'\n\nexport const fold = (\n folder: Folder,\n initial: U,\n option: Option\n) => {\n return match(v => folder(initial, v), initial, option)\n}\n","import { match } from './match'\nimport { Option } from '../types'\nimport { BackFolder } from '../internalTypes'\n\nexport const foldback = (\n folder: BackFolder,\n option: Option,\n initial: U\n) => {\n return match(v => folder(v, initial), initial, option)\n}\n","import { match } from './match'\nimport { Predicate } from '../internalTypes'\nimport { Option } from '../types'\n\nexport const forall = (predicate: Predicate, option: Option) => {\n return match(predicate, true, option)\n}\n","import { None, Some, Option } from '../types'\n\nexport const fromArray = (value: [T] | []): Option => {\n return value[0] === undefined ? None : Some(value[0])\n}\n","import { Nullable } from '../internalTypes'\nimport { Some, None, Option } from '../types'\n\nexport const fromNullable = (value: Nullable): Option => {\n return value === null ? None : Some(value)\n}\n","import { Option } from '../types'\nimport { isSome } from './isSome'\n\nexport const get = (option: Option): T => {\n if (isSome(option)) {\n return option as T\n }\n\n throw new Error(`Cannot get value of None`)\n}\n","import { Mapper } from '../internalTypes'\nimport { Option } from '../types'\nimport { isSome } from './isSome'\n\nexport const iter = (mapper: Mapper, option: Option) => {\n if (isSome(option)) {\n mapper(option as T)\n }\n}\n","import { match } from './match'\nimport { Mapper } from '../internalTypes'\nimport { Option, Some, None } from '../types'\n\nexport const map = (\n mapper: Mapper,\n option: Option\n): Option => {\n return match(v => Some(mapper(v)), None, option)\n}\n","import { Option, None, Some } from '../types'\nimport { Mapper } from '../internalTypes'\nimport { match } from './match'\n\nexport const mapAsync = (\n mapper: Mapper>,\n option: Option\n) => {\n return match(\n value => mapper(value).then(Some),\n Promise.resolve(None),\n option\n )\n}\n","import { match } from './match'\nimport { Option } from '../types'\n\nexport const toArray = (option: Option) => {\n return match(v => [v], [], option)\n}\n","import { match } from './match'\nimport { identity } from '../internals'\nimport { Option } from '../types'\n\nexport const toNullable = (option: Option) => {\n return match(identity, null, option)\n}\n","import { match } from './match'\nimport { identity } from '../internals'\nimport { Option } from '../types'\n\nexport const withDefault = (_default: T, option: Option) => {\n return match(identity, _default, option)\n}\n"],"names":["identity","v","none","Symbol","None","__brand","toString","Some","isNone","option","isSome","match","caseSome","_default","bind","binder","bindAsync","Promise","resolve","count","Number","exists","predicate","filter","flat","fold","folder","initial","foldback","forall","fromArray","value","undefined","fromNullable","get","Error","iter","mapper","map","mapAsync","then","toArray","toNullable","withDefault"],"mappings":"AAAO,IAAMA,EAAW,SAAIC,GAAS,OAAAA,GAExBC,EAAOC,OAAO,QCSdC,EAAO,CAChBC,QAASH,EACTI,SAAU,WAAM,MAAA,SAEPC,EAAOP,ECZPQ,EAAS,SAAIC,GAAsB,OAAAA,EAAOJ,UAAYH,GCAtDQ,EAAS,SAAID,GAAsB,OAACD,EAAOC,ICC3CE,EAAQ,SACjBC,EACAC,EACAJ,GAEA,OAAIC,EAAOD,GACAG,EAASH,GAGbI,GCTEC,EAAO,SAChBC,EACAN,GAEA,OAAOE,EAAMI,EAAQX,EAAMK,ICJlBO,EAAY,SACrBD,EACAN,GAEA,OAAOE,EAAMI,EAAQE,QAAQC,QAAQd,GAAOK,ICLnCU,EAAQ,SAAIV,GAAsB,OAAAW,OAAOV,EAAOD,KCChDY,EAAS,SAAIC,EAAyBb,GAC/C,OAAOE,EAAMW,GAAW,EAAOb,ICDtBc,EAAS,SAAID,EAAyBb,GAC/C,OAAOE,GAAM,SAAAV,GAAK,OAACqB,EAAUrB,GAAKM,EAAKN,GAAKG,IAAOA,EAAMK,ICDhDe,EAAO,SAAIf,GACpB,OAAOK,EAAKd,EAAUS,ICDbgB,EAAO,SAChBC,EACAC,EACAlB,GAEA,OAAOE,GAAM,SAAAV,GAAK,OAAAyB,EAAOC,EAAS1B,KAAI0B,EAASlB,ICLtCmB,EAAW,SACpBF,EACAjB,EACAkB,GAEA,OAAOhB,GAAM,SAAAV,GAAK,OAAAyB,EAAOzB,EAAG0B,KAAUA,EAASlB,ICLtCoB,EAAS,SAAIP,EAAyBb,GAC/C,OAAOE,EAAMW,GAAW,EAAMb,ICHrBqB,EAAY,SAAIC,GACzB,YAAoBC,IAAbD,EAAM,GAAmB3B,EAAOG,EAAKwB,EAAM,KCAzCE,EAAe,SAAIF,GAC5B,OAAiB,OAAVA,EAAiB3B,EAAOG,EAAKwB,ICD3BG,EAAM,SAAIzB,GACnB,GAAIC,EAAOD,GACP,OAAOA,EAGX,MAAM,IAAI0B,MAAM,6BCJPC,EAAO,SAAIC,EAAyB5B,GACzCC,EAAOD,IACP4B,EAAO5B,ICFF6B,EAAM,SACfD,EACA5B,GAEA,OAAOE,GAAM,SAAAV,GAAK,OAAAM,EAAK8B,EAAOpC,MAAKG,EAAMK,ICJhC8B,EAAW,SACpBF,EACA5B,GAEA,OAAOE,GACH,SAAAoB,GAAS,OAAAM,EAAON,GAAOS,KAAKjC,KAC5BU,QAAQC,QAAQd,GAChBK,ICRKgC,EAAU,SAAIhC,GACvB,OAAOE,GAAM,SAAAV,GAAK,MAAA,CAACA,KAAI,GAAIQ,ICAlBiC,EAAa,SAAIjC,GAC1B,OAAOE,EAAMX,EAAU,KAAMS,ICDpBkC,EAAc,SAAI9B,EAAaJ,GACxC,OAAOE,EAAMX,EAAUa,EAAUJ"} \ No newline at end of file diff --git a/typescript/option/lib/tsdoc-metadata.json b/typescript/option/lib/tsdoc-metadata.json deleted file mode 100644 index 65d0a8d..0000000 --- a/typescript/option/lib/tsdoc-metadata.json +++ /dev/null @@ -1,11 +0,0 @@ -// This file is read by tools that parse documentation comments conforming to the TSDoc standard. -// It should be published with your NPM package. It should not be tracked by Git. -{ - "tsdocVersion": "0.12", - "toolPackages": [ - { - "packageName": "@microsoft/api-extractor", - "packageVersion": "7.7.0" - } - ] -}