From 8d3e3118f41135450884f9b6c832a386ea72fa9b Mon Sep 17 00:00:00 2001 From: Benjamin Pannell Date: Mon, 22 Feb 2016 13:57:28 +0200 Subject: [PATCH] fix: Update various libraries to their latest versions --- dist/lib/utils/Omnom.js | 7 +-- dist/lib/utils/Omnom.js.map | 2 +- lib/utils/Omnom.ts | 6 +-- package.json | 51 +++++++++---------- test/Decorators.ts | 4 +- test/support/chai.ts | 2 - tsd.json | 3 -- .../chai-fuzzy/chai-fuzzy.d.ts | 26 ---------- typings/DefinitelyTyped/tsd.d.ts | 1 - 9 files changed, 35 insertions(+), 67 deletions(-) delete mode 100644 typings/DefinitelyTyped/chai-fuzzy/chai-fuzzy.d.ts diff --git a/dist/lib/utils/Omnom.js b/dist/lib/utils/Omnom.js index 1be96fb..b664cde 100644 --- a/dist/lib/utils/Omnom.js +++ b/dist/lib/utils/Omnom.js @@ -21,6 +21,7 @@ var Omnom = (function () { return new Omnom(options).diff(original, modified).changes; }; Omnom.prototype.onObject = function (original, modified, changePath) { + var _this = this; if (original === undefined || original === null) return (original !== modified) && this.set(changePath, modified); if (typeof original == 'number' && typeof modified == 'number' && original !== modified) { @@ -37,14 +38,14 @@ var Omnom = (function () { _.each(modified, function (value, key) { // Handle array diffs in their own special way if (Array.isArray(value) && Array.isArray(original[key])) - this.onArray(original[key], value, this.resolve(changePath, key)); + _this.onArray(original[key], value, _this.resolve(changePath, key)); else - this.onObject(original[key], value, this.resolve(changePath, key)); + _this.onObject(original[key], value, _this.resolve(changePath, key)); }, this); // Unset removed properties _.each(original, function (value, key) { if (modified[key] === undefined) - return this.unset(this.resolve(changePath, key)); + return _this.unset(_this.resolve(changePath, key)); }, this); }; Omnom.prototype.onArray = function (original, modified, changePath) { diff --git a/dist/lib/utils/Omnom.js.map b/dist/lib/utils/Omnom.js.map index e4a9747..e503bc2 100644 --- a/dist/lib/utils/Omnom.js.map +++ b/dist/lib/utils/Omnom.js.map @@ -1 +1 @@ -{"version":3,"sources":["lib/utils/Omnom.ts"],"names":["Omnom","Omnom.constructor","Omnom.changes","Omnom.diff","Omnom.onObject","Omnom.onArray","Omnom.set","Omnom.unset","Omnom.inc","Omnom.push","Omnom.pull","Omnom.pullAll","Omnom.resolve","Omnom.almostEqual"],"mappings":"AAAA,IAAO,CAAC,WAAW,QAAQ,CAAC,CAAC;AAC7B,IAAO,OAAO,WAAW,SAAS,CAAC,CAAC;AAEpC;IACIA,eAAmBA,OAEbA;QAFMC,uBAENA,GAFMA,YAENA;QAFaA,YAAOA,GAAPA,OAAOA,CAEpBA;QACFA,IAAIA,CAACA,QAAQA,GAAGA,EAAEA,CAACA;IACvBA,CAACA;IAUDD,sBAAIA,0BAAOA;aAAXA;YAQIE,MAAMA,CAACA,IAAIA,CAACA,QAAQA,CAACA;QACzBA,CAACA;;;OAAAF;IAMDA,oBAAIA,GAAJA,UAAKA,QAAaA,EAAEA,QAAaA;QAC7BG,IAAIA,CAACA,QAAQA,CAACA,QAAQA,EAAEA,QAAQA,CAACA,CAACA;QAClCA,MAAMA,CAACA,IAAIA,CAACA;IAChBA,CAACA;IAcMH,UAAIA,GAAXA,UAAYA,QAAaA,EAAEA,QAAaA,EAAEA,OAEzCA;QACGG,MAAMA,CAACA,IAAIA,KAAKA,CAACA,OAAOA,CAACA,CAACA,IAAIA,CAACA,QAAQA,EAAEA,QAAQA,CAACA,CAACA,OAAOA,CAACA;IAC/DA,CAACA;IAMOH,wBAAQA,GAAhBA,UAAiBA,QAAaA,EAAEA,QAAaA,EAAEA,UAAmBA;QAC9DI,EAAEA,CAACA,CAACA,QAAQA,KAAKA,SAASA,IAAIA,QAAQA,KAAKA,IAAIA,CAACA;YAC5CA,MAAMA,CAACA,CAACA,QAAQA,KAAKA,QAAQA,CAACA,IAAIA,IAAIA,CAACA,GAAGA,CAACA,UAAUA,EAAEA,QAAQA,CAACA,CAACA;QAErEA,EAAEA,CAACA,CAACA,OAAOA,QAAQA,IAAIA,QAAQA,IAAIA,OAAOA,QAAQA,IAAIA,QAAQA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AEnDA,IAAIA,eAAeA,GAAGA,CAACA,CAACA;QACxBA,GAAGA,CAACA,CAACA,GAAGA,CAACA,CAACA,GAAGA,CAACA,EAAEA,CAACA,GAAGA,UAAUA,CAACA,MAAMA,EAAEA,CAACA,EAAEA;YACtCA,EAAEA,CAACA,CAACA,IAAIA,CAACA,WAAWA,CAACA,EAAEA,CAACA,UAAUA,CAACA,CAACA,CAACA,CAACA,EAAEA,EAAEA,CAACA,UAAUA,CAACA,CAACA,CAACA,CAACA,CAACA,GAAGA,CAACA,CAACA;gBAACA,eAAeA,EAAEA,CAACA;QAEtFA,MAAMA,CAACA,CAACA,GAAGA,CAACA,cAAcA,GAAGA,SAASA,CAACA,GAAGA,CAACA,eAAeA,GAAGA,UAAUA,CAACA,MAAMA,CAACA,CAACA;IACpFA,CAACA;IACLb,YAACA;AAADA,CAhPA,AAgPCA,IAAA;AAhPY,aAAK,QAgPjB,CAAA","file":"lib/utils/Omnom.js","sourcesContent":["import _ = require('lodash');\r\nimport MongoDB = require('mongodb');\r\n\r\nexport class Omnom {\r\n constructor(public options: {\r\n atomicNumbers?: boolean;\r\n } = {}) {\r\n this._changes = {};\r\n }\r\n\r\n private _changes: {\r\n $set?: any;\r\n $unset?: any;\r\n $inc?: any;\r\n $push?: any;\r\n $pull?: any;\r\n $pullAll?: any;\r\n };\r\n get changes(): {\r\n $set?: any;\r\n $unset?: any;\r\n $inc?: any;\r\n $push?: any;\r\n $pull?: any;\r\n $pullAll?: any;\r\n } {\r\n return this._changes;\r\n }\r\n\r\n diff(original: number, modified: number): Omnom;\r\n diff(original: [any], modified: any[]): Omnom;\r\n diff(original: MongoDB.ObjectID, modified: MongoDB.ObjectID): Omnom;\r\n diff(original: Object, modified: Object): Omnom;\r\n diff(original: any, modified: any): Omnom {\r\n this.onObject(original, modified);\r\n return this;\r\n }\r\n\r\n static diff(original: number, modified: number, options?: {\r\n atomicNumbers?: boolean;\r\n });\r\n static diff(original: [any], modified: any[], options?: {\r\n atomicNumbers?: boolean;\r\n });\r\n static diff(original: MongoDB.ObjectID, modified: MongoDB.ObjectID, options?: {\r\n atomicNumbers?: boolean;\r\n });\r\n static diff(original: Object, modified: Object, options?: {\r\n atomicNumbers?: boolean;\r\n });\r\n static diff(original: any, modified: any, options?: {\r\n atomicNumbers?: boolean;\r\n }) {\r\n return new Omnom(options).diff(original, modified).changes;\r\n }\r\n\r\n private onObject(original: number, modified: number, changePath?: string);\r\n private onObject(original: [any], modified: any[], changePath?: string);\r\n private onObject(original: MongoDB.ObjectID, modified: MongoDB.ObjectID, changePath?: string);\r\n private onObject(original: Object, modified: Object, changePath?: string);\r\n private onObject(original: any, modified: any, changePath?: string) {\r\n if (original === undefined || original === null)\r\n return (original !== modified) && this.set(changePath, modified);\r\n\r\n if (typeof original == 'number' && typeof modified == 'number' && original !== modified) {\r\n if (this.options.atomicNumbers) return this.inc(changePath, modified - original);\r\n return this.set(changePath, modified);\r\n }\r\n\r\n if (Array.isArray(original) && Array.isArray(modified))\r\n return this.onArray(original, modified, changePath);\r\n\r\n if (original instanceof MongoDB.ObjectID && modified instanceof MongoDB.ObjectID)\r\n return !original.equals(modified) && this.set(changePath, modified);\r\n\r\n if (!_.isPlainObject(original) || !_.isPlainObject(modified))\r\n return !_.isEqual(original, modified) && this.set(changePath, modified);\r\n\r\n _.each(modified, function (value, key) {\r\n // Handle array diffs in their own special way\r\n if (Array.isArray(value) && Array.isArray(original[key])) this.onArray(original[key], value, this.resolve(changePath, key));\r\n\r\n // Otherwise, just keep going\r\n else this.onObject(original[key], value, this.resolve(changePath, key));\r\n }, this);\r\n\r\n // Unset removed properties\r\n _.each(original, function (value, key) {\r\n if (modified[key] === undefined) return this.unset(this.resolve(changePath, key));\r\n }, this);\r\n }\r\n\r\n private onArray(original: [any], modified: [any], changePath: string) {\r\n var i, j;\r\n\r\n // Check if we can get from original => modified using just pulls\r\n if (original.length > modified.length) {\r\n var pulls = [];\r\n for (i = 0, j = 0; i < original.length && j < modified.length; i++) {\r\n if (this.almostEqual(original[i], modified[j])) j++;\r\n else pulls.push(original[i]);\r\n }\r\n\r\n for (; i < original.length; i++)\r\n pulls.push(original[i]);\r\n\r\n if (j === modified.length) {\r\n if (pulls.length === 1) return this.pull(changePath, pulls[0]);\r\n // We can complete using just pulls\r\n return pulls.forEach((pull) => this.pull(changePath, pull));\r\n }\r\n\r\n // If we have a smaller target array than our source, we will need to re-create it\r\n // regardless (if we want to do so in a single operation anyway)\r\n else return this.set(changePath, modified);\r\n }\r\n\r\n // Check if we can get from original => modified using just pushes\r\n if (original.length < modified.length) {\r\n var canPush = true;\r\n for (i = 0; i < original.length; i++)\r\n if (this.almostEqual(original[i], modified[i]) < 1) {\r\n canPush = false;\r\n break;\r\n }\r\n\r\n if (canPush) {\r\n for (i = original.length; i < modified.length; i++)\r\n this.push(changePath, modified[i]);\r\n return;\r\n }\r\n }\r\n\r\n // Otherwise, we need to use $set to generate the new array\r\n\r\n // Check how many manipulations would need to be performed, if it's more than half the array size\r\n // then rather re-create the array\r\n\r\n var sets = [];\r\n var partials = [];\r\n for (i = 0; i < modified.length; i++) {\r\n var equality = this.almostEqual(original[i], modified[i]);\r\n if (equality === 0) sets.push(i);\r\n else if (equality < 1) partials.push(i);\r\n }\r\n\r\n if (sets.length > modified.length / 2)\r\n return this.set(changePath, modified);\r\n\r\n for (i = 0; i < sets.length; i++)\r\n this.set(this.resolve(changePath, sets[i].toString()), modified[sets[i]]);\r\n\r\n for (i = 0; i < partials.length; i++)\r\n this.onObject(original[partials[i]], modified[partials[i]], this.resolve(changePath, partials[i].toString()));\r\n }\r\n\r\n private set(path: string, value: any) {\r\n if (!this.changes.$set)\r\n this.changes.$set = {};\r\n\r\n this.changes.$set[path] = value;\r\n }\r\n\r\n private unset(path: string) {\r\n if (!this.changes.$unset)\r\n this.changes.$unset = {};\r\n\r\n this.changes.$unset[path] = 1;\r\n }\r\n\r\n private inc(path: string, value: number) {\r\n if (!this.changes.$inc)\r\n this.changes.$inc = {};\r\n\r\n this.changes.$inc[path] = value;\r\n }\r\n\r\n private push(path: string, value: any) {\r\n if (!this.changes.$push)\r\n this.changes.$push = {};\r\n\r\n if (this.changes.$push[path]) {\r\n if (this.changes.$push[path].$each)\r\n this.changes.$push[path].$each.push(value);\r\n else\r\n this.changes.$push[path] = { $each: [this.changes.$push[path], value] };\r\n } else this.changes.$push[path] = value;\r\n }\r\n\r\n private pull(path: string, value: any) {\r\n if (!this.changes.$pull)\r\n this.changes.$pull = {};\r\n\r\n if (this.changes.$pullAll && this.changes.$pullAll[path]) {\r\n return this.changes.$pullAll[path].push(value);\r\n }\r\n\r\n if (this.changes.$pull[path]) {\r\n this.pullAll(path, [this.changes.$pull[path], value]);\r\n delete this.changes.$pull[path];\r\n if (_.keys(this.changes.$pull).length === 0)\r\n delete this.changes.$pull;\r\n return;\r\n }\r\n\r\n this.changes.$pull[path] = value;\r\n }\r\n\r\n private pullAll(path: string, values: any[]) {\r\n if (!this.changes.$pullAll)\r\n this.changes.$pullAll = {};\r\n\r\n this.changes.$pullAll[path] = values;\r\n }\r\n\r\n private resolve(...args) {\r\n var validArguments = [];\r\n args.forEach(function (arg) {\r\n if (arg) validArguments.push(arg);\r\n });\r\n return validArguments.join('.');\r\n }\r\n\r\n private almostEqual(o1: Object, o2: Object);\r\n private almostEqual(o1: any, o2: any) {\r\n if (!_.isPlainObject(o1) || !_.isPlainObject(o2)) return o1 == o2 ? 1 : 0;\r\n\r\n var o1i, o1k = Object.keys(o1);\r\n var o2k = Object.keys(o2);\r\n\r\n var commonKeys = [];\r\n for (o1i = 0; o1i < o1k.length; o1i++)\r\n if (~o2k.indexOf(o1k[o1i])) commonKeys.push(o1k[o1i]);\r\n\r\n var totalKeys = o1k.length + o2k.length - commonKeys.length;\r\n var keysDifference = totalKeys - commonKeys.length;\r\n\r\n var requiredChanges = 0;\r\n for (var i = 0; i < commonKeys.length; i++)\r\n if (this.almostEqual(o1[commonKeys[i]], o2[commonKeys[i]]) < 1) requiredChanges++;\r\n\r\n return 1 - (keysDifference / totalKeys) - (requiredChanges / commonKeys.length);\r\n }\r\n}"],"sourceRoot":"/source/"} \ No newline at end of file +{"version":3,"sources":["lib/utils/Omnom.ts"],"names":["Omnom","Omnom.constructor","Omnom.changes","Omnom.diff","Omnom.onObject","Omnom.onArray","Omnom.set","Omnom.unset","Omnom.inc","Omnom.push","Omnom.pull","Omnom.pullAll","Omnom.resolve","Omnom.almostEqual"],"mappings":"AAAA,IAAO,CAAC,WAAW,QAAQ,CAAC,CAAC;AAC7B,IAAO,OAAO,WAAW,SAAS,CAAC,CAAC;AAEpC;IACIA,eAAmBA,OAEbA;QAFMC,uBAENA,GAFMA,YAENA;QAFaA,YAAOA,GAAPA,OAAOA,CAEpBA;QACFA,IAAIA,CAACA,QAAQA,GAAGA,EAAEA,CAACA;IACvBA,CAACA;IAUDD,sBAAIA,0BAAOA;aAAXA;YAQIE,MAAMA,CAACA,IAAIA,CAACA,QAAQA,CAACA;QACzBA,CAACA;;;OAAAF;IAMDA,oBAAIA,GAAJA,UAAKA,QAAaA,EAAEA,QAAaA;QAC7BG,IAAIA,CAACA,QAAQA,CAACA,QAAQA,EAAEA,QAAQA,CAACA,CAACA;QAClCA,MAAMA,CAACA,IAAIA,CAACA;IAChBA,CAACA;IAcMH,UAAIA,GAAXA,UAAYA,QAAaA,EAAEA,QAAaA,EAAEA,OAEzCA;QACGG,MAAMA,CAACA,IAAIA,KAAKA,CAACA,OAAOA,CAACA,CAACA,IAAIA,CAACA,QAAQA,EAAEA,QAAQA,CAACA,CAACA,OAAOA,CAACA;IAC/DA,CAACA;IAMOH,wBAAQA,GAAhBA,UAAiBA,QAAaA,EAAEA,QAAaA,EAAEA,UAAmBA;QAAlEI,iBA8BCA;QA7BGA,EAAEA,CAACA,CAACA,QAAQA,KAAKA,SAASA,IAAIA,QAAQA,KAAKA,IAAIA,CAACA;YAC5CA,MAAMA,CAACA,CAACA,QAAQA,KAAKA,QAAQA,CAACA,IAAIA,IAAIA,CAACA,GAAGA,CAACA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AE1DA,IAAIA,SAASA,GAAGA,GAAGA,CAACA,MAAMA,GAAGA,GAAGA,CAACA,MAAMA,GAAGA,UAAUA,CAACA,MAAMA,CAACA;QAC5DA,IAAIA,cAAcA,GAAGA,SAASA,GAAGA,UAAUA,CAACA,MAAMA,CAACA;QAEnDA,IAAIA,eAAeA,GAAGA,CAACA,CAACA;QACxBA,GAAGA,CAACA,CAACA,GAAGA,CAACA,CAACA,GAAGA,CAACA,EAAEA,CAACA,GAAGA,UAAUA,CAACA,MAAMA,EAAEA,CAACA,EAAEA;YACtCA,EAAEA,CAACA,CAACA,IAAIA,CAACA,WAAWA,CAACA,EAAEA,CAACA,UAAUA,CAACA,CAACA,CAACA,CAACA,EAAEA,EAAEA,CAACA,UAAUA,CAACA,CAACA,CAACA,CAACA,CAACA,GAAGA,CAACA,CAACA;gBAACA,eAAeA,EAAEA,CAACA;QAEtFA,MAAMA,CAACA,CAACA,GAAGA,CAACA,cAAcA,GAAGA,SAASA,CAACA,GAAGA,CAACA,eAAeA,GAAGA,UAAUA,CAACA,MAAMA,CAACA,CAACA;IACpFA,CAACA;IACLb,YAACA;AAADA,CAhPA,AAgPCA,IAAA;AAhPY,aAAK,QAgPjB,CAAA","file":"lib/utils/Omnom.js","sourcesContent":["import _ = require('lodash');\r\nimport MongoDB = require('mongodb');\r\n\r\nexport class Omnom {\r\n constructor(public options: {\r\n atomicNumbers?: boolean;\r\n } = {}) {\r\n this._changes = {};\r\n }\r\n\r\n private _changes: {\r\n $set?: any;\r\n $unset?: any;\r\n $inc?: any;\r\n $push?: any;\r\n $pull?: any;\r\n $pullAll?: any;\r\n };\r\n get changes(): {\r\n $set?: any;\r\n $unset?: any;\r\n $inc?: any;\r\n $push?: any;\r\n $pull?: any;\r\n $pullAll?: any;\r\n } {\r\n return this._changes;\r\n }\r\n\r\n diff(original: number, modified: number): Omnom;\r\n diff(original: [any], modified: any[]): Omnom;\r\n diff(original: MongoDB.ObjectID, modified: MongoDB.ObjectID): Omnom;\r\n diff(original: Object, modified: Object): Omnom;\r\n diff(original: any, modified: any): Omnom {\r\n this.onObject(original, modified);\r\n return this;\r\n }\r\n\r\n static diff(original: number, modified: number, options?: {\r\n atomicNumbers?: boolean;\r\n });\r\n static diff(original: [any], modified: any[], options?: {\r\n atomicNumbers?: boolean;\r\n });\r\n static diff(original: MongoDB.ObjectID, modified: MongoDB.ObjectID, options?: {\r\n atomicNumbers?: boolean;\r\n });\r\n static diff(original: Object, modified: Object, options?: {\r\n atomicNumbers?: boolean;\r\n });\r\n static diff(original: any, modified: any, options?: {\r\n atomicNumbers?: boolean;\r\n }) {\r\n return new Omnom(options).diff(original, modified).changes;\r\n }\r\n\r\n private onObject(original: number, modified: number, changePath?: string);\r\n private onObject(original: [any], modified: any[], changePath?: string);\r\n private onObject(original: MongoDB.ObjectID, modified: MongoDB.ObjectID, changePath?: string);\r\n private onObject(original: Object, modified: Object, changePath?: string);\r\n private onObject(original: any, modified: any, changePath?: string) {\r\n if (original === undefined || original === null)\r\n return (original !== modified) && this.set(changePath, modified);\r\n\r\n if (typeof original == 'number' && typeof modified == 'number' && original !== modified) {\r\n if (this.options.atomicNumbers) return this.inc(changePath, modified - original);\r\n return this.set(changePath, modified);\r\n }\r\n\r\n if (Array.isArray(original) && Array.isArray(modified))\r\n return this.onArray(original, modified, changePath);\r\n\r\n if (original instanceof MongoDB.ObjectID && modified instanceof MongoDB.ObjectID)\r\n return !original.equals(modified) && this.set(changePath, modified);\r\n\r\n if (!_.isPlainObject(original) || !_.isPlainObject(modified))\r\n return !_.isEqual(original, modified) && this.set(changePath, modified);\r\n\r\n _.each(modified, (value, key) => {\r\n // Handle array diffs in their own special way\r\n if (Array.isArray(value) && Array.isArray(original[key])) this.onArray(original[key], value, this.resolve(changePath, key));\r\n\r\n // Otherwise, just keep going\r\n else this.onObject(original[key], value, this.resolve(changePath, key));\r\n }, this);\r\n\r\n // Unset removed properties\r\n _.each(original, (value, key) => {\r\n if (modified[key] === undefined) return this.unset(this.resolve(changePath, key));\r\n }, this);\r\n }\r\n\r\n private onArray(original: any[], modified: any[], changePath: string) {\r\n var i, j;\r\n\r\n // Check if we can get from original => modified using just pulls\r\n if (original.length > modified.length) {\r\n var pulls = [];\r\n for (i = 0, j = 0; i < original.length && j < modified.length; i++) {\r\n if (this.almostEqual(original[i], modified[j])) j++;\r\n else pulls.push(original[i]);\r\n }\r\n\r\n for (; i < original.length; i++)\r\n pulls.push(original[i]);\r\n\r\n if (j === modified.length) {\r\n if (pulls.length === 1) return this.pull(changePath, pulls[0]);\r\n // We can complete using just pulls\r\n return pulls.forEach((pull) => this.pull(changePath, pull));\r\n }\r\n\r\n // If we have a smaller target array than our source, we will need to re-create it\r\n // regardless (if we want to do so in a single operation anyway)\r\n else return this.set(changePath, modified);\r\n }\r\n\r\n // Check if we can get from original => modified using just pushes\r\n if (original.length < modified.length) {\r\n var canPush = true;\r\n for (i = 0; i < original.length; i++)\r\n if (this.almostEqual(original[i], modified[i]) < 1) {\r\n canPush = false;\r\n break;\r\n }\r\n\r\n if (canPush) {\r\n for (i = original.length; i < modified.length; i++)\r\n this.push(changePath, modified[i]);\r\n return;\r\n }\r\n }\r\n\r\n // Otherwise, we need to use $set to generate the new array\r\n\r\n // Check how many manipulations would need to be performed, if it's more than half the array size\r\n // then rather re-create the array\r\n\r\n var sets = [];\r\n var partials = [];\r\n for (i = 0; i < modified.length; i++) {\r\n var equality = this.almostEqual(original[i], modified[i]);\r\n if (equality === 0) sets.push(i);\r\n else if (equality < 1) partials.push(i);\r\n }\r\n\r\n if (sets.length > modified.length / 2)\r\n return this.set(changePath, modified);\r\n\r\n for (i = 0; i < sets.length; i++)\r\n this.set(this.resolve(changePath, sets[i].toString()), modified[sets[i]]);\r\n\r\n for (i = 0; i < partials.length; i++)\r\n this.onObject(original[partials[i]], modified[partials[i]], this.resolve(changePath, partials[i].toString()));\r\n }\r\n\r\n private set(path: string, value: any) {\r\n if (!this.changes.$set)\r\n this.changes.$set = {};\r\n\r\n this.changes.$set[path] = value;\r\n }\r\n\r\n private unset(path: string) {\r\n if (!this.changes.$unset)\r\n this.changes.$unset = {};\r\n\r\n this.changes.$unset[path] = 1;\r\n }\r\n\r\n private inc(path: string, value: number) {\r\n if (!this.changes.$inc)\r\n this.changes.$inc = {};\r\n\r\n this.changes.$inc[path] = value;\r\n }\r\n\r\n private push(path: string, value: any) {\r\n if (!this.changes.$push)\r\n this.changes.$push = {};\r\n\r\n if (this.changes.$push[path]) {\r\n if (this.changes.$push[path].$each)\r\n this.changes.$push[path].$each.push(value);\r\n else\r\n this.changes.$push[path] = { $each: [this.changes.$push[path], value] };\r\n } else this.changes.$push[path] = value;\r\n }\r\n\r\n private pull(path: string, value: any) {\r\n if (!this.changes.$pull)\r\n this.changes.$pull = {};\r\n\r\n if (this.changes.$pullAll && this.changes.$pullAll[path]) {\r\n return this.changes.$pullAll[path].push(value);\r\n }\r\n\r\n if (this.changes.$pull[path]) {\r\n this.pullAll(path, [this.changes.$pull[path], value]);\r\n delete this.changes.$pull[path];\r\n if (_.keys(this.changes.$pull).length === 0)\r\n delete this.changes.$pull;\r\n return;\r\n }\r\n\r\n this.changes.$pull[path] = value;\r\n }\r\n\r\n private pullAll(path: string, values: any[]) {\r\n if (!this.changes.$pullAll)\r\n this.changes.$pullAll = {};\r\n\r\n this.changes.$pullAll[path] = values;\r\n }\r\n\r\n private resolve(...args) {\r\n var validArguments = [];\r\n args.forEach(function (arg) {\r\n if (arg) validArguments.push(arg);\r\n });\r\n return validArguments.join('.');\r\n }\r\n\r\n private almostEqual(o1: Object, o2: Object);\r\n private almostEqual(o1: any, o2: any) {\r\n if (!_.isPlainObject(o1) || !_.isPlainObject(o2)) return o1 == o2 ? 1 : 0;\r\n\r\n var o1i, o1k = Object.keys(o1);\r\n var o2k = Object.keys(o2);\r\n\r\n var commonKeys = [];\r\n for (o1i = 0; o1i < o1k.length; o1i++)\r\n if (~o2k.indexOf(o1k[o1i])) commonKeys.push(o1k[o1i]);\r\n\r\n var totalKeys = o1k.length + o2k.length - commonKeys.length;\r\n var keysDifference = totalKeys - commonKeys.length;\r\n\r\n var requiredChanges = 0;\r\n for (var i = 0; i < commonKeys.length; i++)\r\n if (this.almostEqual(o1[commonKeys[i]], o2[commonKeys[i]]) < 1) requiredChanges++;\r\n\r\n return 1 - (keysDifference / totalKeys) - (requiredChanges / commonKeys.length);\r\n }\r\n}"],"sourceRoot":"/source/"} \ No newline at end of file diff --git a/lib/utils/Omnom.ts b/lib/utils/Omnom.ts index 1646bff..53c09a0 100644 --- a/lib/utils/Omnom.ts +++ b/lib/utils/Omnom.ts @@ -76,7 +76,7 @@ export class Omnom { if (!_.isPlainObject(original) || !_.isPlainObject(modified)) return !_.isEqual(original, modified) && this.set(changePath, modified); - _.each(modified, function (value, key) { + _.each(modified, (value, key) => { // Handle array diffs in their own special way if (Array.isArray(value) && Array.isArray(original[key])) this.onArray(original[key], value, this.resolve(changePath, key)); @@ -85,12 +85,12 @@ export class Omnom { }, this); // Unset removed properties - _.each(original, function (value, key) { + _.each(original, (value, key) => { if (modified[key] === undefined) return this.unset(this.resolve(changePath, key)); }, this); } - private onArray(original: [any], modified: [any], changePath: string) { + private onArray(original: any[], modified: any[], changePath: string) { var i, j; // Check if we can get from original => modified using just pulls diff --git a/package.json b/package.json index 4e1e2d8..3a23e4b 100644 --- a/package.json +++ b/package.json @@ -29,40 +29,39 @@ "node": ">= 0.10" }, "dependencies": { - "bluebird": "^2.10.1", - "lodash": "^3.10.1", - "mongodb": "^2.0.44", - "skmatc": "^1.1.4" + "bluebird": "^3.3.1", + "lodash": "^4.5.1", + "mongodb": "~2.1.7", + "skmatc": "^1.2.0" }, "devDependencies": { - "chai": "^2.2.0", - "chai-as-promised": "^5.1.0", - "chai-fuzzy": "^1.6.0", - "codeclimate-test-reporter": "~0.0.4", - "coveralls": "^2.11.4", - "del": "^1.2.1", - "gulp": "^3.9.0", - "gulp-bump": "~0.3.1", - "gulp-git": "^1.4.0", - "gulp-istanbul": "^0.10.1", - "gulp-mocha": "^2.1.3", - "gulp-plumber": "^1.0.1", - "gulp-replace": "^0.5.4", - "gulp-sourcemaps": "^1.6.0", + "chai": "^3.5.0", + "chai-as-promised": "^5.2.0", + "codeclimate-test-reporter": "^0.3.1", + "coveralls": "^2.11.6", + "del": "^2.2.0", + "gulp": "^3.9.1", + "gulp-bump": "^1.0.0", + "gulp-git": "~1.7.0", + "gulp-istanbul": "~0.10.3", + "gulp-mocha": "~2.2.0", + "gulp-plumber": "~1.1.0", + "gulp-replace": "~0.5.4", + "gulp-sourcemaps": "~1.6.0", "gulp-typedoc": "^1.2.1", - "gulp-typescript": "^2.9.0", - "gulp-util": "^3.0.6", - "istanbul": "^0.3.21", + "gulp-typescript": "^2.11.0", + "gulp-util": "~3.0.7", + "istanbul": "~0.4.2", "jshint": "^2.8.0", "minimist": "^1.2.0", - "mocha": "^2.3.3", + "mocha": "^2.4.5", "require-dir": "~0.3.0", "run-sequence": "^1.1.4", - "semver": "^4.3.6", + "semver": "^5.1.0", "tick": "~0.1.1", - "typedoc": "^0.3.11", - "typescript": "^1.6.2", - "underscore": "^1.8.3" + "typedoc": "~0.3.12", + "typescript": "~1.7.5", + "underscore": "~1.8.3" }, "keywords": [ "mongodb", diff --git a/test/Decorators.ts b/test/Decorators.ts index 6a06b9e..c4149ea 100644 --- a/test/Decorators.ts +++ b/test/Decorators.ts @@ -58,11 +58,11 @@ describe("Decorators", () => { }); it("should support just spec indexes", () => { - chai.expect(Test.indexes).to.containOneLike({ spec: { name: 1 }, options: {} }); + chai.expect(Test.indexes).to.contain({ spec: { name: 1 }, options: {} }); }); it("should support indexes with both a spec and options", () => { - chai.expect(Test.indexes).to.containOneLike({ spec: { email: 1 }, options: { background: true }}); + chai.expect(Test.indexes).to.contain({ spec: { email: 1 }, options: { background: true }}); }); it("should not pollute the parent's index object", () => { diff --git a/test/support/chai.ts b/test/support/chai.ts index de14511..a897a0e 100644 --- a/test/support/chai.ts +++ b/test/support/chai.ts @@ -2,12 +2,10 @@ import chai = require('chai'); import chaiAsPromised = require('chai-as-promised'); import Bluebird = require('bluebird'); -var chaiFuzzy = require('chai-fuzzy'); Bluebird.longStackTraces(); chai.use(chaiAsPromised); -chai.use(chaiFuzzy); global.chai = chai; global.expect = chai.expect; \ No newline at end of file diff --git a/tsd.json b/tsd.json index b146a54..e303ec0 100644 --- a/tsd.json +++ b/tsd.json @@ -20,9 +20,6 @@ "mocha/mocha.d.ts": { "commit": "cb08e83dd87ace1202d1032a8f275b3efacde5c3" }, - "chai-fuzzy/chai-fuzzy.d.ts": { - "commit": "cb08e83dd87ace1202d1032a8f275b3efacde5c3" - }, "chai/chai.d.ts": { "commit": "cb08e83dd87ace1202d1032a8f275b3efacde5c3" }, diff --git a/typings/DefinitelyTyped/chai-fuzzy/chai-fuzzy.d.ts b/typings/DefinitelyTyped/chai-fuzzy/chai-fuzzy.d.ts deleted file mode 100644 index f080fbc..0000000 --- a/typings/DefinitelyTyped/chai-fuzzy/chai-fuzzy.d.ts +++ /dev/null @@ -1,26 +0,0 @@ -// Type definitions for chai-fuzzy 1.3.0 -// Project: http://chaijs.com/plugins/chai-fuzzy -// Definitions by: Bart van der Schoor -// Definitions: https://github.com/borisyankov/DefinitelyTyped - -/// - -declare module chai { - interface LanguageChains { - like(exp:any, msg?:string); - notLike(exp:any, msg?:string); - containOneLike(exp:any, msg?:string); - notContainOneLike(exp:any, msg?:string); - jsonOf(exp:any, msg?:string); - notJsonOf(exp:any, msg?:string); - } - - interface Assert { - like(act:any, exp:any, msg?:string); - notLike(act:any, exp:any, msg?:string); - containOneLike(act:any, exp:any, msg?:string); - notContainOneLike(act:any, exp:any, msg?:string); - jsonOf(act:any, exp:any, msg?:string); - notJsonOf(act:any, exp:any, msg?:string); - } -} diff --git a/typings/DefinitelyTyped/tsd.d.ts b/typings/DefinitelyTyped/tsd.d.ts index 6dd6c1e..7e171c6 100644 --- a/typings/DefinitelyTyped/tsd.d.ts +++ b/typings/DefinitelyTyped/tsd.d.ts @@ -3,6 +3,5 @@ /// /// /// -/// /// ///