diff --git a/index.js b/index.js index db9809d..9e353f8 100644 --- a/index.js +++ b/index.js @@ -1,5 +1,5 @@ const _ = require('lodash'); -const dotify = require('node-dotify'); +const dotify = require('@ladjs/node-dotify'); const pickOriginal = function(transformed, original) { const obj = {}; diff --git a/package.json b/package.json index dd68a63..4713091 100644 --- a/package.json +++ b/package.json @@ -16,13 +16,14 @@ "Nick Baugh (http://niftylettuce.com/)" ], "dependencies": { - "lodash": "^4.17.15", - "node-dotify": "^1.0.1" + "@ladjs/node-dotify": "^1.0.2", + "lodash": "^4.17.15" }, "devDependencies": { "@commitlint/cli": "latest", "@commitlint/config-conventional": "latest", "ava": "latest", + "bson-objectid": "^1.3.0", "codecov": "latest", "cross-env": "latest", "eslint": "6.x", diff --git a/test/test.js b/test/test.js index 566b0bc..8272e10 100644 --- a/test/test.js +++ b/test/test.js @@ -1,3 +1,4 @@ +const ObjectID = require('bson-objectid'); const test = require('ava'); const pickOriginal = require('..'); @@ -65,3 +66,20 @@ test('picks original', t => { } ); }); + +test('works with mongodb objectid', t => { + const _id = new ObjectID(); + t.deepEqual( + pickOriginal( + { + _id + }, + { + _id + } + ), + { + _id + } + ); +}); diff --git a/yarn.lock b/yarn.lock index e91c1fa..b014c73 100644 --- a/yarn.lock +++ b/yarn.lock @@ -330,6 +330,13 @@ resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.2.tgz#26520bf09abe4a5644cd5414e37125a8954241dd" integrity sha512-tsAQNx32a8CoFhjhijUIhI4kccIAgmGhy8LZMZgGfmXcpMbPRUqn5LWmgRttILi6yeGmBJd2xsPkFMs0PzgPCw== +"@ladjs/node-dotify@^1.0.2": + version "1.0.2" + resolved "https://registry.yarnpkg.com/@ladjs/node-dotify/-/node-dotify-1.0.2.tgz#4b83595528e58224374820a346e1ab84492648b8" + integrity sha512-6uAJllEitRqZPj4gBvmz3VkPgMfrukeBZJz0sjdVAQbwRHJR3i1CmM48LUMRlNKpuRV2EEw+ufkdKUda+kHE5g== + dependencies: + bson-objectid "^1.3.0" + "@marionebl/sander@^0.6.0": version "0.6.1" resolved "https://registry.yarnpkg.com/@marionebl/sander/-/sander-0.6.1.tgz#1958965874f24bc51be48875feb50d642fc41f7b" @@ -889,6 +896,11 @@ braces@^3.0.1, braces@~3.0.2: dependencies: fill-range "^7.0.1" +bson-objectid@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/bson-objectid/-/bson-objectid-1.3.0.tgz#f0f4c7c949fece975f12790510d75d7fe39fb456" + integrity sha512-YcB+lRJEEEIcHNLKyhmHujW7OCVE3+xr9IpEhlprBZnXgF3hqeePeexIsAaOtu1SbkgZRlJVUxvYZ3ngUOyIew== + buf-compare@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/buf-compare/-/buf-compare-1.0.1.tgz#fef28da8b8113a0a0db4430b0b6467b69730b34a" @@ -1922,9 +1934,9 @@ eslint-plugin-unicorn@^12.0.0: semver "^6.3.0" eslint-rule-docs@^1.1.5: - version "1.1.192" - resolved "https://registry.yarnpkg.com/eslint-rule-docs/-/eslint-rule-docs-1.1.192.tgz#ab231913923a508eaa65d24e17ba08ab3bc3f935" - integrity sha512-6l6y5X7foq4tkTv9JEGRezAcajiw3pfBUkNt2rEEXnM7D+US3TkbQ4C7F41zaMbf7wkGBOlscdAkNj8zQz/wFA== + version "1.1.193" + resolved "https://registry.yarnpkg.com/eslint-rule-docs/-/eslint-rule-docs-1.1.193.tgz#caaf47dd39663ef4ecd5347465a9b274e9f37be9" + integrity sha512-LhMUMMEPK3X/gTyU3wrpeVoc479n7gOPn1oaIhX1mxdZW6MIfFqB84we+bVivKk1Q9Z00tlD72KMEwzazz/ivQ== eslint-scope@^5.0.0: version "5.0.0" @@ -4078,11 +4090,6 @@ nlcst-to-string@^2.0.0: resolved "https://registry.yarnpkg.com/nlcst-to-string/-/nlcst-to-string-2.0.4.tgz#9315dfab80882bbfd86ddf1b706f53622dc400cc" integrity sha512-3x3jwTd6UPG7vi5k4GEzvxJ5rDA7hVUIRNHPblKuMVP9Z3xmlsd9cgLcpAMkc5uPOBna82EeshROFhsPkbnTZg== -node-dotify@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/node-dotify/-/node-dotify-1.0.1.tgz#ab2eab6d4a01ce37c61a04983c763ed07c29fe46" - integrity sha1-qy6rbUoBzjfGGgSYPHY+0Hwp/kY= - node-fetch@^2.2.0: version "2.6.0" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.0.tgz#e633456386d4aa55863f676a7ab0daa8fdecb0fd"