From eba3d700ad5db1fdbde83a45303aaca195b7485f Mon Sep 17 00:00:00 2001 From: SebastianG Date: Fri, 8 Feb 2019 22:50:19 +0000 Subject: [PATCH 01/11] add BigNumber Support for function diffString() --- lib/colorize.coffee | 34 +++++++++++++++++----------------- lib/index.coffee | 6 ++++-- lib/util.coffee | 5 ++++- package.json | 3 ++- yarn.lock | 12 ++++++++++++ 5 files changed, 39 insertions(+), 21 deletions(-) diff --git a/lib/colorize.coffee b/lib/colorize.coffee index 3c51eb3..b8325a6 100644 --- a/lib/colorize.coffee +++ b/lib/colorize.coffee @@ -1,4 +1,5 @@ color = require 'cli-color' +JSONbig = require 'true-json-bigint' { extendedTypeOf } = require './util' @@ -8,24 +9,23 @@ Theme = '-': color.red -subcolorizeToCallback = (key, diff, output, color, indent) -> +subcolorizeToCallback = (key, diff, output, color, indent, options) -> prefix = if key then "#{key}: " else '' subindent = indent + ' ' - - switch extendedTypeOf(diff) + switch extendedTypeOf(diff, options.bigNumberSupport) when 'object' if ('__old' of diff) and ('__new' of diff) and (Object.keys(diff).length is 2) - subcolorizeToCallback(key, diff.__old, output, '-', indent) - subcolorizeToCallback(key, diff.__new, output, '+', indent) + subcolorizeToCallback(key, diff.__old, output, '-', indent, options) + subcolorizeToCallback(key, diff.__new, output, '+', indent, options) else output color, "#{indent}#{prefix}{" for own subkey, subvalue of diff if m = subkey.match /^(.*)__deleted$/ - subcolorizeToCallback(m[1], subvalue, output, '-', subindent) + subcolorizeToCallback(m[1], subvalue, output, '-', subindent, options) else if m = subkey.match /^(.*)__added$/ - subcolorizeToCallback(m[1], subvalue, output, '+', subindent) + subcolorizeToCallback(m[1], subvalue, output, '+', subindent, options) else - subcolorizeToCallback(subkey, subvalue, output, color, subindent) + subcolorizeToCallback(subkey, subvalue, output, color, subindent, options) output color, "#{indent}}" when 'array' @@ -42,34 +42,34 @@ subcolorizeToCallback = (key, diff, output, color, indent) -> output(' ', subindent + '...') else unless op in [' ', '~', '+', '-'] - throw new Error("Unexpected op '#{op}' in #{JSON.stringify(diff, null, 2)}") + throw new Error("Unexpected op '#{op}' in #{JSONbig.stringify(diff, null, 2)}") op = ' ' if op is '~' - subcolorizeToCallback('', subvalue, output, op, subindent) + subcolorizeToCallback('', subvalue, output, op, subindent, options) else for subvalue in diff - subcolorizeToCallback('', subvalue, output, color, subindent) + subcolorizeToCallback('', subvalue, output, color, subindent, options) output color, "#{indent}]" else if diff == 0 or diff - output(color, indent + prefix + JSON.stringify(diff)) + output(color, indent + prefix + JSONbig.stringify(diff)) -colorizeToCallback = (diff, output) -> - subcolorizeToCallback('', diff, output, ' ', '') +colorizeToCallback = (diff, options, output) -> + subcolorizeToCallback('', diff, output, ' ', '', options) -colorizeToArray = (diff) -> +colorizeToArray = (diff, options = {}) -> output = [] - colorizeToCallback(diff, (color, line) -> output.push "#{color}#{line}") + colorizeToCallback(diff, options, (color, line) -> output.push "#{color}#{line}") return output colorize = (diff, options={}) -> output = [] - colorizeToCallback diff, (color, line) -> + colorizeToCallback diff, options, (color, line) -> if options.color ? yes output.push (options.theme?[color] ? Theme[color])("#{color}#{line}") + "\n" else diff --git a/lib/index.coffee b/lib/index.coffee index 77c8696..c36881a 100644 --- a/lib/index.coffee +++ b/lib/index.coffee @@ -146,8 +146,8 @@ arrayDiff = (obj1, obj2, options = {}) -> diffWithScore = (obj1, obj2, options = {}) -> - type1 = extendedTypeOf obj1 - type2 = extendedTypeOf obj2 + type1 = extendedTypeOf(obj1, options.bigNumberSupport) + type2 = extendedTypeOf(obj2, options.bigNumberSupport) if type1 == type2 switch type1 @@ -173,6 +173,8 @@ diffScore = (obj1, obj2, options = {}) -> return score diffString = (obj1, obj2, colorizeOptions, diffOptions = {}) -> + if colorizeOptions != undefined and colorizeOptions.bigNumberSupport + diffOptions.bigNumberSupport = true return colorize(diff(obj1, obj2, diffOptions), colorizeOptions) diff --git a/lib/util.coffee b/lib/util.coffee index a4860c2..8927f1e 100644 --- a/lib/util.coffee +++ b/lib/util.coffee @@ -1,10 +1,13 @@ +BigNumber = require 'bignumber.js' -extendedTypeOf = (obj) -> +extendedTypeOf = (obj, bigNumberSupport = false) -> result = typeof obj if !obj? 'null' else if result is 'object' and obj.constructor is Array 'array' + else if bigNumberSupport and BigNumber.isBigNumber(obj) + 'number' else result diff --git a/package.json b/package.json index e52848d..6c9e4af 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,8 @@ "dependencies": { "cli-color": "~0.1.6", "difflib": "~0.2.1", - "dreamopt": "~0.6.0" + "dreamopt": "~0.6.0", + "true-json-bigint": "^0.4.4" }, "devDependencies": { "coffee-script": "^1.12.7", diff --git a/yarn.lock b/yarn.lock index 816b137..9541a3d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,6 +2,11 @@ # yarn lockfile v1 +bignumber.js@^7.0.0: + version "7.2.1" + resolved "https://registry.yarnpkg.com/bignumber.js/-/bignumber.js-7.2.1.tgz#80c048759d826800807c4bfd521e50edbba57a5f" + integrity sha512-S4XzBk5sMB+Rcb/LNcpzXr57VRTxgAvaAEDAl1AwRx27j00hT84O6OkteE7u8UB3NuaaygCRrEpqox4uDOrbdQ== + cli-color@~0.1.6: version "0.1.7" resolved "https://registry.yarnpkg.com/cli-color/-/cli-color-0.1.7.tgz#adc3200fa471cc211b0da7f566b71e98b9d67347" @@ -85,6 +90,13 @@ ms@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" +"true-json-bigint@^0.4.4": + version "0.4.4" + resolved "https://registry.yarnpkg.com/true-json-bigint/-/true-json-bigint-0.4.4.tgz#82a2a04a959958ae0eeb819e62481db4717bdf60" + integrity sha512-RE5QJtnrn50WicRYER45GNfnd/CTULiaW3EdtalvAFuMqt/e7XB5mZArEvBRItr8+/KxCpYMMDwcuGoXId/4KA== + dependencies: + bignumber.js "^7.0.0" + wordwrap@>=0.0.2: version "1.0.0" resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" From abb3d16c91115b335686ee505b52b231e3749e5a Mon Sep 17 00:00:00 2001 From: SebastianG Date: Fri, 8 Feb 2019 22:52:41 +0000 Subject: [PATCH 02/11] add test cases for testing big number support of function colorize() --- test/colorize_test.coffee | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/test/colorize_test.coffee b/test/colorize_test.coffee index 77f01a2..ff9f2ef 100644 --- a/test/colorize_test.coffee +++ b/test/colorize_test.coffee @@ -1,4 +1,5 @@ assert = require 'assert' +BigNumber = require 'bignumber.js' { colorize, colorizeToArray } = require "../#{process.env.JSLIB or 'lib'}/colorize" @@ -44,3 +45,15 @@ describe 'colorize', -> it "should return a string without ANSI escapes on { color: false }", -> assert.equal colorize({ foo: { __old: 42, __new: 10 } }, color: no), " {\n- foo: 42\n+ foo: 10\n }\n" + + +describe 'Big Number Support', -> + + it "should handle a diff with Big Number values", -> + assert.deepEqual colorize({ foo: { __old: BigNumber('3e+5000'), __new: BigNumber('98765432100123456789') } }, {bigNumberSupport: true, color: no}), " {\n- foo: 3e+5000\n+ foo: 98765432100123456789\n }\n" + + it "should handle a diff for an array with Big Number values", -> + assert.deepEqual ['-3e+5000', '+98765432100123456789'], colorizeToArray({ __old: BigNumber('3e+5000'), __new: BigNumber('98765432100123456789') }, bigNumberSupport: true) + + + From 955c1c360f7a9bc26e79d1fa4595631e5b5dd587 Mon Sep 17 00:00:00 2001 From: SebastianG Date: Fri, 8 Feb 2019 23:21:22 +0000 Subject: [PATCH 03/11] pass options.bigNumberSupport to all extendedTypeOf() function calls and remove default property value for parameter bigNumberSupport in function extendedTypeOf() to ensure no unexpected parameter value will be processed --- lib/colorize.coffee | 2 +- lib/index.coffee | 14 ++++++++------ lib/util.coffee | 2 +- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/lib/colorize.coffee b/lib/colorize.coffee index b8325a6..c23e55d 100644 --- a/lib/colorize.coffee +++ b/lib/colorize.coffee @@ -33,7 +33,7 @@ subcolorizeToCallback = (key, diff, output, color, indent, options) -> looksLikeDiff = yes for item in diff - if (extendedTypeOf(item) isnt 'array') or !((item.length is 2) or ((item.length is 1) and (item[0] is ' '))) or !(typeof(item[0]) is 'string') or item[0].length != 1 or !(item[0] in [' ', '-', '+', '~']) + if (extendedTypeOf(item, options.bigNumberSupport) isnt 'array') or !((item.length is 2) or ((item.length is 1) and (item[0] is ' '))) or !(typeof(item[0]) is 'string') or item[0].length != 1 or !(item[0] in [' ', '-', '+', '~']) looksLikeDiff = no if looksLikeDiff diff --git a/lib/index.coffee b/lib/index.coffee index c36881a..160425b 100644 --- a/lib/index.coffee +++ b/lib/index.coffee @@ -36,14 +36,14 @@ objectDiff = (obj1, obj2, options = {}) -> return [score, result] -findMatchingObject = (item, index, fuzzyOriginals) -> +findMatchingObject = (item, index, fuzzyOriginals, options) -> # console.log "findMatchingObject: " + JSON.stringify({item, fuzzyOriginals}, null, 2) bestMatch = null matchIndex = 0 for own key, candidate of fuzzyOriginals when key isnt '__next' indexDistance = Math.abs(matchIndex - index) - if extendedTypeOf(item) == extendedTypeOf(candidate) + if extendedTypeOf(item, options.bigNumberSupport) == extendedTypeOf(candidate, options.bigNumberSupport) score = diffScore(item, candidate) if !bestMatch || score > bestMatch.score || (score == bestMatch.score && indexDistance < bestMatch.indexDistance) bestMatch = { score, key, indexDistance } @@ -53,11 +53,11 @@ findMatchingObject = (item, index, fuzzyOriginals) -> bestMatch -scalarize = (array, originals, fuzzyOriginals) -> +scalarize = (array, originals, fuzzyOriginals, options) -> for item, index in array if isScalar item item - else if fuzzyOriginals && (bestMatch = findMatchingObject(item, index, fuzzyOriginals)) && bestMatch.score > 40 && !originals[bestMatch.key]? + else if fuzzyOriginals && (bestMatch = findMatchingObject(item, index, fuzzyOriginals, options)) && bestMatch.score > 40 && !originals[bestMatch.key]? originals[bestMatch.key] = item bestMatch.key else @@ -77,9 +77,9 @@ descalarize = (item, originals) -> arrayDiff = (obj1, obj2, options = {}) -> originals1 = { __next: 1 } - seq1 = scalarize(obj1, originals1) + seq1 = scalarize(obj1, originals1, undefined, options) originals2 = { __next: originals1.__next } - seq2 = scalarize(obj2, originals2, originals1) + seq2 = scalarize(obj2, originals2, originals1, options) opcodes = new SequenceMatcher(null, seq1, seq2).getOpcodes() @@ -175,6 +175,8 @@ diffScore = (obj1, obj2, options = {}) -> diffString = (obj1, obj2, colorizeOptions, diffOptions = {}) -> if colorizeOptions != undefined and colorizeOptions.bigNumberSupport diffOptions.bigNumberSupport = true + if diffOptions != undefined and diffOptions.bigNumberSupport + colorizeOptions.bigNumberSupport = true return colorize(diff(obj1, obj2, diffOptions), colorizeOptions) diff --git a/lib/util.coffee b/lib/util.coffee index 8927f1e..086c53d 100644 --- a/lib/util.coffee +++ b/lib/util.coffee @@ -1,6 +1,6 @@ BigNumber = require 'bignumber.js' -extendedTypeOf = (obj, bigNumberSupport = false) -> +extendedTypeOf = (obj, bigNumberSupport) -> result = typeof obj if !obj? 'null' From 2703cef76682b6f96d8c4227462c46933523ef84 Mon Sep 17 00:00:00 2001 From: SebastianG Date: Sat, 9 Feb 2019 09:32:06 +0000 Subject: [PATCH 04/11] Function JSONbig.stringify() will only be called if bigNumberSupport is active, otherwise JSON.stringify() will still be used to ensure the tool will work as before when keeping bigNumberSupport deactivated --- lib/colorize.coffee | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/colorize.coffee b/lib/colorize.coffee index c23e55d..3c6bd3c 100644 --- a/lib/colorize.coffee +++ b/lib/colorize.coffee @@ -42,7 +42,8 @@ subcolorizeToCallback = (key, diff, output, color, indent, options) -> output(' ', subindent + '...') else unless op in [' ', '~', '+', '-'] - throw new Error("Unexpected op '#{op}' in #{JSONbig.stringify(diff, null, 2)}") + stringifiedJSON = if options.bigNumberSupport then JSONbig.stringify(diff, null, 2) else JSON.stringify(diff, null, 2) + throw new Error("Unexpected op '#{op}' in #{stringifiedJSON}") op = ' ' if op is '~' subcolorizeToCallback('', subvalue, output, op, subindent, options) else @@ -53,7 +54,8 @@ subcolorizeToCallback = (key, diff, output, color, indent, options) -> else if diff == 0 or diff - output(color, indent + prefix + JSONbig.stringify(diff)) + stringifiedJSON = if options.bigNumberSupport then JSONbig.stringify(diff, null, 2) else JSON.stringify(diff, null, 2) + output(color, indent + prefix + stringifiedJSON) From 7b8a2f0332b1bf93497b6fe66b63f12eeb813a04 Mon Sep 17 00:00:00 2001 From: SebastianG Date: Sat, 9 Feb 2019 19:28:22 +0000 Subject: [PATCH 05/11] add parameter to activate big number support via cli --- lib/cli.coffee | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/cli.coffee b/lib/cli.coffee index 05089a7..e3563be 100644 --- a/lib/cli.coffee +++ b/lib/cli.coffee @@ -1,4 +1,5 @@ fs = require 'fs' +JSONbig = require 'true-json-bigint' tty = require 'tty' { diff } = require './index' @@ -13,6 +14,7 @@ module.exports = (argv) -> " second.json New file #var(file2) #required" "General options:" + " -b, --bigNumberSupport Parse larger numbers to bignumber.js objects" " -v, --verbose Output progress info" " -C, --[no-]color Colored output" " -j, --raw-json Display raw JSON encoding of the diff #var(raw)" @@ -26,9 +28,9 @@ module.exports = (argv) -> data2 = fs.readFileSync(options.file2, 'utf8') process.stderr.write "Parsing old file...\n" if options.verbose - json1 = JSON.parse(data1) + json1 = if options.bigNumberSupport then JSONbig.parse(data1) else JSON.parse(data1) process.stderr.write "Parsing new file...\n" if options.verbose - json2 = JSON.parse(data2) + json2 = if options.bigNumberSupport then JSONbig.parse(data2) else JSON.parse(data2) process.stderr.write "Running diff...\n" if options.verbose result = diff(json1, json2, options) @@ -38,10 +40,10 @@ module.exports = (argv) -> if result if options.raw process.stderr.write "Serializing JSON output...\n" if options.verbose - process.stdout.write JSON.stringify(result, null, 2) + process.stdout.write if options.bigNumberSupport then JSONbig.stringify(result, null, 2) else JSON.stringify(result, null, 2) else process.stderr.write "Producing colored output...\n" if options.verbose - process.stdout.write colorize(result, color: options.color) + process.stdout.write colorize(result, {color: options.color, bigNumberSupport: if options.bigNumberSupport then true else false }) else process.stderr.write "No diff" if options.verbose From 85d0a890efc3e7459425b3ea71d9924a7b4c7591 Mon Sep 17 00:00:00 2001 From: SebastianG Date: Sat, 9 Feb 2019 19:41:05 +0000 Subject: [PATCH 06/11] improve cli description for --bigNumberSupport --- lib/cli.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/cli.coffee b/lib/cli.coffee index e3563be..2dd611a 100644 --- a/lib/cli.coffee +++ b/lib/cli.coffee @@ -14,7 +14,7 @@ module.exports = (argv) -> " second.json New file #var(file2) #required" "General options:" - " -b, --bigNumberSupport Parse larger numbers to bignumber.js objects" + " -b, --bigNumberSupport Handle large numbers as bignumber.js objects to ensure correct diffs for them" " -v, --verbose Output progress info" " -C, --[no-]color Colored output" " -j, --raw-json Display raw JSON encoding of the diff #var(raw)" From 1f4461d3af9a5c043dad597a3e4f0b86c4ae4050 Mon Sep 17 00:00:00 2001 From: SebastianG Date: Sat, 9 Feb 2019 21:48:39 +0000 Subject: [PATCH 07/11] add special comparison for BigNumber values --- lib/index.coffee | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/index.coffee b/lib/index.coffee index 160425b..10da926 100644 --- a/lib/index.coffee +++ b/lib/index.coffee @@ -1,3 +1,5 @@ +BigNumber = require 'bignumber.js' + { SequenceMatcher } = require 'difflib' { extendedTypeOf } = require './util' { colorize } = require './colorize' @@ -157,7 +159,12 @@ diffWithScore = (obj1, obj2, options = {}) -> return arrayDiff(obj1, obj2, options) if !options.keysOnly - if obj1 != obj2 + if options.bigNumberSupport and BigNumber.isBigNumber(obj1) and BigNumber.isBigNumber(obj2) + if !obj1.isEqualTo(obj2) + [0, { __old: obj1, __new: obj2 }] + else + [100, undefined] + else if obj1 != obj2 [0, { __old: obj1, __new: obj2 }] else [100, undefined] From 44e63f4cffa589588a33838a4d6c73570c81fff7 Mon Sep 17 00:00:00 2001 From: SebastianG Date: Sat, 9 Feb 2019 21:49:28 +0000 Subject: [PATCH 08/11] add several test cases for testing BigNumber Support --- test/diff_test.coffee | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/test/diff_test.coffee b/test/diff_test.coffee index 12133eb..9dca320 100644 --- a/test/diff_test.coffee +++ b/test/diff_test.coffee @@ -1,3 +1,4 @@ +BigNumber = require 'bignumber.js' fs = require 'fs' Path = require 'path' assert = require 'assert' @@ -178,3 +179,22 @@ describe 'diffString', -> it "return an empty string when no diff found", -> assert.equal diffString(a, a), '' + + +describe 'Big Number Support', -> + + it "should handle a diff with different Big Number values", -> + assert.deepEqual { __old: BigNumber('3e+5000'), __new: BigNumber('98765432100123456789') }, diff(BigNumber('3e+5000'), BigNumber('98765432100123456789'), bigNumberSupport: true) + + it "should handle a diff with equal Big Number values", -> + assert.deepEqual undefined, diff(BigNumber('3e+5000'), BigNumber('3e+5000'), bigNumberSupport: true) + + it "should handle a diff for an array with Big Number values", -> + assert.deepEqual [['~', {__old: BigNumber('3e+5000'), __new: BigNumber('98765432100123456789')}], ['~', {__old: BigNumber('3e+6000'), __new: BigNumber('12345678901234567890')}]], diff([BigNumber('3e+5000'), BigNumber('3e+6000')], [BigNumber('98765432100123456789'), BigNumber('12345678901234567890')], bigNumberSupport: true) + + it "should handle a diff when old value is an ordinary number and new value contains a Big Number value", -> + assert.deepEqual { __old: 1, __new: BigNumber('98765432100123456789') }, diff(1, BigNumber('98765432100123456789'), bigNumberSupport: true) + + it "should handle a diff when old value contains a Big Number value and new value is an ordinary number", -> + assert.deepEqual { __old: BigNumber('3e+5000'), __new: 2}, diff(BigNumber('3e+5000'), 2, bigNumberSupport: true) + From f4c4b9c929cc5782c5566d2c4d5cbba5b025552e Mon Sep 17 00:00:00 2001 From: SebastianG Date: Sat, 9 Feb 2019 21:51:00 +0000 Subject: [PATCH 09/11] WIP: test if Arrays containing BigNumbers and ordinary integers are compared appropriately --- test/diff_test.coffee | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/diff_test.coffee b/test/diff_test.coffee index 9dca320..2a51f2d 100644 --- a/test/diff_test.coffee +++ b/test/diff_test.coffee @@ -198,3 +198,5 @@ describe 'Big Number Support', -> it "should handle a diff when old value contains a Big Number value and new value is an ordinary number", -> assert.deepEqual { __old: BigNumber('3e+5000'), __new: 2}, diff(BigNumber('3e+5000'), 2, bigNumberSupport: true) +it "should handle a diff for an array with Big Number and ordinary integers", -> + assert.deepEqual [['~', {__old: BigNumber('3e+5000'), __new: 2}], ['~', {__old: 1, __new: BigNumber('12345678901234567890')}]], diff([BigNumber('3e+5000'), 1], [2, BigNumber('12345678901234567890')], bigNumberSupport: true) From e9cf579d2aeb801c645c02d4e89ad37e7476b5e1 Mon Sep 17 00:00:00 2001 From: SebastianG Date: Sun, 10 Feb 2019 17:20:13 +0100 Subject: [PATCH 10/11] fix test case for creating a diff for an array containing big number objects and ordinary numbers --- test/diff_test.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/diff_test.coffee b/test/diff_test.coffee index 2a51f2d..64e8643 100644 --- a/test/diff_test.coffee +++ b/test/diff_test.coffee @@ -199,4 +199,4 @@ describe 'Big Number Support', -> assert.deepEqual { __old: BigNumber('3e+5000'), __new: 2}, diff(BigNumber('3e+5000'), 2, bigNumberSupport: true) it "should handle a diff for an array with Big Number and ordinary integers", -> - assert.deepEqual [['~', {__old: BigNumber('3e+5000'), __new: 2}], ['~', {__old: 1, __new: BigNumber('12345678901234567890')}]], diff([BigNumber('3e+5000'), 1], [2, BigNumber('12345678901234567890')], bigNumberSupport: true) + assert.deepEqual [['+', 2], ['~', {__old: BigNumber('3e+5000'), __new: BigNumber('12345678901234567890')}],['-', 1]], diff([BigNumber('3e+5000'), 1], [2, BigNumber('12345678901234567890')], bigNumberSupport: true) From 4cbc3bd9888a0987fa1512e6982ed79b8dd6082b Mon Sep 17 00:00:00 2001 From: SebastianG Date: Sun, 10 Feb 2019 17:24:33 +0100 Subject: [PATCH 11/11] extend README.md by explaining parameter bigNumberSupport briefly --- README.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 703f60f..ad3b02c 100644 --- a/README.md +++ b/README.md @@ -39,11 +39,12 @@ Detailed: second.json New file General options: - -v, --verbose Output progress info - -C, --[no-]color Colored output - -j, --raw-json Display raw JSON encoding of the diff - -k, --keys-only Compare only the keys, ignore the differences in values - -h, --help Display this usage information + -b, --bigNumberSupport Handle large numbers as bignumber.js objects to ensure correct diffs for them" + -v, --verbose Output progress info + -C, --[no-]color Colored output + -j, --raw-json Display raw JSON encoding of the diff + -k, --keys-only Compare only the keys, ignore the differences in values + -h, --help Display this usage information In javascript (ES5):