Travis build: 342 [cron]

This commit is contained in:
30secondsofcode
2018-09-01 20:05:19 +00:00
parent fc2a6dc816
commit 8e60551a23
4 changed files with 1664 additions and 1660 deletions

View File

@ -995,6 +995,26 @@
"hash": "31714831376eeddd863a295af778632f584468745fbeb4e9a6f62b5275ea3562"
}
},
{
"id": "deepFreeze",
"type": "snippet",
"attributes": {
"fileName": "deepFreeze.md",
"text": "Deep freezes an object.\n\nCalls `Object.freeze(obj)` recursively on all unfrozen properties of passed object that are `instanceof` object.",
"codeBlocks": [
"const deepFreeze = obj =>\n Object.keys(obj).forEach(\n prop =>\n !obj[prop] instanceof Object || Object.isFrozen(obj[prop]) ? null : deepFreeze(obj[prop])\n ) || Object.freeze(obj);",
"'use strict';\n\nconst o = deepFreeze([1, [2, 3]]);\n\no[0] = 3; // not allowed\no[1][0] = 4; // not allowed as well"
],
"tags": [
"object",
"recursion"
]
},
"meta": {
"archived": false,
"hash": "24b3dd66c4b69577d70917ba4f0c119a7ad21497d18704b7150c3693673b5e53"
}
},
{
"id": "defaults",
"type": "snippet",