mirror of
https://github.com/flynx/diff.js.git
synced 2025-10-28 10:30:09 +00:00
started work on XOR(..)...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
83e625c2bd
commit
670ed87d70
20
diff.js
20
diff.js
@ -599,6 +599,26 @@ object.Constructor('OR', Object.assign(Object.create(Pattern.prototype), {
|
|||||||
},
|
},
|
||||||
}))
|
}))
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
// XXX XOR
|
||||||
|
var XOR =
|
||||||
|
module.XOR =
|
||||||
|
object.Constructor('XOR', Object.assign(Object.create(Pattern.prototype), {
|
||||||
|
__cmp__: function(obj, cmp, context){
|
||||||
|
/* XXX
|
||||||
|
for(var m of this.members){
|
||||||
|
if(cmp(m, obj, context)){
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
//*/
|
||||||
|
},
|
||||||
|
__init__: function(...members){
|
||||||
|
this.members = members
|
||||||
|
},
|
||||||
|
}))
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
// Will compare as true if all of the .members compare as true...
|
// Will compare as true if all of the .members compare as true...
|
||||||
var AND =
|
var AND =
|
||||||
|
|||||||
@ -14,7 +14,7 @@ var diff = require('./diff')
|
|||||||
var {
|
var {
|
||||||
ANY,
|
ANY,
|
||||||
NULL, BOOL, B, NUMBER, N, STRING, S, ARRAY, L, FUNCTION, F,
|
NULL, BOOL, B, NUMBER, N, STRING, S, ARRAY, L, FUNCTION, F,
|
||||||
OR, AND, NOT,
|
OR, XOR, AND, NOT,
|
||||||
AT, OF, IN,
|
AT, OF, IN,
|
||||||
VAR, LIKE, TEST,
|
VAR, LIKE, TEST,
|
||||||
// non-pattern values...
|
// non-pattern values...
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user