mirror of
https://github.com/flynx/diff.js.git
synced 2025-10-29 19:10:11 +00:00
notes and minor tweaks...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
867e51842a
commit
d3ac8e3a46
43
diff.js
43
diff.js
@ -6,13 +6,6 @@
|
|||||||
((typeof define)[0]=='u'?function(f){module.exports=f(require)}:define)
|
((typeof define)[0]=='u'?function(f){module.exports=f(require)}:define)
|
||||||
(function(require){ var module={} // make module AMD/node compatible...
|
(function(require){ var module={} // make module AMD/node compatible...
|
||||||
/*********************************************************************/
|
/*********************************************************************/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*********************************************************************/
|
|
||||||
//
|
|
||||||
//---------------------------------------------------------------------
|
|
||||||
// Helpers...
|
// Helpers...
|
||||||
|
|
||||||
// zip(array, array, ...)
|
// zip(array, array, ...)
|
||||||
@ -629,14 +622,21 @@ var Types = {
|
|||||||
// // type .priority is set to a non 0 value.
|
// // type .priority is set to a non 0 value.
|
||||||
// //
|
// //
|
||||||
// // Default priorities:
|
// // Default priorities:
|
||||||
// // 50 - 'Basic'
|
// // Text: 100
|
||||||
// // -50 - Object
|
// // Needs to run checks before 'Basic' as its targets are
|
||||||
|
// // long strings that 'Basic' also catches.
|
||||||
|
// // Basic: 50
|
||||||
|
// // Needs to be run before we do other object checks.
|
||||||
|
// // Object: -100
|
||||||
|
// // Needs to run after everything else as it will match any
|
||||||
|
// // set of objects.
|
||||||
// //
|
// //
|
||||||
// // General guide:
|
// // General guide:
|
||||||
// // >50 - to be checked before 'Basic'
|
// // >50 - to be checked before 'Basic'
|
||||||
// // <50 and >0 - after Basic but before unprioritized types
|
// // <50 and >0 - after Basic but before unprioritized types
|
||||||
// // <-50 and <0 - after unprioritized typee but before Object
|
// // <-50 and <0 - after unprioritized types but before Object
|
||||||
// // <-50 - to be checked after Object
|
// // <-100 - to be checked after Object -- this is a bit
|
||||||
|
// // pointless in JavaScript.
|
||||||
// //
|
// //
|
||||||
// // NOTE: when this is set to 0, then type will be checked in
|
// // NOTE: when this is set to 0, then type will be checked in
|
||||||
// // order of occurrence...
|
// // order of occurrence...
|
||||||
@ -647,7 +647,9 @@ var Types = {
|
|||||||
// // .check(obj[, options])
|
// // .check(obj[, options])
|
||||||
// // -> bool
|
// // -> bool
|
||||||
// //
|
// //
|
||||||
// check: function(obj, options){ .. },
|
// check: function(obj, options){
|
||||||
|
// ..
|
||||||
|
// },
|
||||||
//
|
//
|
||||||
// // Handle/populate the diff of A and B...
|
// // Handle/populate the diff of A and B...
|
||||||
// //
|
// //
|
||||||
@ -656,17 +658,28 @@ var Types = {
|
|||||||
// // type: <type-name>,
|
// // type: <type-name>,
|
||||||
// // }
|
// // }
|
||||||
// //
|
// //
|
||||||
// handle: function(obj, diff, A, B, options){ .. },
|
// handle: function(obj, diff, A, B, options){
|
||||||
|
// ..
|
||||||
|
// },
|
||||||
//
|
//
|
||||||
// // Flatten a diff...
|
// // Flatten a diff...
|
||||||
// //
|
// //
|
||||||
// // .flatten(diff, res, path, options)
|
// // .flatten(diff, res, path, options)
|
||||||
// // -> res
|
// // -> res
|
||||||
// //
|
// //
|
||||||
// flatten: function(diff, res, path, options){ .. },
|
// flatten: function(diff, res, path, options){
|
||||||
|
// ..
|
||||||
|
// },
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
|
// NOTE: to add attribute checking to a specific type add it to
|
||||||
|
// options.as_object...
|
||||||
|
// XXX need a more flexible way to configure this, preferably from
|
||||||
|
// within the handler...
|
||||||
|
// XXX would also need to enable attribute filtering, at least for
|
||||||
|
// arrays as this will also check all the number keys...
|
||||||
|
//
|
||||||
// XXX do not like that we need to explicitly pass context to helper
|
// XXX do not like that we need to explicitly pass context to helper
|
||||||
// methods...
|
// methods...
|
||||||
//
|
//
|
||||||
@ -705,7 +718,7 @@ Types.set('Basic', {
|
|||||||
// Object...
|
// Object...
|
||||||
// XXX add attr order support...
|
// XXX add attr order support...
|
||||||
Types.set(Object, {
|
Types.set(Object, {
|
||||||
priority: -50,
|
priority: -100,
|
||||||
|
|
||||||
handle: function(obj, diff, A, B, options){
|
handle: function(obj, diff, A, B, options){
|
||||||
// attrebutes/items...
|
// attrebutes/items...
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user