Skip to content

$setPath inconsistency with undefined fields #10

@mryellow

Description

@mryellow

When a field is defined:

"wrapper": {
	"body": {
		"field1": "bar"
	}
},

$setPath(data, 'wrapper.body.field1', 'foo')

Will update it correctly:

"wrapper": {
	"body": {
		"field1": "foo"
	}
},

However when that same wrapper is not yet defined the result is an object being inserted.

"wrapper": {
	"body": {
		"field1": {}
	}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions