这是有效的,但我觉得这段代码很冗长.我正在寻找更好的主意.
var clone = function(imageData) {
var canvas, context;
canvas = document.createElement('canvas');
canvas.width = imageData.width;
canvas.height = imageData.height;
context = canvas.getContext('2d');
context.putImageData(imageData, 0, 0);
return context.getImageData(0, 0, imageData.width, imageData.height);
};
Run Code Online (Sandbox Code Playgroud) 中山大学
exports['foo-bar'] = {} // -> OK
Run Code Online (Sandbox Code Playgroud)
环境管理署
exports['foo-bar'] = {}; // -> NG
export['foo-bar'] = {}; // -> NG
export { 'foo-bar': {} }; // -> NG
export { fooBar as foo-bar }; // -> NG
export { fooBar as 'foo-bar' }; // -> NG
Run Code Online (Sandbox Code Playgroud)
通常我不会这样做,所以这不是问题,但我遇到了麻烦,因为Firebase Functions v2 只允许名称中包含小写字母、数字和连字符,并要求我将其导出。
javascript node.js firebase typescript google-cloud-functions