From ec4d208c8a4057fc2fb401bea386d970042ea3f6 Mon Sep 17 00:00:00 2001 From: ptrcnull Date: Tue, 8 Nov 2022 10:12:26 +0100 Subject: [PATCH] node-print: upgrade to 5 fixes a **critical** bug also a random shitpost --- node-print/APKBUILD | 4 ++-- node-print/index.js | 12 ++++++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/node-print/APKBUILD b/node-print/APKBUILD index 86f5a1a..37b5311 100644 --- a/node-print/APKBUILD +++ b/node-print/APKBUILD @@ -1,7 +1,7 @@ # Contributor: Patrycja Rosa # Maintainer: Patrycja Rosa pkgname=node-print -pkgver=4 +pkgver=5 pkgrel=0 pkgdesc="another terrible javascript engine wrapper" url="https://git.ddd.rip/ptrcnull/ptrcports" @@ -43,5 +43,5 @@ package() { sha512sums=" b3dfdeb49637be33d2e2718c5abcf35a87dd55023918c99341273c3b38bd6685189d1f786451a742c47c5f3bc3b58555decb58e2a3a018c9b9ee92043f8fac03 np -0262bc1b6b15180ef715e0be3cb2e3d8a83ed532c6282a5b4466c16251f0f29b2d870dbac5795a4fb6a0b1e917b362ebd18d5fa6d6402209ca4e35409eec59e6 index.js +afcc775f7d76b05bf72eef59a47b02d9a2021b09015b37502eaa457d9b38f3259a99c2ebf8ed8b5a1e36b27dd13ab447f2e673467d5717b60452d8c585aba995 index.js " diff --git a/node-print/index.js b/node-print/index.js index 2c7f790..de82535 100644 --- a/node-print/index.js +++ b/node-print/index.js @@ -45,7 +45,15 @@ Buffer.prototype.tryParseJSON = function() { global.exec = (command, args, options) => { const child_process = require('child_process') const res = child_process.spawnSync(command, args, options) - res.stdout = res.stdout.tryParseJSON() - res.stderr = res.stderr.tryParseJSON() + res.stdout = res.stdout?.tryParseJSON() + res.stderr = res.stderr?.tryParseJSON() return res } + +/* wow it's almost like it's my own package and i can include whatever garbage i want :) */ +/* not writing a test for that tho */ +global.apkindex = () => stdin() + .split("\n\n") + .filter(str => str.length) + .map(x => Object.fromEntries(x.split("\n").map(e => [e.at(0), e.slice(2)]))) + .filter(Boolean)