Core Description
Function prepareObject
object prepareObject(object a_root, string a_objectPath)
Creates a branch of nested objects at the path specified by a_objectPath, the path elements are separated by the "." or "/". Objects are created only if they are absent.
Source file
fcf:fcf.js
Namespace
fcf
Arguments:
object a_root - The root object in which the object nesting branch is created
string a_objectPath - A string describing the elements of the path, separated by characters. or /
Return value:
object
Returns the last object specified in the string a_objectPath.
Examples
Example 1
let root = {};
let NFile = fcf.prepareObject(root, "NFS.NFile");
console.warn(root);
Result:
>> {
NFS: {
NFile: {}
}
}