5.19.119 • Published 2 years ago

@patrtorg/dicta-aliquid-occaecati v5.19.119

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years 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

2 years ago

5.18.118

2 years ago

5.18.119

2 years ago

2.5.47

2 years ago

2.5.43

2 years ago

4.13.70

2 years ago

2.5.44

2 years ago

4.15.94

2 years ago

2.5.45

2 years ago

1.4.26

2 years ago

2.5.46

2 years ago

1.4.25

2 years ago

4.13.73

2 years ago

1.4.28

2 years ago

4.15.95

2 years ago

2.5.40

2 years ago

1.4.27

2 years ago

4.13.71

2 years ago

2.5.41

2 years ago

4.13.72

2 years ago

2.5.42

2 years ago

1.4.29

2 years ago

5.15.97

2 years ago

5.15.96

2 years ago

5.15.95

2 years ago

4.13.69

2 years ago

4.8.56

2 years ago

4.8.55

2 years ago

4.8.58

2 years ago

4.8.57

2 years ago

1.4.31

2 years ago

4.8.59

2 years ago

1.4.30

2 years ago

1.4.33

2 years ago

1.4.32

2 years ago

1.4.35

2 years ago

1.2.12

2 years ago

1.4.34

2 years ago

1.2.13

2 years ago

5.15.99

2 years ago

1.4.37

2 years ago

5.15.98

2 years ago

1.4.36

2 years ago

1.2.14

2 years ago

1.2.15

2 years ago

5.15.112

2 years ago

4.10.61

2 years ago

5.15.111

2 years ago

4.10.62

2 years ago

4.9.59

2 years ago

4.10.60

2 years ago

5.15.105

2 years ago

5.15.104

2 years ago

5.15.107

2 years ago

5.15.106

2 years ago

5.15.101

2 years ago

5.15.100

2 years ago

5.15.103

2 years ago

5.15.102

2 years ago

5.17.112

2 years ago

5.17.113

2 years ago

5.15.109

2 years ago

4.6.51

2 years ago

5.17.114

2 years ago

5.15.108

2 years ago

4.6.52

2 years ago

4.6.50

2 years ago

4.6.53

2 years ago

4.6.54

2 years ago

2.6.48

2 years ago

2.6.49

2 years ago

4.14.92

2 years ago

4.14.93

2 years ago

3.6.50

2 years ago

5.15.110

2 years ago

4.14.90

2 years ago

4.14.91

2 years ago

2.6.47

2 years ago

4.14.94

2 years ago

4.14.89

2 years ago

4.14.87

2 years ago

4.14.88

2 years ago

2.6.50

2 years ago

4.12.69

2 years ago

5.18.116

2 years ago

4.7.54

2 years ago

5.18.117

2 years ago

4.7.55

2 years ago

2.4.38

2 years ago

2.4.37

2 years ago

4.14.81

2 years ago

4.14.82

2 years ago

4.14.80

2 years ago

5.18.114

2 years ago

4.14.85

2 years ago

1.3.17

2 years ago

5.18.115

2 years ago

4.14.86

2 years ago

1.3.18

2 years ago

4.14.83

2 years ago

1.3.15

2 years ago

4.14.84

2 years ago

1.3.16

2 years ago

4.14.78

2 years ago

4.14.79

2 years ago

4.14.76

2 years ago

1.3.19

2 years ago

4.14.77

2 years ago

4.9.60

2 years ago

1.3.20

2 years ago

1.3.21

2 years ago

1.3.24

2 years ago

1.3.25

2 years ago

1.3.22

2 years ago

1.3.23

2 years ago

4.14.74

2 years ago

4.14.75

2 years ago

4.14.73

2 years ago

4.11.65

2 years ago

4.11.64

2 years ago

4.11.63

2 years ago

4.11.62

2 years ago

4.11.69

2 years ago

4.11.68

2 years ago

4.11.67

2 years ago

4.11.66

2 years ago

5.16.112

2 years ago

2.5.38

2 years ago

2.5.39

2 years ago

1.2.11

2 years ago

1.1.9

2 years ago

1.1.8

2 years ago

1.1.11

2 years ago

1.1.10

2 years ago

1.1.7

2 years ago

1.1.6

2 years ago

1.1.5

2 years ago

1.1.4

2 years ago

1.1.3

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago