This package has been deprecated

Author message:

WARNING: This project has been renamed to @aureooms/js-predicate.

aureooms-js-predicate

2.0.2 • Public • Published

js-predicate

Predicate code bricks for JavaScript.

NPM license NPM version Bower version Build Status Coverage Status Dependencies Status devDependencies Status Code Climate NPM downloads per month GitHub issues Inline docs

Can be managed through jspm, duo, component, bower, ender, jam, spm, and npm.

Install

jspm

jspm install github:aureooms/js-predicate
# or
jspm install npm:aureooms-js-predicate

duo

No install step needed for duo!

component

component install aureooms/js-predicate

bower

bower install aureooms-js-predicate

ender

ender add aureooms-js-predicate

jam

jam install aureooms-js-predicate

spm

spm install aureooms-js-predicate --save

npm

npm install aureooms-js-predicate --save

Require

jspm

let predicate = require( "github:aureooms/js-predicate" ) ;
// or
import predicate from 'aureooms-js-predicate' ;

duo

let predicate = require( "aureooms/js-predicate" ) ;

component, ender, spm, npm

let predicate = require( "aureooms-js-predicate" ) ;

bower

The script tag exposes the global variable predicate.

<script src="bower_components/aureooms-js-predicate/js/dist/predicate.min.js"></script>

Alternatively, you can use any tool mentioned here.

jam

require( [ "aureooms-js-predicate" ] , function ( predicate ) { ... } ) ;

Use

const {
    lt , le , gt ,
    truth , untruth ,
    negation ,
    conjunction , disjunction ,
    implication 
= predicate ;
 
let p = gt( 5 ) ;
p( 5 ) ; // false
p( 6 ) ; // true
 
let q = lt( 7 ) ;
q( 6 ) ; // true
q( 7 ) ; // false
 
let r = conjunction( p , q ) ;
r( 5 ) ; // false
r( 6 ) ; // true
r( 7 ) ; // false
 
let s = negation( r ) ;
s( 5 ) ; // true
s( 6 ) ; // false
s( 7 ) ; // true
 
let t = equivalence( p , negation( le( 5 ) ) ) ;
t( ... ) ; // true
 
let u = implication( negation( q ) , p ) ;
u( ... ) ; // true
 
let v = disjunction( truth , untruth ) ;
v( ... ) ; // true

References

Package Sidebar

Install

npm i aureooms-js-predicate

Weekly Downloads

3

Version

2.0.2

License

AGPL-3.0

Last publish

Collaborators

  • aureooms