Skip to content
This repository was archived by the owner on Apr 5, 2026. It is now read-only.

Commit 6cc3100

Browse files
committed
use includes rather than indexOf for readability
1 parent 334c32b commit 6cc3100

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

dottie.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
// Guard against prototype pollution at ANY position in the path
7777
// Covers __proto__, constructor, and prototype to prevent all known vectors
7878
var DANGEROUS_KEYS = ['__proto__', 'constructor', 'prototype'];
79-
if (pieces.some(function(p) { return DANGEROUS_KEYS.indexOf(p) !== -1; })) return;
79+
if (pieces.some(function(p) { return DANGEROUS_KEYS.includes(p); })) return;
8080

8181
if (typeof current !== 'object') {
8282
throw new Error('Parent is not an object.');
@@ -148,7 +148,7 @@
148148

149149
// Guard against prototype pollution at ANY position in the path
150150
var DANGEROUS_KEYS = ['__proto__', 'constructor', 'prototype'];
151-
if (pieces.some(function(p) { return DANGEROUS_KEYS.indexOf(p) !== -1; })) break;
151+
if (pieces.some(function(p) { return DANGEROUS_KEYS.includes(p); })) break;
152152

153153
piecesLength = pieces.length;
154154
current = transformed;

0 commit comments

Comments
 (0)