README
criteria-pattern-core
Library classes for the criteria-pattern package.
Provides the Criterion class which can be extended to satisfy the
interface criteria-pattern
expects and the Failure class
for indicating a value failed to satisfy the Criterion.
Installation
npm install --save criteria-pattern-core
Usage
import {Criterion, Failure} from 'criteria-pattern-core'
class MyCriterion extends Criterion {
call(value) {
return (value)? value : new Failure('Value is required!', {value:value});
}
}