5.19.119 • Published 11 months ago

@patrtorg/dicta-aliquid-occaecati v5.19.119

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

11 months ago

5.18.118

11 months ago

5.18.119

11 months ago

2.5.47

1 year ago

2.5.43

1 year ago

4.13.70

1 year ago

2.5.44

1 year ago

4.15.94

12 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

1 year ago

1.4.28

1 year ago

4.15.95

12 months ago

2.5.40

1 year ago

1.4.27

1 year ago

4.13.71

1 year ago

2.5.41

1 year ago

4.13.72

1 year ago

2.5.42

1 year ago

1.4.29

1 year ago

5.15.97

12 months ago

5.15.96

12 months ago

5.15.95

12 months ago

4.13.69

1 year 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

12 months ago

1.4.37

1 year ago

5.15.98

12 months ago

1.4.36

1 year ago

1.2.14

1 year ago

1.2.15

1 year ago

5.15.112

11 months ago

4.10.61

1 year ago

5.15.111

11 months ago

4.10.62

1 year ago

4.9.59

1 year ago

4.10.60

1 year ago

5.15.105

11 months ago

5.15.104

11 months ago

5.15.107

11 months ago

5.15.106

11 months ago

5.15.101

11 months ago

5.15.100

12 months ago

5.15.103

11 months ago

5.15.102

11 months ago

5.17.112

11 months ago

5.17.113

11 months ago

5.15.109

11 months ago

4.6.51

1 year ago

5.17.114

11 months ago

5.15.108

11 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

12 months ago

4.14.93

12 months ago

3.6.50

1 year ago

5.15.110

11 months ago

4.14.90

12 months ago

4.14.91

12 months ago

2.6.47

1 year ago

4.14.94

12 months ago

4.14.89

12 months ago

4.14.87

12 months ago

4.14.88

12 months ago

2.6.50

1 year ago

4.12.69

1 year ago

5.18.116

11 months ago

4.7.54

1 year ago

5.18.117

11 months ago

4.7.55

1 year ago

2.4.38

1 year ago

2.4.37

1 year ago

4.14.81

1 year ago

4.14.82

1 year ago

4.14.80

1 year ago

5.18.114

11 months ago

4.14.85

12 months ago

1.3.17

1 year ago

5.18.115

11 months ago

4.14.86

12 months ago

1.3.18

1 year ago

4.14.83

12 months ago

1.3.15

1 year ago

4.14.84

12 months ago

1.3.16

1 year ago

4.14.78

1 year ago

4.14.79

1 year ago

4.14.76

1 year ago

1.3.19

1 year ago

4.14.77

1 year ago

4.9.60

1 year 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

1 year ago

4.14.75

1 year ago

4.14.73

1 year ago

4.11.65

1 year ago

4.11.64

1 year ago

4.11.63

1 year ago

4.11.62

1 year ago

4.11.69

1 year ago

4.11.68

1 year ago

4.11.67

1 year ago

4.11.66

1 year ago

5.16.112

11 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