5.19.119 • Published 10 months ago

@patrtorg/dicta-aliquid-occaecati v5.19.119

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

@patrtorg/dicta-aliquid-occaecati · GitHub license npm Package Status Test Status

Type checking utils.

Installation

npm install @patrtorg/dicta-aliquid-occaecati --save

Usage

const t = require('@patrtorg/dicta-aliquid-occaecati')

const objConstraint = t.object.is({
  num: t.number.gte(0).required,
  str: t.string.match(/\d+/).required
}).required

const result = objConstraint.validate({ num: 1, str: '1' })
// result = { valid: true, errors: [] }

const result = objConstraint.validate({ num: 0, str: '1' })
// result = {
//  valid: false,
//  errors: [{ name: 'num', expected: 'gte(0)', actual: 0 }]
// }

Built-in constraints

  • bool
    • bool.required
    • bool.truthy
    • bool.falsy
  • number
    • number.required
    • number.eq(<number>)
    • number.neq(<number>)
    • number.gt(<number>)
    • number.gte(<number>)
    • number.lt(<number>)
    • number.lte(<number>)
  • decimal
    • decimal.required
    • decimal.eq(<number|string>)
    • decimal.neq(<number|string>)
    • decimal.gt(<number|string>)
    • decimal.gte(<number|string>)
    • decimal.lt(<number|string>)
    • decimal.lte(<number|string>)
  • string
    • string.required
    • string.lenEq(<number>)
    • string.empty
    • string.notEmpty
    • string.match(<regexp>)
  • time
    • time.required
    • time.eq(<number|string|Date>)
    • time.neq(<number|string|Date>)
    • time.gt(<number|string|Date>)
    • time.gte(<number|string|Date>)
    • time.lt(<number|string|Date>)
    • time.lte(<number|string|Date>)
  • array
    • array.required
    • array.lenEq(<number>)
    • array.empty
    • array.notEmpty
    • array.of(<itemConstraint>)
    • array.is([<itemConstraint>, ...])
  • object
    • object.required
    • object.eq(<object>)
    • object.match(<object>)
    • object.is({ key: <constraint>, ... })
    • object.like({ key: <constraint>, ... })
  • nil
  • eq(<any>)
    • eq(<any>).required
  • neq(<any>)
    • neq(<any>).required
  • oneOf([<any>, ...])
    • oneOf([<any>, ...]).required
  • valueOf({ key: <any>, ... })
    • valueOf({ key: <any>, ... }).required
  • use
    • use(({ parent, value }) => constraint).required

License

MIT

positivereact-hook-formMapindicatorstructuredCloneES7tslib256specSetwhichdiffthreeArrayBuffer.prototype.sliceschemaconfigpromisesresolvevalidcachegetoptES2016joieslintconfigroutingdirectoryvestRxJSs3wafReactiveExtensionsworkflowcharactersclonemodulessetPrototypeOfstartsequencenodepolyfillESnextmoveInt16ArraytypedarrayPushrangeerrorslotmomentcallbindfindLastIndexexpressionbyteOffsetexecutableObject.ismimetypescharacterspinnersJSONrfc4122_.extendmake dirflatMapemitvalidationconsolequotetestingtsdeletetypedarraysrm -rfloggingReactiveXutilitiesttyweaksethookscompilerES2023intrinsicponyfillArray.prototype.flatcolorsargswrapinspectstringArray.prototype.containsrgbgdprrmdirutil.inspectiteratecloudsearchchaiebsgetintrinsices8breakhelperlockfilefast-deep-copypackagesisConcatSpreadablespringutilRegExp.prototype.flagspopmotionregexreadablestreamimmutablefullwidthhookforml10ntostringtagfpsconvertStyleSheetappUint16ArraytoStringTagimmereslintpluginString.prototype.matchAllaccessibilityfast-copyECMAScript 7CSSStyleDeclarationnpmlazycommandtrimEndtoSortedstoragegatewaycloudwatchtesternameskinesistrimRighttyped arraymimeObject.assignwritehardlinksmonorepoequalicuoptimiststylelinkvpcphonebindgetPrototypeOfaccessorposedebugtypeshigher-orderWeakSetvalueiterationqsguiddeepcopyECMAScript 2022trimStarttypesafenopeES2019URLWebSocketslengthcoveragedefaultsimple cacheinternalyamlextendclientoutputObservablespruneregularzodhasOwnPropertydefinedeeptypeinvariantdependency managerconcatMapcheckapiarrayproxyeventsYAMLdomBigUint64ArraydynamodbsharedTypedArrayUint8ClampedArrayECMAScript 3preserve-symlinkses6waapishrinkwraplruprefixserializationshamrm -frzerojsfastifyidleFunction.prototype.namelimitedurlsthrottleansiObjecthttpsviewcurlenvironmentsfindLastsymbolawssuperstructPromiserequireperformanceunicodemakedescriptorsserializerconfigurablepluginchromiumgetterobjArray.prototype.filterES2022es2016loggerwhatwgredirectformsHyBischemeurlchromefunction.lengthUnderscorelookdataefficientmodulereuseec2sortedkey parclass-validatorjsdomlocationpushpaththroatpropertyelasticachejQuerytddbusyenvformattesteast-asian-widthcomputed-typesdotenvdeterministicmergeapolloescapecss-in-jsqueuestableestreespawnmkdirfromtaskpromisees7Int32ArrayglobworkerendpointmkdirsJSON-Schemanegative zeroparsingdataviewsetterprivateextensiontraversepyyamllintfilterhas-owncolumnsexpressglobalfsstreamsarktypeECMAScript 2017es-shimsfullserializeparentses-abstractdayjsformattingenderreadablevarseverybrowserlistECMAScript 5queryform-validationparseincludescopyArray.prototype.includesRFC-6455rdskey valuemime-dbelbdropgetObject.entrieslimittypaniongenericsrapidimportstylingcryptostarterbyteglobalsdatastructurereducershebangpersistentmobileopensduplexcallbackidcommanderfunctionArrayBufferprivate dataomitString.prototype.trimnegativeanimationsyntaxerrorupeventEmittercharsetxhrawesomesaucechildpropscheme-validationdirsescreatesnsreact-hookscoreargumentsmapsymlinkkeypostcssArray.prototype.findLastIndexTypeBoxrmhasreactastdescriptorwarningwidthi18nES2021eventDispatcherdependenciesstatelesses2018es2015linewrapredux-toolkitcontainssuperagentSymbolassignconcatquerystringbatchtakeECMAScript 2019ECMAScript 2018launchCSSsqslook-upnameasyncFloat64Arraycall-boundsyntaxvalidatecoercibleregular expressionsbrowserslista11ysymbolsregexpbuffersratelimitglaciermapreducechannelinstrumentationWebSocketesespreeInt8Array0-0xdg-opentypedjshintflagsreact posewebsitecircularassertionreducedeep-cloneIteratorassertcolorinstallreadtrimLeftcensorRegExp#flagstoobjectdefinePropertyslicees2017artdom-testing-librarydebuggerhashkarmaECMAScript 2015wordwrapwordbreakmochaprocessspinnerprettyoncerecursivereact animationtoArraystreamextramatchesrobustdeepclonematchinternal slotArrayESstreams2utilityfind-upenumerableTypeScriptairbnbremovegetOwnPropertyDescriptorchineseArray.prototype.flatMapsymlinksemrStreammulti-packageloadingfile systempicomatchparserflattenregular expressionAsyncIteratorforEachbundlingelectronautoprefixervisualreal-timeObject.valuesownfetchcallboundeditorconcurrencycollection.es6objectes5eslint3dWeakMapMicrosoftES2015flagxtermfunctionsgesturesidentifiersmrubrowserObject.keysperformantfile cachefinduplanguageObject.getPrototypeOfReflect.getPrototypeOfnativeBigInt64ArrayjestdataViewES8jsdiffUint8Arrayargumentamazonfast-clonecore-jspackage managersettingsfasttypescriptfunctionaltypeofmatchAllcliagentinstallervariablesstdlibjsonshellhelpers__proto__requestECMAScript 2023call-binddateUint32ArrayArray.prototype.findLasttermnodejsbufferprotocol-bufferscmdconsumeprototypexdgfilecloudtrailrandomfindkoreansearchcompareawaitavaoffsetparentES2018textroute53ecmascriptexecwaitwalkbannerinputcollectionsameValueZerostyled-componentsopenerbundlerES6assertsio-tsURLSearchParamsyupObservableSymbol.toStringTagpackageisuninstallbddopenbeanstalklogcjkjapaneseequalitycloudformationnumberhasOwnweakmappropertiesgroupfastcloneemojigroupBytoolsECMAScript 2020tapedeep-copyimportexportcodesqueueMicrotaskoptioniteratorlistenerssideiamruntimefastcopyfixed-widthtoolkitswfintouchajvboundECMAScript 2021shimECMAScript 2016optimizertimeautoscalingarraysbyteLengthES2017tapsomeasciieslint-pluginECMAScript 6redactArray.prototype.flattenjsxpipemkdirpreact-testing-libraryspeedtelephoneuuid
5.19.119

