From 6f9f48ebcc9268059dd405c74ed10817f0e8570d Mon Sep 17 00:00:00 2001 From: ptrcnull Date: Sun, 11 Dec 2022 20:33:11 +0100 Subject: [PATCH] node-print: upgrade to 8 --- node-print/APKBUILD | 4 ++-- node-print/index.js | 9 +++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/node-print/APKBUILD b/node-print/APKBUILD index 932f216..257c207 100644 --- a/node-print/APKBUILD +++ b/node-print/APKBUILD @@ -1,7 +1,7 @@ # Contributor: Patrycja Rosa # Maintainer: Patrycja Rosa pkgname=node-print -pkgver=7 +pkgver=8 pkgrel=0 pkgdesc="another terrible javascript engine wrapper" url="https://git.ddd.rip/ptrcnull/ptrcports" @@ -43,5 +43,5 @@ package() { sha512sums=" b3dfdeb49637be33d2e2718c5abcf35a87dd55023918c99341273c3b38bd6685189d1f786451a742c47c5f3bc3b58555decb58e2a3a018c9b9ee92043f8fac03 np -0a7d7ab80bda095c17613bd104c06284049b95236df33b8f3e9413f6d804c3f1562678e0c77bb7c0dfde4f16deead6f23f81e83ade6189cbc8e67c6163332d82 index.js +4e80247d16485e2ca4e0d4e92523a5a99727dba20e5c3e64737d74676853d1a92278d54bccf5d4a5d159dc282f95cd484b3e7bbc206b0675d7b50e37c428f125 index.js " diff --git a/node-print/index.js b/node-print/index.js index 2a971c1..86e3364 100644 --- a/node-print/index.js +++ b/node-print/index.js @@ -100,6 +100,10 @@ Set.prototype.intersection = function(other) { return new Set([...this].filter(el => other.has(el))) } +Set.prototype.at = function(index) { + return [...this].at(index) +} + global.matrix = function(x, y, elem) { return new Array(y).fill().map(() => new Array(x).fill().map((_, i) => { if (typeof elem === 'function') { @@ -109,3 +113,8 @@ global.matrix = function(x, y, elem) { } })) } + +Number.prototype.toXY = function(width) { + if (!(width && typeof width === 'number')) throw new TypeError('width must be a Number') + return [ this % width, Math.floor(this / width) ] +}