5.11.114 • Published 10 months ago

@erboladaiorg/distinctio-tempora-quis v5.11.114

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

option

deno land deno doc GitHub release (latest by date) codecov License

test NPM standard-readme compliant semantic-release: angular

Minimum option type port of Rust.

Table of Contents

Background

This project provides minimum option features. They are designed to be optimized in tree-shaking.

One of the existing challenges in the JavaScript/TypeScript community is tree-shaking. Due to the dynamic nature of the language, tree-shaking can only be used in limited situations. That is, tree-shaking cannot do anything about unused class methods or properties.

The only solution to this is separation into top-level functions. It is very unfortunate but true that no other method exists.

Having said that, a future proposal could solve this.

Install

deno.land:

import * as mod from "https://deno.land/x/optio/mod.ts";

npm:

npm i @erboladaiorg/distinctio-tempora-quis

Usage

Type Option represents an optional value.

Every Option is either Some and contains a value, or None, and does not.

import {
  expect,
  None,
  type Option,
  Some,
} from "https://deno.land/x/optio/mod.ts";

function divide(numerator: number, denominator: number): Option<number> {
  if (!denominator) return None;

  return Some(numerator / denominator);
}

const opt = divide(100, 0);
expect(opt, "divide by 0");

All operators for Option are separated from prototype.

Feature

The pipeline operator will linearize the nesting.

import { map, type Option, match } from "https://deno.land/x/optio/mod.ts";

declare const option: Option<unknown>;
declare const mapper: (value: unknown) => unknown

const result = map(option, mapper)
  |> map(%, mapper)
  |> match(%, {
    Some: mapper,
    None:mapper
  })

proposal extensions allows for successive function adaptations, as in the Fluent API.

import { map, type Option, match } from "https://deno.land/x/optio/mod.ts";

declare const option: Option<unknown>;
declare const mapper: (value: unknown) => unknown

const result = option
  ::map(mapper)
  ::map(mapper)
  ::match({
    Some: mapper,
    None: mapper
  })

API

See deno doc for all APIs.

Acknowledgements

Contributing

See contribution.

License

MIT © 2023 Tomoki Miyauchi

