Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitdb2c39d

Browse files
committed
Update README.md
1 parent4775e1e commitdb2c39d

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

‎README.md‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
#spec-pattern
22

3-
Implementation of the[Specification Pattern](https://en.wikipedia.org/wiki/Specificationpattern) for JavaScript and TypeScript.
3+
Implementation of the[Specification Pattern](https://en.wikipedia.org/wiki/Specification_pattern) for JavaScript and TypeScript.
44

5+
[![npm version](https://badge.fury.io/js/spec-pattern.svg)](https://badge.fury.io/js/spec-pattern)
56
[![Build Status](https://travis-ci.org/thiagodp/spec-pattern.svg?branch=master)](https://travis-ci.org/thiagodp/spec-pattern)[![Greenkeeper badge](https://badges.greenkeeper.io/thiagodp/spec-pattern.svg)](https://greenkeeper.io/)
67

78
>Build complex filters and rules easily.
@@ -46,7 +47,7 @@ import { Between, In, GreaterThan } from 'spec-pattern';
4647

4748
let rules=newBetween(1,3 )
4849
.or(newBetween(6,9 ) )
49-
.or(newIn( [11,25,31 ] )
50+
.or(newIn( [11,25,31 ] ) )
5051
.or(newGreaterThan(50 ) );
5152

5253
console.log(rules.isSatisfiedBy(2 ) );// true
@@ -55,6 +56,10 @@ console.log( rules.isSatisfiedBy( 5 ) ); // false
5556
console.log(rules.isSatisfiedBy(11 ) );// true
5657
console.log(rules.isSatisfiedBy(50 ) );// false
5758
console.log(rules.isSatisfiedBy(51 ) );// true
59+
60+
// Printable !
61+
console.log(rules.toString() );
62+
// (((between (1, 3) or between (6, 9)) or in [11, 25, 31]) or greater than 50)
5863
```
5964

6065
####Not only numbers

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp