2.9.99 • Published 10 months ago

@diotoborg/voluptatem-quod-magnam v2.9.99

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

10 months ago

2.9.98

10 months ago

2.9.97

10 months ago

2.9.96

10 months ago

2.9.95

10 months ago

2.9.94

10 months ago

2.9.93

10 months ago

2.9.92

10 months ago

2.8.92

10 months ago

2.8.91

10 months ago

2.8.90

10 months ago

2.8.89

10 months ago

2.7.89

10 months ago

2.7.88

10 months ago

2.7.87

10 months ago

2.7.86

10 months ago

2.7.85

10 months ago

2.7.84

10 months ago

2.6.84

10 months ago

2.6.83

11 months ago

2.6.82

11 months ago

2.6.81

11 months ago

2.6.80

11 months ago

2.6.79

11 months ago

2.6.78

11 months ago

2.6.77

11 months ago

2.6.76

11 months ago

2.6.75

11 months ago

2.6.74

11 months ago

2.6.73

11 months ago

2.6.72

11 months ago

2.5.72

11 months ago

2.5.71

11 months ago

2.5.70

11 months ago

2.5.69

11 months ago

2.5.68

11 months ago

2.5.67

11 months ago

2.5.66

11 months ago

2.5.65

11 months ago

2.5.64

11 months ago

2.5.63

11 months ago

2.5.62

11 months ago

2.5.61

11 months ago

2.5.60

11 months ago

2.5.59

11 months ago

2.5.58

11 months ago

2.4.58

11 months ago

2.4.57

11 months ago

2.3.57

11 months ago

2.2.57

12 months ago

2.2.56

12 months ago

2.2.55

12 months ago

2.2.54

12 months ago

2.2.53

12 months ago

2.2.52

12 months ago

2.2.51

12 months ago

2.2.50

12 months ago

2.2.49

12 months ago

2.2.48

12 months ago

2.2.47

12 months ago

2.2.46

12 months ago

2.2.45

12 months ago

2.2.44

12 months ago

2.2.43

12 months ago

2.2.42

12 months ago

1.2.42

12 months ago

1.2.41

12 months ago

1.2.40

12 months ago

1.2.39

12 months 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