2.9.99 • Published 1 year ago

@diotoborg/voluptatem-quod-magnam v2.9.99

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

NPM version NPM total downloads

Usage

you can use interface and type by importing Interface and Type.

const { Interface, Type } = require('@diotoborg/voluptatem-quod-magnam');

Interface:

const { 
  Interface: inter, 
  interfaceUtils 
} = require('@diotoborg/voluptatem-quod-magnam'); // install the package

const ProfileInterface = {
  Interface: true, // required and must be at first
  
  name: 'string',
  age: 'number',
  gender: interfaceUtils.or('male', 'female'), // to use multi types
  'job[?]': 'string' // not required
};

const myProfile = {
  name: 'someone',
  age: 99,
  gender: 'male'
  // job not required
};

const checkProfile = inter.check(ProfileInterface, myProfile);
console.log(checkProfile); // true

in this example we create interface called ProfileInterface by adding Interface: true in the object to make a interface which is required and must be at top or in first of interface-object.

key options

you can add options to key like the example above, by adding [] at the end of key and add inside it:

  • ? means the key not required, e.g:
const someInterface = {
  'key': 'string', // require
  'anotherKey[?]': '...' // not require
}

const someObject = {
  'key': 'Hello World'
} 
// no errors, 'anotherKey' not required.
  • ! means the key cannot be changed, e.g:
{
  'key[!]': 'value'
}

// after use interface-check
someObject['key'] = 'new value';
console.log(someObject['key']); // value

also you can use both, e.g:

{
  'key[?!]': 'value'
}

Type:

const { Type: type } = require('@diotoborg/voluptatem-quod-magnam');

const text = 'Hello World';
const getTextType = type.typeOf(text);
console.log(getTextType); // string
const { Type: type } = require('@diotoborg/voluptatem-quod-magnam');

const text = 'Hello World';
const number = 123;

const isTypeEqual = type.typeOfEqual(text, number);

console.log(isTypeEqual); // false

in above example we import type at first then use function called typeOf to get type of value which is a package called kind-of for more information.

in second example we use function called typeOfEqual to check if first-value type equal second-value type.

features & bugs

you can create a issue to share with us features and bugs on GitHub.

Contributing

1- fork the GitHub repository. 2- make your changes. 3- create pull request on GitHub. thanks ❤️ for your contributing.

ArrayreadablestreambanneranimationeslintpluginHyBiSymboldefinePropertywhatwgstatussqsReflect.getPrototypeOfgroupenumerableassertsCSSStyleDeclarationUint16Arraydescriptorprivate datawritefindLastperformantexecuteelectronArray.prototype.flatfixed-widthio-tsfast-copybootstrap lessparsehotphonenamescss variablecore-jspyyamlquerystringreversed6to5dataViewencryptionRxforEacherrorglobal this valueBigInt64Arrayjsutilitystateecmascripthookformchaicreateisgradients css3apibrowserlistauthenticationpasswordsetImmediatepinosetterxtermnamechineseTypeScriptthreeRegExp.prototype.flagsbootstrap cssinpathtrimEndsesenvironmentcollectioneast-asian-widthtrimqueueMicrotaskObject.entriesexpressescapejson-schemaes6form-validationgroupByvariables in cssECMAScript 2017assertschemaajaxdeletecoerciblefetchelasticachebeanstalklinkchild@@toStringTagES8-0colorsES2017urllog[[Prototype]]inputYAMLhandlersgraphqllibphonenumberimmertoobjectRxJSgetoptcalles2017variablesjQuerycontainsapollocopydatenativeES2015onceregexpexpressionextendpositiveES2021ObservableES2018internalspecdeepclonesetemites2015cloudwatchES2019uploadclientrandomparserbindES2016varsredux-toolkittypesafeliveclasseswafsharedarraybufferwgetObject.assigntypedarraymkdirpreplaypostcssglobalThisawesomesaucehasOwnPropertyvisualrequestES2023whichjestECMAScript 2015lengthsigneddynamodbless mixinsrdswidthObservablessyntaxerrortsglobalfast-clonereact posesequenceRFC-6455requirevaluesagentObject.valuesjsdiffconsttouchlocalelmcliflagES5s3everyimmutablezxcensorcolumnenvfullpredictableimportpreprocessorsortedECMAScript 2020binvalidatorcolumnsinstallerqueryArray.prototype.containsbuffersargumenttraverseJSONtextpromisebrowserresolvetypedtypeutilhashjshinttransporttostringtagnopeclassnamedependency managerURLutilitiesjsdombundlingequalauthreactiamObject.keysstylingvpcframerspringwalkvalidationes-abstractlastflatMappuremakeregular-expressionspinnersURLSearchParamsreact animationglobal objectArray.prototype.flatMapreact-componentArrayBuffer#slicehooksflattengetteres2018workertrimStarttc39toolkitsettingsjoicomputed-typeshelperbddnegative zerocss nestingtoReversedreducecollection.es6call-bindidentifiers.gitignoreperformancedataviewrfc9562styled-componentslistenerspackage managersignaldeep-cloneprunevalidcheckoptimizerbusymacoshelpersshellsuperagentStreamsponyfillsymlinksdropfromObject.fromEntriesnegativeUint8ArraystarterECMAScript 2018less cssprotocol-bufferschromiumharmonyasterisksregular expressioninferenceCSS.envcommandtyped arrayjson-schema-validationloggerweaksetcachergbcodesECMAScript 2022ArrayBufferprettypolyfillfunctionalaccessorintrinsicnodejsgetintrinsic256extrabcrypttypedarrayscallbacksubprocessidlexhrnested cssbyteOffsetFloat32ArrayeventDispatcherbundleropenssldragimportexportshimtranspilepluginArray.prototype.filterfluxsliceastreadableloadbalancingstylesheetweakmapfunctiontrimLeftstylecloudfrontajvmapreducesomecss-in-jsstringifyyamlindicatordescriptionFloat64ArrayfsserializationnumberSymbol.toStringTagtypeerrorInt8ArraypopmotionmodulesFunction.prototype.nameeslrumobileflagselbrulesdom-testing-libraryWebSocketes8warningsimpledbdatastructurereact-hooksexecfiletoSortedlockfiletddtake$.extendscheme-validationschemepropertystyleguideobjectfnmatchIteratorfullwidtheventsmrusymlinklazycallbindhttpinterruptsletdombinariestypesconcatfast-deep-cloneposedefineomitasynccss lessargsTypeBoxfastECMAScript 2016matchespackage.jsonkeydayjsworkspace:*keysshrinkwrapECMAScript 2019eslintconfigvarstreamPushformattingtoArrayfunction.lengthuuidshebang0iterateassignsuperstructfast-deep-copyefficientpropertiesdescriptorssetPrototypeOfhasES2022arrayglaciermomentReactiveExtensionseslint-pluginrangeerrorcloudformationjavascriptbytecompilerdires5emrl10nbabel-coreeventEmitterfigletasciiwindowsswfslottypanioncryptcommanderpushttyairbnbcolorvieweslintignoreexit-codeautoscalingkinesisformcorepreserve-symlinksdeepcopymixinsfpsECMAScript 6picomatchparsingutilsgetPrototypeOfpersistentnpmignorerecursivecssruntimeregexautoprefixermkdircloudsearchjsonschemaansiECMAScriptconfigdeterministicconsolemodulepnpm9monorepofastify
2.9.99

