Warning This repo is deprecated. Please see the fjl monorepo for the latest sources.
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).
- Basic idea
- Requirements
- Getting Started
- Docs
- Motivation
- Development
- Supported Platforms
- License
- Resources
- Change log
- Validators - Functions that validate a given input and return a validation result.
- Filters - Functions that take a value and give you a 'possibly' transformed value.
- Inputs - Objects that contain rules used for validation (breakOnFailure, a list of validators, a list of filters etc.)
- InputFilters - Collection of input objects that can be validated together as a whole. (see usage example(s) below):
- Javascript Ecmascript 5+.
- IE9+, and all other modern day browsers.
- 8+
import {...} from 'fjl-input-filter';
const {...} = require('fjl-input-filter');
See desired export type below:
- './dist/amd/' - Asynchronous module format.
- './dist/cjs/' - CommonJs module format.
- './dist/umd/' - Universal module definition format.
- './dist/iife/' - Immediately Invoked Function Execution - (exports
fjlInputFilter
as a global). - './dist/es6-module/' - Ecmascript 6 module format.
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).
noValidationRequired, validateInput, validateIOInput, runValidators,
runIOValidators, runFilters, runIOFilters, toInput,
toInputValidationResult, Input
validateInputFilter, validateIOInputFilter, validateIOInputWithName,
toInputFilter, toInputFilterResult, InputFilter
In-line summary docs follow:
validate(data) : InputValidationResult
validateIO(data) : Promise.<InputValidationResult>
validate(data) : InputFilterResult
validateIO(data) : Promise.<InputFilterResult>
See: fjl-validator repo/module
- For commands see './package.json' scripts.
- Everything is in './src'.
- Distribution is in './dist'.
- Docs are in './docs'.
Using jest
(see './package.json' scripts).
BSD 3 Clause - Included in sources.
- Zend/InputFilter: https://docs.zendframework.com/zend-inputfilter/intro/
- fjl-validator: https://github.com/functional-jslib/fjl-validator
- fjl-filter (WIP): https://github.com/functional-jslib/fjl-filter
- Dependencies and dev-dependencies updated to latest.
- Tests updated to reflect updated dev-dependencies (jest complained about nested 'describe' blocks and nested 'test' blocks (primarily issue had to do with async and non-async tests)).
-
Removed uncurried methods (methods ending with
$
) (use curried methods instead). Removed: -
errorIfNotTypeOnTarget$
- ('fjl' provides this now) -
errorIfNotTypeOnTarget
- ("") -
defineEnumProps$
-
defineProps$
-
Renamed auxillary methods:
_descriptorForSettable
becomescreateTypedDescriptor
._makeDescriptorEnumerable
becomestoEnumerableDescriptor
._targetDescriptorTuple
becomestoTargetDescriptorTuple
.
- Normalized API (removed un-curried methods from exports and non-api specific (un-required) methods).
- Updated build process (using babel7 now).
- Replaced
mocha
andchai
withjest
. - Changed license from "MIT" to "BSD3".
- Version and build tag links to top of readme file.
- Et. al.