Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions lib/key-path-helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const ESCAPED_DOT = /\\\./g
const ANY_DOT = /\./g

function hasKeyPath (object, keyPath) {
var keys = splitKeyPath(keyPath)
var keys = this.splitKeyPath(keyPath)
for (var i = 0, len = keys.length; i < len; i++) {
var key = keys[i]
if (object == null || !object.hasOwnProperty(key)) {
Expand All @@ -16,7 +16,7 @@ function hasKeyPath (object, keyPath) {
function getValueAtKeyPath (object, keyPath) {
if (!keyPath) return object

var keys = splitKeyPath(keyPath)
var keys = this.splitKeyPath(keyPath)
for (var i = 0, len = keys.length; i < len; i++) {
var key = keys[i]
object = object[key]
Expand All @@ -28,7 +28,7 @@ function getValueAtKeyPath (object, keyPath) {
}

function setValueAtKeyPath (object, keyPath, value) {
var keys = splitKeyPath(keyPath)
var keys = this.splitKeyPath(keyPath)
while (keys.length > 1) {
var key = keys.shift()
if (object[key] == null) {
Expand All @@ -40,7 +40,7 @@ function setValueAtKeyPath (object, keyPath, value) {
}

function deleteValueAtKeyPath (object, keyPath) {
var keys = splitKeyPath(keyPath)
var keys = this.splitKeyPath(keyPath)
while (keys.length > 1) {
var key = keys.shift()
if (object[key] == null) return;
Expand Down