intrinsicgetPrototypeOfstreamsBigUint64ArrayES2020makees-shimsObject.isvisualAsyncIteratorcallbackcopyspeedclassespackagesdescriptorsargparse@@toStringTagwarningtraverseec2settingsarraybuffersortspinnercollectionruntimecolourapiArrayBuffer#sliceregular expressiones2018waffpscliresolvepackage.jsonfindupnegativeECMAScript 2016cloudformationemitflattenfastifysymlinkUint32Arraygradients cssRegExp#flagsStyleSheetexpressiondirectoryECMAScript 2020performantarrayInt8ArraygetoptcloudwatchsnsmomentparentimmutablebrowserlistcircularshrinkwrapsuperagentstructuredClonesymlinksformatpackagefindprivate datatoStringTagdependenciesnopelistenerspluginbootstrap lessoutputconsumepositiveFunction.prototype.namehotclassnamesreducertimematchAllstringifyrequireautoprefixersyntaxerrorloadbalancingscheme-validationgroupreact-hook-formbootstrap css$.extendgenericsdescriptormetadataweaksetECMAScript 2023-0TypeBoxlinkWeakSetfluxcachetypedataViewMicrosoftviewpreprocessorassertiondebugloggerworkspace:*trim[[Prototype]]throatiterationfast-copyinternal slothooksJSON-SchemajselbnodecolumnjapanesearktypejoinamespipesameValueZeroes2015JSONreduceECMAScript 2021optimistastrminstallerArray.prototype.findLastIndexIteratorpathlesscsswgetReactiveExtensionsrgbArray.prototype.flattenes-abstractcorejsxawsttylivefunctionurlcommand-linetaskutil.inspectinWeakMapmonorepopolyfillArray.prototype.filterecmascriptargumentArrayreal-time.envtypeerrorprotocol-bufferswrapparseArray.prototype.includess3forEachtypesafebrowsertapesetImmediatenativeratelimitReflect.getPrototypeOfasciiTypeScriptESnextcoerciblepicomatchchromiumstylesheetspinnerscallbindrouteencryptionargvfindLastworkervalueoptimizerObservablejsdomautoscalingglobrapiddeep-clonecss lesscolorsjasmineeslint-plugin__proto__typedarraysrfc4122toobjectimportexportcomparefind-upprototypeavacallenumerablechaiexpressnodejswebinstallnested cssES2021lintestreegetOwnPropertyDescriptorES7styled-componentssharedenvironmentES2022deepcloneiteratorassignbufferObjectES2018browserslistpushredactslicefullPromisevalidhasOwnCSSshimchromereplayeverybyteOffsetcurlhashdiffsuperstructfunctionsWebSocketflatMapflatmruairbnbroute53isupemrECMAScript 2022Array.prototype.flatshellhas-ownminimalaccessordeepcopyvariables in cssstreamtostringtagschemetouchwalkflageslintconfigfileArray.prototype.findLastlengthiampropwordbreaksymbolgetterprotobuftestECMAScript 5Object.valuespostcss-pluginsymbolsclonegetvpcassertsbyteschemafiltersettergdprelasticachees8linewrapwhatwgBigInt64Arraycollection.es6limitconfigurablecssdeletesesObject.getPrototypeOfauthasyncrmdirwhichhttpsdatastructurestreams2opendomMapclass-validatorajaxgradients css3Int32Arraymapreducereadablestreamwatchingtapes5formmatchquerydynamodbpredictablejesttrimRightString.prototype.trimsequencespecform-validationtc39validatesetjsdiffbannermime-dbemojiloadingtermYAMLUint8ClampedArrayclientwatcheres6toolsextendlibphonenumberFloat32Arraypromiserm -frobjectconsoleObject.entriesWebSocketsponyfillSymbolerrorconnectreact-testing-libraryString.prototype.matchAllbusystylesquotedebuggerUint16Arraycreaterm -rfmovewalkingxhrcontainszodargsmochastableinputlookcss-in-jsES3RFC-6455querystringRxwritablelruECMAScript 2017prefixqsfunctionalhelpersbreakdropsharedarraybufferObservablesincludesdayjsdatechinesemobiledeterministicES2019protochannelECMAScript 3groupBycompilertsliba11ystringtypescriptdotenvSetES2016sortedstarterxtermcss variablemkdirpawesomesaucebyteLengthmodulesidunicodenameimmerwatchkarmadataendervalidationtoolkitefficientvaluesomitisConcatSpreadableindicatortoArraydependency managerfastcopyebsregexpcodesmimeenvtoSortedstoragegatewayRegExp.prototype.flagsamazonfullwidthjQueryless cssprettytypanionoffsetmimetypeskoreanECMAScript 2018apolloi18npreserve-symlinksrobustredux-toolkit0numberprogressconfigtestersqseventDispatchercall-boundfseventsqueueMicrotaskECMAScript 6widthInt16ArrayprivateeventssearchES6proxycensorcloudsearchpnpm9zeroserializebddlook-upsyntaxinvariantqueuereadablefsdeep-copyrecursiveregexcore-jsless.jsHyBiescapeworkflowTypedArraypackage managerbatchregular expressionsArray.prototype.flatMapstyleguidewatchFilecharactersnpmendpointmkdirURLredirectstateshamratecallboundObject.fromEntriesremoveobjstylecolorfastclonecharacterutilitiesArrayBufferelmes-shim APIdefinePropertyES2015l10ninspectpropertiesmiddlewarewaityupcorstsiefigletES2023trimEnddataviewpatchpropertyauthenticationtypesECMAScript 2019eventEmitterdefineserializationjsonpathlogcryptutilcloudfrontObject.keyskinesisglacierreact-hooksregularextensionclassnamemapfindLastIndexnegative zeromixinstypedlocationhasOwnPropertybindformscryptoagentUnderscoreslot_.extendflagses7boundmkdirsfile systemStreamsstatelesssimpledbrandomexecdom-testing-librarycompile lessreadtrimStartpostcsslogginghaskeyslockfilefastsafecolumnsajvECMAScript 7getintrinsiccall-bindjavascriptPushsetPrototypeOfstdlibFloat64ArrayES8equaleslintfolderdirfull-widthlazyhookformmatchesframeworkUint8Arrayhigher-orderfast-deep-clonestylingcheckextracomputed-typesreuseeast-asian-widthbcryptless compilerCSSStyleDeclarationes2017passwordkeyReactiveXtypedarray
@erboladaiorg/adipisci-repellendus-corporis@erboladaiorg/adipisci-aspernatur-explicabo@erboladaiorg/alias-iure@erboladaiorg/blanditiis-facere@erboladaiorg/consectetur-incidunt-a@erboladaiorg/cupiditate-pariatur-optio@erboladaiorg/cupiditate-consectetur-porro@erboladaiorg/cupiditate-ab@erboladaiorg/error-atque-ea@erboladaiorg/eligendi-reiciendis-id@erboladaiorg/molestias-omnis-commodi@erboladaiorg/molestias-repellat@erboladaiorg/quibusdam-autem@erboladaiorg/qui-nostrum-quo@erboladaiorg/quibusdam-itaque-tempora@erboladaiorg/quibusdam-ipsa@erboladaiorg/quia-maiores@erboladaiorg/reiciendis-inventore@erboladaiorg/vel-culpa@erboladaiorg/vero-fuga@erboladaiorg/ut-excepturi-dolore@erboladaiorg/velit-corporis-maiores@erboladaiorg/velit-adipisci-dicta@erboladaiorg/animi-dignissimos@erboladaiorg/aliquid-quis-voluptates@erboladaiorg/aliquid-rerum-nam@erboladaiorg/id-qui@erboladaiorg/illum-illum@erboladaiorg/impedit-ipsum-natus@erboladaiorg/illo-dolor-ipsam@erboladaiorg/impedit-ratione-quasi@erboladaiorg/laboriosam-inventore-natus@erboladaiorg/natus-harum-voluptatum@erboladaiorg/natus-illo-iste@erboladaiorg/necessitatibus-pariatur-sint@erboladaiorg/odio-libero-mollitia@erboladaiorg/odio-repellendus-doloremque@erboladaiorg/sed-eligendi-accusantium@erboladaiorg/sapiente-molestiae@erboladaiorg/tenetur-magnam@erboladaiorg/tenetur-magni-ab@erboladaiorg/consequuntur-assumenda@erboladaiorg/dolorum-velit@erboladaiorg/et-placeat@erboladaiorg/et-minus@erboladaiorg/iusto-sit-quasi@erboladaiorg/molestiae-voluptatibus@erboladaiorg/nesciunt-quas-saepe@erboladaiorg/possimus-praesentium-sint@erboladaiorg/quidem-molestiae@erboladaiorg/rem-quisquam-quasi@erboladaiorg/tempora-nisi@erboladaiorg/tempora-quas@erboladaiorg/vitae-aut@erboladaiorg/voluptate-alias-voluptate@erboladaiorg/aliquid-quasi@erboladaiorg/aliquid-impedit@erboladaiorg/corporis-error@erboladaiorg/cum-commodi-consequatur@erboladaiorg/cumque-possimus-delectus@erboladaiorg/doloribus-quos-officia@erboladaiorg/error-expedita-alias@erboladaiorg/esse-esse@erboladaiorg/perspiciatis-error-reprehenderit@erboladaiorg/officiis-maiores@erboladaiorg/placeat-natus@erboladaiorg/quaerat-excepturi@erboladaiorg/quae-in-veniam@erboladaiorg/quod-id@erboladaiorg/tempore-illo@erboladaiorg/temporibus-eligendi@erboladaiorg/voluptatem-eius@erboladaiorg/voluptates-nisi-quibusdam@erboladaiorg/voluptatibus-beatae@erboladaiorg/dignissimos-ducimus-perferendis@erboladaiorg/deserunt-eos-eum@erboladaiorg/deserunt-nobis@erboladaiorg/expedita-accusantium-nisi@erboladaiorg/in-accusamus-architecto@erboladaiorg/incidunt-dicta-magnam@erboladaiorg/nisi-id-consequatur@erboladaiorg/unde-sit@erboladaiorg/ut-dignissimos-laborum@erboladaiorg/distinctio-illum-harum@erboladaiorg/distinctio-provident-voluptatem@erboladaiorg/dolor-pariatur-modi@erboladaiorg/eaque-eaque-saepe@erboladaiorg/ducimus-necessitatibus-omnis@erboladaiorg/ea-saepe@erboladaiorg/itaque-incidunt-quis@erboladaiorg/libero-a@erboladaiorg/libero-possimus@erboladaiorg/magnam-cumque-non@erboladaiorg/porro-laboriosam@erboladaiorg/quas-officiis@erboladaiorg/quam-id-itaque@erboladaiorg/quod-nesciunt-cum@erboladaiorg/totam-mollitia-tenetur@erboladaiorg/asperiores-earum-quaerat@erboladaiorg/assumenda-cupiditate
3.2.24

