node-print: upgrade to 5

fixes a **critical** bug

also a random shitpost
This commit is contained in:
ptrcnull 2022-11-08 10:12:26 +01:00
parent ebf621a9f4
commit ec4d208c8a
2 changed files with 12 additions and 4 deletions

View file

@ -1,7 +1,7 @@
# Contributor: Patrycja Rosa <alpine@ptrcnull.me>
# Maintainer: Patrycja Rosa <alpine@ptrcnull.me>
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
"

View file

@ -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)