StructKeyTranslate()
Converts any struct keys with dot notation into nested structures
StructKeyTranslate( struct=struct, deepTranslation=boolean, leaveOriginalKey=boolean );
Returns: Number
| Argument | Description |
|---|---|
|
struct
struct,
required
|
edit
Structure to translate Alias: structure, object |
|
deepTranslation
boolean,
optional
|
edit
also translate keys of child structures |
|
leaveOriginalKey
boolean,
optional
|
edit
leave original key in struct |
Examples
editNon-Member Function
animals = {
cow: {
noise: "moo",
size: "large"
},
"bird.noise": "chirp",
"bird.size": "small"
};
// Show all animals
Dump(
label: "All animals",
var: animals
);
// Call function
StructKeyTranslate(animals);
// Show all animals after keyTranslate
Dump(
label: "All animals after keyTranslate",
var: animals
);
See also
- Structures
- struct.keyTranslate()
- Search Issue Tracker open_in_new
- Search Lucee Test Cases open_in_new (good for further, detailed examples)