1 year ago

3.2.23

1 year ago

5.7.65

12 months ago

3.2.25

1 year ago

3.2.20

1 year ago

3.2.22

1 year ago

3.2.21

1 year ago

5.10.72

12 months ago

5.7.66

12 months ago

5.10.74

12 months ago

5.10.73

12 months ago

5.9.71

12 months ago

5.9.72

12 months ago

5.9.70

12 months ago

4.5.60

1 year ago

2.1.14

1 year ago

4.6.62

1 year ago

4.6.60

1 year ago

4.6.61

1 year ago

4.4.41

1 year ago

4.4.40

1 year ago

5.9.69

12 months ago

4.2.25

1 year ago

4.2.26

1 year ago

5.11.101

11 months ago

5.6.62

1 year ago

5.11.100

11 months ago

5.11.103

11 months ago

5.6.64

12 months ago

5.11.102

11 months ago

5.6.63

12 months ago

4.4.32

1 year ago

4.4.36

1 year ago

4.4.35

1 year ago

4.4.34

1 year ago

4.4.33

1 year ago

5.11.77

12 months ago

5.11.76

12 months ago

4.4.39

1 year ago

5.11.79

11 months ago

4.4.38

1 year ago

5.11.78

11 months ago

4.4.37

1 year ago

5.6.65

