0.0.8 • Published 8 years ago

criteria-pattern-core v0.0.8

Weekly downloads
-
License
Apache-2.0
Repository
-
Last release
8 years ago

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});

   }

 }