10 months ago

5.18.118

10 months ago

5.18.119

10 months ago

2.5.47

1 year ago

2.5.43

1 year ago

4.13.70

12 months ago

2.5.44

1 year ago

4.15.94

11 months ago

2.5.45

1 year ago

1.4.26

1 year ago

2.5.46

1 year ago

1.4.25

1 year ago

4.13.73

12 months ago

1.4.28

1 year ago

4.15.95

11 months ago

2.5.40

1 year ago

1.4.27

1 year ago

4.13.71

12 months ago

2.5.41

1 year ago

4.13.72

12 months ago

2.5.42

1 year ago

1.4.29

1 year ago

5.15.97

11 months ago

5.15.96

11 months ago

5.15.95

11 months ago

4.13.69

12 months ago

4.8.56

1 year ago

4.8.55

1 year ago

4.8.58

1 year ago

4.8.57

1 year ago

1.4.31

1 year ago

4.8.59

1 year ago

1.4.30

1 year ago

1.4.33

1 year ago

1.4.32

1 year ago

1.4.35

1 year ago

1.2.12

1 year ago

1.4.34

1 year ago

1.2.13

1 year ago

5.15.99

11 months ago

1.4.37

1 year ago

5.15.98

11 months ago

1.4.36

1 year ago

1.2.14

1 year ago

1.2.15

1 year ago

5.15.112

10 months ago

4.10.61

12 months ago

5.15.111

10 months ago

4.10.62

12 months ago

4.9.59

1 year ago

4.10.60

12 months ago

5.15.105

10 months ago

5.15.104

10 months ago

5.15.107

10 months ago

5.15.106

10 months ago

5.15.101

11 months ago

5.15.100

11 months ago

5.15.103

10 months ago

5.15.102

11 months ago

5.17.112

10 months ago

5.17.113

10 months ago

5.15.109

10 months ago

4.6.51

1 year ago

5.17.114

10 months ago

5.15.108

10 months ago

4.6.52

1 year ago

4.6.50

1 year ago

4.6.53

1 year ago

4.6.54

1 year ago

2.6.48

1 year ago

2.6.49

1 year ago

4.14.92

11 months ago

4.14.93

11 months ago

3.6.50

1 year ago

5.15.110

10 months ago

4.14.90

11 months ago

4.14.91

11 months ago

2.6.47

1 year ago

4.14.94

11 months ago

4.14.89

11 months ago

4.14.87

11 months ago

4.14.88

11 months ago

2.6.50

1 year ago

4.12.69

12 months ago

5.18.116

10 months ago

4.7.54

1 year ago

5.18.117

10 months ago

4.7.55

1 year ago

2.4.38

1 year ago

2.4.37

1 year ago

4.14.81

11 months ago

4.14.82

11 months ago

4.14.80

11 months ago

5.18.114

10 months ago

4.14.85

11 months ago

1.3.17

1 year ago

5.18.115

10 months ago

4.14.86

11 months ago

1.3.18

1 year ago

4.14.83

11 months ago

1.3.15

1 year ago

4.14.84

11 months ago

1.3.16

1 year ago

4.14.78

11 months ago

4.14.79

11 months ago

4.14.76

11 months ago

1.3.19

1 year ago

4.14.77

11 months ago

4.9.60

12 months ago

1.3.20

1 year ago

1.3.21

1 year ago

1.3.24

1 year ago

1.3.25

1 year ago

1.3.22

1 year ago

1.3.23

1 year ago

4.14.74

12 months ago

4.14.75

11 months ago

4.14.73

12 months ago

4.11.65

12 months ago

4.11.64

12 months ago

4.11.63

12 months ago

4.11.62

12 months ago

4.11.69

12 months ago

4.11.68

12 months ago

4.11.67

12 months ago

4.11.66

12 months ago

5.16.112

10 months ago

2.5.38

1 year ago

2.5.39

1 year ago

1.2.11

1 year ago

1.1.9

1 year ago

1.1.8

1 year ago

1.1.11

1 year ago

1.1.10

1 year ago

1.1.7

1 year ago

1.1.6

1 year ago

1.1.5

1 year ago

1.1.4

1 year ago

1.1.3

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