Skip to content

Commit

Permalink
NODEJS-665: Remove Object.hasOwn() and update nodejs version specifie…
Browse files Browse the repository at this point in the history
…d in package.json (datastax#415)
  • Loading branch information
absurdfarce authored Sep 21, 2023
1 parent d76f794 commit fe8f32c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/encoder.js
Original file line number Diff line number Diff line change
Expand Up @@ -1999,7 +1999,7 @@ function buildParameterizedCustomType(customTypeName, args) {
function invertObject(obj) {
const rv = {};
for(const k in obj){
if (Object.hasOwn(obj,k)) {
if (obj.hasOwnProperty(k)) {
rv[obj[k]] = k;
}
}
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
},
"devDependencies": {
"chai": "~4.3.8",
"mocha": "~10.2.0",
"kerberos": "~2.0.3",
"mocha": "~10.2.0",
"mocha-jenkins-reporter": "~0.4.8",
"proxyquire": "~2.1.3",
"sinon": "~15.2.0",
Expand All @@ -53,6 +53,6 @@
"eslint": "eslint lib test"
},
"engines": {
"node": ">=8"
"node": ">=16"
}
}
4 changes: 2 additions & 2 deletions test/unit/encoder-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,7 @@ describe('encoder', function () {
const decoded = encoder.decode(encoded, guessedTypeObj);
helper.assertInstanceOf(decoded, Float32Array);
for (const k in decoded) {
if (Object.hasOwn(decoded,k)) {
if (decoded.hasOwnProperty(k)) {
assert.equal(decoded[k],refVal[k]);
}
else {
Expand All @@ -705,7 +705,7 @@ describe('encoder', function () {
const decoded = encoder.decode(encoded, typeObj);
helper.assertInstanceOf(decoded, Float32Array);
for (const k in decoded) {
if (Object.hasOwn(decoded,k)) {
if (decoded.hasOwnProperty(k)) {
assert.equal(decoded[k],refVal[k]);
}
else {
Expand Down

0 comments on commit fe8f32c

Please sign in to comment.