lodash-get-or-set Get value at path if exists, else set to value, with lodash. import getOrSet from 'lodash-get-or-set' getOrSet(object, path, value)