12 months ago

5.11.75

12 months ago

5.11.74

12 months ago

5.11.112

10 months ago

5.11.80

11 months ago

5.11.111

10 months ago

5.11.114

10 months ago

5.11.82

11 months ago

5.11.113

10 months ago

5.11.81

11 months ago

5.11.110

10 months ago

2.2.17

1 year ago

2.2.18

1 year ago

2.2.15

1 year ago

2.2.16

1 year ago

2.2.14

1 year ago

5.11.109

10 months ago

5.11.88

11 months ago

5.11.108

10 months ago

5.11.87

11 months ago

5.11.89

11 months ago

5.11.105

11 months ago

5.11.84

11 months ago

5.11.104

11 months ago

5.11.83

11 months ago

5.11.107

11 months ago

5.11.86

11 months ago

5.11.106

11 months ago

5.11.85

11 months ago

5.11.91

11 months ago

5.11.90

11 months ago

5.11.93

11 months ago

5.11.92

11 months ago

5.8.66

12 months ago

2.2.19

1 year ago

5.11.99

11 months ago

2.2.20

1 year ago

5.11.98

11 months ago

5.11.95

11 months ago

5.8.67

12 months ago

5.11.94

11 months ago

5.8.68

12 months ago

5.11.97

11 months ago

5.8.69

12 months ago

5.11.96

11 months ago

4.5.50

1 year ago

4.5.51

1 year ago

4.5.54

1 year ago

4.3.31

1 year ago

4.5.55

1 year ago

4.3.30

1 year ago

4.5.52

1 year ago

4.5.53

1 year ago

4.5.58

1 year ago

4.5.59

1 year ago

4.5.56

1 year ago

4.5.57

1 year ago

4.3.32

1 year ago

4.5.43

1 year ago

4.5.44

1 year ago

4.5.41

1 year ago

4.5.42

1 year ago

4.5.47

1 year ago

4.5.48

1 year ago

4.5.45

1 year ago

4.5.46

1 year ago

4.3.28

1 year ago

4.3.27

1 year ago

4.5.49

1 year ago

4.3.26

1 year ago

4.3.29

1 year ago

2.1.13

1 year ago

2.0.13

1 year ago

1.0.11

1 year ago

1.0.13

1 year ago

1.0.12

1 year ago

1.0.10

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago