String.prototype.substr() is deprecated (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substr) so we replace it with similar functions which aren't deprecated.
Signed-off-by: Tobias Speicher <rootcommander@gmail.com>
return true;
}
const type = Object.prototype.toString.call(value);
- if (type.substr(0, 7) === '[object' && type.substr(-6) === 'Array]') {
+ if (type.slice(0, 7) === '[object' && type.slice(-6) === 'Array]') {
return true;
}
return false;
let pos = 0;
let idx = indexOfDotOrLength(key, pos);
while (obj && idx > pos) {
- obj = obj[key.substr(pos, idx - pos)];
+ obj = obj[key.slice(pos, idx)];
pos = idx + 1;
idx = indexOfDotOrLength(key, pos);
}