diff --git a/lib/ModelHelpers.js b/lib/ModelHelpers.js index 56266b6..6158253 100644 --- a/lib/ModelHelpers.js +++ b/lib/ModelHelpers.js @@ -1,6 +1,5 @@ var Skmatc = require('skmatc'); var Omnom = require('./utils/Omnom'); -var _ = require('lodash'); var ModelHelpers = (function () { function ModelHelpers(model) { this.model = model; @@ -14,16 +13,6 @@ var ModelHelpers = (function () { ModelHelpers.prototype.validate = function (document) { return this._validator.validate(document); }; - /** - * Creates a selector based on the document's unique _id field in downstream format - * @param {any} id The downstream identifier to use when creating the selector - * @returns {object} A database selector which can be used to return only this document in downstream form - */ - ModelHelpers.prototype.selectOneDownstream = function (document) { - return _.isPlainObject(document) ? document._id : { - _id: document - }; - }; /** * Wraps the given document in an instance wrapper for use throughout the application * @param {any} document The document to be wrapped as an instance diff --git a/lib/ModelHelpers.js.map b/lib/ModelHelpers.js.map index 247d81b..f66e122 100644 --- a/lib/ModelHelpers.js.map +++ b/lib/ModelHelpers.js.map @@ -1 +1 @@ -{"version":3,"file":"ModelHelpers.js","sourceRoot":"","sources":["ModelHelpers.ts"],"names":["ModelHelpers","ModelHelpers.constructor","ModelHelpers.validate","ModelHelpers.selectOneDownstream","ModelHelpers.wrapDocument","ModelHelpers.diff"],"mappings":"AAIA,IAAO,MAAM,WAAW,QAAQ,CAAC,CAAC;AAClC,IAAO,KAAK,WAAW,eAAe,CAAC,CAAC;AACxC,IAAO,CAAC,WAAW,QAAQ,CAAC,CAAC;AAK7B,IAAM,YAAY;IACdA,SADEA,YAAYA,CACKA,KAAkCA;QAAlCC,UAAKA,GAALA,KAAKA,CAA6BA;QACjDA,IAAIA,CAACA,UAAUA,GAAGA,IAAIA,MAAMA,CAACA,KAAKA,CAACA,MAAMA,CAACA,CAACA;IAC/CA,CAACA;IAIDD;;;;OAIGA;IACHA,+BAAQA,GAARA,UAASA,QAAmBA;QACxBE,MAAMA,CAACA,IAAIA,CAACA,UAAUA,CAACA,QAAQA,CAACA,QAAQA,CAACA,CAACA;IAC9CA,CAACA;IAEDF;;;;OAIGA;IACHA,0CAAmBA,GAAnBA,UAAoBA,QAAmBA;QACnCG,MAAMA,CAACA,CAACA,CAACA,aAAaA,CAACA,QAAQA,CAACA,GAAGA,QAAQA,CAACA,GAAGA,GAAGA;YAC9CA,GAAGA,EAAEA,QAAQA;SAChBA,CAACA;IACNA,CAACA;IAEDH;;;;;;OAMGA;IACHA,mCAAYA,GAAZA,UAAaA,QAAmBA,EAAEA,KAAeA,EAAEA,SAAmBA;QAClEI,MAAMA,CAACA,IAAIA,IAAIA,CAACA,KAAKA,CAACA,QAAQA,CAACA,QAAQA,EAAEA,KAAKA,EAAEA,SAASA,CAACA,CAACA;IAC/DA,CAACA;IAEDJ;;;;OAIGA;IACHA,2BAAIA,GAAJA,UAAKA,QAAmBA,EAAEA,QAAmBA;QACzCK,IAAIA,KAAKA,GAAGA,IAAIA,KAAKA,EAAEA,CAACA;QACxBA,KAAKA,CAACA,IAAIA,CAACA,QAAQA,EAAEA,QAAQA,CAACA,CAACA;QAC/BA,MAAMA,CAACA,KAAKA,CAACA,OAAOA,CAACA;IACzBA,CAACA;IACLL,mBAACA;AAADA,CAACA,AAhDD,IAgDC;AAlDD,iBAAS,YAAY,CAAC"} \ No newline at end of file +{"version":3,"file":"ModelHelpers.js","sourceRoot":"","sources":["ModelHelpers.ts"],"names":["ModelHelpers","ModelHelpers.constructor","ModelHelpers.validate","ModelHelpers.wrapDocument","ModelHelpers.diff"],"mappings":"AAIA,IAAO,MAAM,WAAW,QAAQ,CAAC,CAAC;AAClC,IAAO,KAAK,WAAW,eAAe,CAAC,CAAC;AAMxC,IAAM,YAAY;IACdA,SADEA,YAAYA,CACKA,KAAkCA;QAAlCC,UAAKA,GAALA,KAAKA,CAA6BA;QACjDA,IAAIA,CAACA,UAAUA,GAAGA,IAAIA,MAAMA,CAACA,KAAKA,CAACA,MAAMA,CAACA,CAACA;IAC/CA,CAACA;IAIDD;;;;OAIGA;IACHA,+BAAQA,GAARA,UAASA,QAAmBA;QACxBE,MAAMA,CAACA,IAAIA,CAACA,UAAUA,CAACA,QAAQA,CAACA,QAAQA,CAACA,CAACA;IAC9CA,CAACA;IAEDF;;;;;;OAMGA;IACHA,mCAAYA,GAAZA,UAAaA,QAAmBA,EAAEA,KAAeA,EAAEA,SAAmBA;QAClEG,MAAMA,CAACA,IAAIA,IAAIA,CAACA,KAAKA,CAACA,QAAQA,CAACA,QAAQA,EAAEA,KAAKA,EAAEA,SAASA,CAACA,CAACA;IAC/DA,CAACA;IAEDH;;;;OAIGA;IACHA,2BAAIA,GAAJA,UAAKA,QAAmBA,EAAEA,QAAmBA;QACzCI,IAAIA,KAAKA,GAAGA,IAAIA,KAAKA,EAAEA,CAACA;QACxBA,KAAKA,CAACA,IAAIA,CAACA,QAAQA,EAAEA,QAAQA,CAACA,CAACA;QAC/BA,MAAMA,CAACA,KAAKA,CAACA,OAAOA,CAACA;IACzBA,CAACA;IACLJ,mBAACA;AAADA,CAACA,AArCD,IAqCC;AAvCD,iBAAS,YAAY,CAAC"} \ No newline at end of file diff --git a/lib/ModelHelpers.ts b/lib/ModelHelpers.ts index 74d9e2f..51f4183 100644 --- a/lib/ModelHelpers.ts +++ b/lib/ModelHelpers.ts @@ -24,17 +24,6 @@ class ModelHelpers { validate(document: TDocument): SkmatcCore.IResult { return this._validator.validate(document); } - - /** - * Creates a selector based on the document's unique _id field in downstream format - * @param {any} id The downstream identifier to use when creating the selector - * @returns {object} A database selector which can be used to return only this document in downstream form - */ - selectOneDownstream(document: TDocument): any { - return _.isPlainObject(document) ? document._id : { - _id: document - }; - } /** * Wraps the given document in an instance wrapper for use throughout the application