mirror of
https://github.com/flynx/diff.js.git
synced 2025-10-29 02:50:10 +00:00
more docs...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
815d97fb9b
commit
c23bbb75d1
46
README.md
46
README.md
@ -8,7 +8,7 @@
|
|||||||
- [Applying changes (*patch*)](#applying-changes-patch)
|
- [Applying changes (*patch*)](#applying-changes-patch)
|
||||||
- [Partial patching](#partial-patching)
|
- [Partial patching](#partial-patching)
|
||||||
- [Checking](#checking)
|
- [Checking](#checking)
|
||||||
- [Patterns](#patterns)
|
- [Generic ways to compare objects (*patterns*)](#generic-ways-to-compare-objects-patterns)
|
||||||
- [Motivation](#motivation)
|
- [Motivation](#motivation)
|
||||||
- [Goals / Features](#goals--features)
|
- [Goals / Features](#goals--features)
|
||||||
- [Installation and loading](#installation-and-loading)
|
- [Installation and loading](#installation-and-loading)
|
||||||
@ -20,6 +20,9 @@
|
|||||||
- [Options](#options)
|
- [Options](#options)
|
||||||
- [Deep compare](#deep-compare)
|
- [Deep compare](#deep-compare)
|
||||||
- [Patterns](#patterns)
|
- [Patterns](#patterns)
|
||||||
|
- [Logic patterns](#logic-patterns)
|
||||||
|
- [String patterns](#string-patterns)
|
||||||
|
- [Number patterns](#number-patterns)
|
||||||
- [Patterns (EXPERIMENTAL)](#patterns-experimental)
|
- [Patterns (EXPERIMENTAL)](#patterns-experimental)
|
||||||
- [JSON compatibility](#json-compatibility)
|
- [JSON compatibility](#json-compatibility)
|
||||||
- [Extending Diff](#extending-diff)
|
- [Extending Diff](#extending-diff)
|
||||||
@ -143,7 +146,7 @@ XXX modify the diff -- teach Ted guitar...
|
|||||||
|
|
||||||
XXX
|
XXX
|
||||||
|
|
||||||
### Patterns
|
### Generic ways to compare objects (*patterns*)
|
||||||
|
|
||||||
And for further checking we can create a *pattern*:
|
And for further checking we can create a *pattern*:
|
||||||
```javascript
|
```javascript
|
||||||
@ -313,24 +316,61 @@ XXX
|
|||||||
|
|
||||||
XXX General description...
|
XXX General description...
|
||||||
|
|
||||||
|
### Logic patterns
|
||||||
|
|
||||||
`ANY`
|
`ANY`
|
||||||
Matches anything
|
Matches anything
|
||||||
|
|
||||||
|
|
||||||
`NOT(A)`
|
`NOT(A)`
|
||||||
Match anything but `A`
|
Match anything but `A`
|
||||||
|
|
||||||
|
|
||||||
`OR(A[, .. ])`
|
`OR(A[, .. ])`
|
||||||
Match if *one* of the arguments matches
|
Match if *one* of the arguments matches
|
||||||
|
|
||||||
|
|
||||||
`AND(A[, .. ])`
|
`AND(A[, .. ])`
|
||||||
Matches of *all* of the arguments match
|
Matches of *all* of the arguments match
|
||||||
|
|
||||||
|
|
||||||
|
### String patterns
|
||||||
|
|
||||||
|
`STRING`
|
||||||
|
Match any string.
|
||||||
|
|
||||||
|
`STRING(string)`
|
||||||
|
Match a specific string.
|
||||||
|
|
||||||
|
`STRING(regexp)`
|
||||||
|
Match a string via a `RegExp` object.
|
||||||
|
|
||||||
|
`STRING(func)`
|
||||||
|
Match a string via a function predicate.
|
||||||
|
|
||||||
|
`STRING(pattern)`
|
||||||
|
Match a string via a nested pattern.
|
||||||
|
|
||||||
|
|
||||||
|
### Number patterns
|
||||||
|
|
||||||
|
`NUMBER`
|
||||||
|
`NUMBER(number)`
|
||||||
|
`NUMBER(min, max)`
|
||||||
|
`NUMBER(min, max, step)`
|
||||||
|
`NUMBER(func)`
|
||||||
|
`NUMBER(pattern)`
|
||||||
|
Matches a number
|
||||||
|
|
||||||
|
|
||||||
XXX examples...
|
XXX examples...
|
||||||
|
|
||||||
|
|
||||||
## Patterns (EXPERIMENTAL)
|
## Patterns (EXPERIMENTAL)
|
||||||
|
|
||||||
`NUMBER(min, max)`
|
`ARRAY`
|
||||||
|
`ARRAY(length)`
|
||||||
|
|
||||||
|
|
||||||
`IN(A)`
|
`IN(A)`
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user