This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_.mixin({ | |
renameProperties: function (object, oldValue, newValue) { | |
_.each(object, function(item) { | |
item.renameProperty(oldValue, newValue); | |
}); | |
return object; | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_.mixin({ | |
renameProperties: function (object, translations) { | |
_.each(_.pairs(translations), function(translation) { | |
_.each(object, function(item){ | |
if (item.hasOwnProperty(translation[0])) { | |
item[translation[1]] = item[translation[0]]; | |
delete item[translation[0]]; | |
} | |
}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { fabric } = require('fabric'); | |
fabric.Object.prototype.objectCaching = false; | |
const runnerLoopCount = 10; | |
const canvasLoopCount = 1000; | |
const newFabricCanvas = () => { | |
for (let i = 0; i < canvasLoopCount; i++) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const jsdom = require("jsdom"); | |
const { JSDOM } = jsdom; | |
const dom = new JSDOM(`<body></body>`); | |
const document = dom.window.document; | |
const runnerLoopCount = 10; | |
const canvasLoopCount = 1000; | |