1 year ago

2.9.98

1 year ago

2.9.97

1 year ago

2.9.96

1 year ago

2.9.95

1 year ago

2.9.94

1 year ago

2.9.93

1 year ago

2.9.92

1 year ago

2.8.92

1 year ago

2.8.91

1 year ago

2.8.90

1 year ago

2.8.89

1 year ago

2.7.89

1 year ago

2.7.88

1 year ago

2.7.87

1 year ago

2.7.86

1 year ago

2.7.85

1 year ago

2.7.84

1 year ago

2.6.84

1 year ago

2.6.83

1 year ago

2.6.82

1 year ago

2.6.81

1 year ago

2.6.80

1 year ago

2.6.79

1 year ago

2.6.78

1 year ago

2.6.77

1 year ago

2.6.76

1 year ago

2.6.75

1 year ago

2.6.74

1 year ago

2.6.73

1 year ago

2.6.72

1 year ago

2.5.72

1 year ago

2.5.71

1 year ago

2.5.70

1 year ago

2.5.69

1 year ago

2.5.68

1 year ago

2.5.67

1 year ago

2.5.66

1 year ago

2.5.65

1 year ago

2.5.64

1 year ago

2.5.63

1 year ago

2.5.62

1 year ago

2.5.61

1 year ago

2.5.60

1 year ago

2.5.59

1 year ago

2.5.58

1 year ago

2.4.58

1 year ago

2.4.57

1 year ago

2.3.57

1 year ago

2.2.57

1 year ago

2.2.56

1 year ago

2.2.55

1 year ago

2.2.54

1 year ago

2.2.53

1 year ago

2.2.52

1 year ago

2.2.51

1 year ago

2.2.50

1 year ago

2.2.49

1 year ago

2.2.48

1 year ago

2.2.47

1 year ago

2.2.46

1 year ago

2.2.45

1 year ago

2.2.44

1 year ago

2.2.43

1 year ago

2.2.42

1 year ago

1.2.42

1 year ago

1.2.41

1 year ago

1.2.40

1 year ago

1.2.39

1 year ago

1.2.38

1 year ago

1.2.37

1 year ago

1.2.36

1 year ago

1.2.35

1 year ago

1.2.34

1 year ago

1.2.33

1 year ago

1.2.32

1 year ago

1.2.31

1 year ago

1.2.30

1 year ago

1.2.29

1 year ago

1.2.28

1 year ago

1.2.27

1 year ago

1.2.26

1 year ago

1.2.25

1 year ago

1.2.24

1 year ago

1.1.24

1 year ago

1.1.23

1 year ago

1.1.22

1 year ago

1.1.21

1 year ago

1.1.20

1 year ago

1.1.19

1 year ago

1.1.18

1 year ago

1.1.17

1 year ago

1.1.16

1 year ago

1.1.15

1 year ago

1.1.14

1 year ago

1.1.13

1 year ago

1.1.12

1 year ago

1.1.11

1 year ago

1.1.10

1 year ago

1.1.9

1 year ago

1.1.8

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.1.2

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago