Don't need tsubaki if I can just make it myself

This commit is contained in:
Daniel Odendahl Jr
2017-10-23 20:39:56 +00:00
parent cf23f22318
commit 984f8f473c
3 changed files with 10 additions and 3 deletions
+8
View File
@@ -48,6 +48,14 @@ class Util {
return `${prefix.slice(text.length)}${text}`;
}
static promisifyAll(obj, suffix = 'Async') {
for (const key of Object.keys(obj)) {
if (typeof obj[key] !== 'function') continue;
obj[`${key}${suffix}`] = promisify(obj[key]);
}
return obj;
}
static greyscale(ctx, x, y, width, height) {
const data = ctx.getImageData(x, y, width, height);
for (let i = 0; i < data.data.length; i += 4) {