FCF 2.0 development in progress...
> > > >
[News] [Packages API] [Downloads] [Donate to the project] [Contacts]

fcf.normalizeObjectAddress() function

string fcf.normalizeObjectAddress(string|[string|object] a_path)

Package: fcf-framework-core

File: fcf-framework-core:fcf.js

Available from version: 2.0.2

Normalizes the path address to a subfield of an object

Arguments

string|[string|object] a_path
- Source address path to subfield
Result
string
- Normalized address path

Example: Function application

{ let address = fcf.normalizeObjectAddress("field1.field2"); console.log(address) } { let address = fcf.normalizeObjectAddress("field1[field2]"); console.log(address) } { let address = fcf.normalizeObjectAddress(["field1", "field2"]); console.log(address) } { let address = fcf.normalizeObjectAddress(["field1", {part: "field2", array: true}]); console.log(address) }

Output:

["field1"]["field2"] ["field1"]["field2"] ["field1"]["field2"] ["field1"][["field2"]]