mirror of
https://github.com/flynx/diff.js.git
synced 2025-10-28 18:40:09 +00:00
tweaking...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
74e81b4685
commit
61503e9943
21
diff2.js
21
diff2.js
@ -241,7 +241,10 @@ Walk({
|
|||||||
obj
|
obj
|
||||||
// objects...
|
// objects...
|
||||||
: typeof(obj) == 'object' ?
|
: typeof(obj) == 'object' ?
|
||||||
{type: obj.constructor.name}
|
{
|
||||||
|
type: obj.constructor.name,
|
||||||
|
source: obj,
|
||||||
|
}
|
||||||
// primitives...
|
// primitives...
|
||||||
: obj,
|
: obj,
|
||||||
] },
|
] },
|
||||||
@ -310,7 +313,10 @@ Object.assign(
|
|||||||
yield* !this.noText
|
yield* !this.noText
|
||||||
&& typeof(obj) == 'string'
|
&& typeof(obj) == 'string'
|
||||||
&& obj.includes('\n') ?
|
&& obj.includes('\n') ?
|
||||||
[ [path, {type: 'text'}] ]
|
[ [path, {
|
||||||
|
type: 'text',
|
||||||
|
source: obj,
|
||||||
|
}] ]
|
||||||
: objectWalker.handler.call(this, ...arguments) },
|
: objectWalker.handler.call(this, ...arguments) },
|
||||||
listers: Object.assign(
|
listers: Object.assign(
|
||||||
{text: function(obj){
|
{text: function(obj){
|
||||||
@ -839,6 +845,7 @@ console.log([
|
|||||||
...objectWalker(o)
|
...objectWalker(o)
|
||||||
.chain(
|
.chain(
|
||||||
serializePaths,
|
serializePaths,
|
||||||
|
stripAttr('source'),
|
||||||
)])
|
)])
|
||||||
|
|
||||||
|
|
||||||
@ -889,7 +896,10 @@ console.log([
|
|||||||
a
|
a
|
||||||
multiline
|
multiline
|
||||||
text`)
|
text`)
|
||||||
.chain(serializePaths) ])
|
.chain(
|
||||||
|
serializePaths,
|
||||||
|
stripAttr('source'),
|
||||||
|
) ])
|
||||||
|
|
||||||
console.log('---')
|
console.log('---')
|
||||||
|
|
||||||
@ -900,7 +910,10 @@ console.log([
|
|||||||
a
|
a
|
||||||
multiline
|
multiline
|
||||||
text`)
|
text`)
|
||||||
.chain(serializePaths) ])
|
.chain(
|
||||||
|
serializePaths,
|
||||||
|
stripAttr('source'),
|
||||||
|
) ])
|
||||||
|
|
||||||
console.log('---')
|
console.log('---')
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user