From 41e76e96fc0271d6fcdc18e8464a2a316605d6d3 Mon Sep 17 00:00:00 2001 From: JamieSlome Date: Mon, 28 Dec 2020 15:31:00 +0000 Subject: [PATCH] docs(content): updating nuxt content to reflect new function and version --- docs/content/util.json | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/docs/content/util.json b/docs/content/util.json index c588dc8..8b30633 100644 --- a/docs/content/util.json +++ b/docs/content/util.json @@ -1,4 +1,32 @@ [ + { + "name": [ + "addObjectProperty" + ], + "fileContents": "/**\n *\n * @name addObjectProperty\n *\n * @summary How do you add a key-value pair or new property to an object?\n *\n * @since 1.3.0\n *\n * @category Object\n *\n * @param {Object} x - Object to add new property to\n * @param {string} y - Property name\n * @param {any} z - Property value\n *\n * @return {Object} Provided object with new property added\n *\n * @example\n * => polyfig.addObjectProperty({}, \"poly\", [\"fig\"]);\n * => {\"poly\": [\"fig\"]}\n */\n\nfunction addObjectProperty(x, y, z) {\n return typeof x === \"object\" && x !== null && typeof y === \"string\"\n ? (x[y] = z)\n : new Error(\"x is not of type object or y is not of type string\");\n}\n\nmodule.exports = addObjectProperty;\n", + "code": "function addObjectProperty(x, y, z) {\n return typeof x === \"object\" && x !== null && typeof y === \"string\"\n ? (x[y] = z)\n : new Error(\"x is not of type object or y is not of type string\");\n}\n\nmodule.exports = addObjectProperty;\n", + "summary": [ + "How do you add a key-value pair or new property to an object?" + ], + "since": [ + "1.3.0" + ], + "category": [ + "Object" + ], + "params": [ + "{Object} x - Object to add new property to", + "{string} y - Property name", + "{any} z - Property value" + ], + "ret": [ + "{Object} Provided object with new property added" + ], + "example": [ + "polyfig.addObjectProperty({}, \"poly\", [\"fig\"]);", + "{\"poly\": [\"fig\"]}" + ] + }, { "name": [ "capitalise"