diff --git a/packages/node_modules/@node-red/util/lib/util.js b/packages/node_modules/@node-red/util/lib/util.js index 1141661de..51bdbc0d6 100644 --- a/packages/node_modules/@node-red/util/lib/util.js +++ b/packages/node_modules/@node-red/util/lib/util.js @@ -318,9 +318,23 @@ function getMessageProperty(msg,expr) { /** * Gets a property of an object. * + * Given the object: + * + * { + * "pet": { + * "type": "cat" + * } + * } + * + * - `pet.type` will return `"cat"`. + * - `pet.name` will return `undefined` + * - `car` will return `undefined` + * - `car.type` will throw an Error (as `car` does not exist) + * * @param {Object} msg - the object * @param {String} expr - the property expression * @return {any} the object property, or undefined if it does not exist + * @throws Will throw an error if the *parent* of the property does not exist * @memberof @node-red/util_util */ function getObjectProperty(msg,expr) {