Input filter validation functions - These allows you to create input and input-filter objects that can be used (by included utility functions) to easily validate a body of input fields quickly and easily (see usage examples further below).
import {...} from 'fjl-input-filter';
const {...} = require('fjl-input-filter');
See desired export type below:
fjlInputFilter as a global).JSDocs are here (https://functional-jslib.github.io/fjl-input-filter/) [https://functional-jslib.github.io/fjl-input-filter/].
Docs in readme aren’t fully fleshed out yet (see jsdocs, usage examples, and/or tests instead).
Input methodsnoValidationRequired, validateInput, validateIOInput, runValidators,
runIOValidators, runFilters, runIOFilters, toInput,
toInputValidationResult, Input
InputFilter methodsvalidateInputFilter, validateIOInputFilter, validateIOInputWithName,
toInputFilter, toInputFilterResult, InputFilter
In-line summary docs follow:
validateInputFilter(inputFilter, incomingData)validateIOInputFilter(inputFilter, incomingData, ioErrorHandler)validateInput(inputObj, value)validateIOInput(inputObj, value, ioErrorHandler)toInputFilter(inputsObj, breakOnFailure {Boolean}, out = {})toInputFilterResult(resultObj, out = {})toInputValidationResult(resultObj)toInput(inputOptions, out = {})Input(options)validate(data) : InputValidationResultvalidateIO(data) : Promise.<InputValidationResult>InputFilter(inputsObj, breakOnFailure {Boolean})validate(data) : InputFilterResultvalidateIO(data) : Promise.<InputFilterResult>See: fjl-validator repo/module
Using jest (see ‘./package.json’ scripts).
BSD 3 Clause - Included in sources.
$) (use curried methods instead).
Removed:errorIfNotTypeOnTarget$ - (‘fjl’ provides this now)errorIfNotTypeOnTarget - (“”)defineEnumProps$defineProps$
_descriptorForSettable becomes createTypedDescriptor._makeDescriptorEnumerable becomes toEnumerableDescriptor._targetDescriptorTuple becomes toTargetDescriptorTuple.mocha and chai with jest.