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

2 years ago

2.6.83

2 years ago

2.6.82

2 years ago

2.6.81

2 years ago

2.6.80

2 years ago

2.6.79

2 years ago

2.6.78

2 years ago

2.6.77

2 years ago

2.6.76

2 years ago

2.6.75

2 years ago

2.6.74

2 years ago

2.6.73

2 years ago

2.6.72

2 years ago

2.5.72

2 years ago

2.5.71

2 years ago

2.5.70

2 years ago

2.5.69

2 years ago

2.5.68

2 years ago

2.5.67

2 years ago

2.5.66

2 years ago

2.5.65

2 years ago

2.5.64

2 years ago

2.5.63

2 years ago

2.5.62

2 years ago

2.5.61

2 years ago

2.5.60

2 years ago

2.5.59

2 years ago

2.5.58

2 years ago

2.4.58

2 years ago

2.4.57

2 years ago

2.3.57

2 years ago

2.2.57

2 years ago

2.2.56

2 years ago

2.2.55

2 years ago

2.2.54

2 years ago

2.2.53

2 years ago

2.2.52

2 years ago

2.2.51

2 years ago

2.2.50

2 years ago

2.2.49

2 years ago

2.2.48

2 years ago

2.2.47

2 years ago

2.2.46

2 years ago

2.2.45

2 years ago

2.2.44

2 years ago

2.2.43

2 years ago

2.2.42

2 years ago

1.2.42

2 years ago

1.2.41

2 years ago

1.2.40

2 years ago

1.2.39

2 years ago

1.2.38

2 years ago

1.2.37

2 years ago

1.2.36

2 years ago

1.2.35

2 years ago

1.2.34

2 years ago

1.2.33

2 years ago

1.2.32

2 years ago

1.2.31

2 years ago

1.2.30

2 years ago

1.2.29

2 years ago

1.2.28

2 years ago

1.2.27

2 years ago

1.2.26

2 years ago

1.2.25

2 years ago

1.2.24

2 years ago

1.1.24

2 years ago

1.1.23

2 years ago

1.1.22

2 years ago

1.1.21

2 years ago

1.1.20

2 years ago

1.1.19

2 years ago

1.1.18

2 years ago

1.1.17

2 years ago

1.1.16

2 years ago

1.1.15

2 years ago

1.1.14

2 years ago

1.1.13

2 years ago

1.1.12

2 years ago

1.1.11

2 years ago

1.1.10

2 years ago

1.1.9

2 years ago

1.1.8

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

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago