summaryrefslogtreecommitdiff
path: root/gnu/packages
diff options
context:
space:
mode:
authorJelle Licht <jlicht@fsfe.org>2025-01-05 18:57:21 +0100
committerJelle Licht <jlicht@fsfe.org>2025-02-11 14:02:51 +0100
commit1bb7866667ebc7a0ffd733c598a2723a47ccfb9e (patch)
treee6e40f9d723639e0e436682c0b39095c14f8479c /gnu/packages
parent0a5d8258766690fab7ddd2800ddb34fc8b6549d0 (diff)
gnu: llhttp-bootstrap: Update to 9.2.1.
* gnu/packages/patches/llhttp-ponyfill-object-fromentries.patch: New patch. * gnu/local.mk (dist_patch_DATA): Register patch. * gnu/packages/node.scm (llhttp-bootstrap): Update to 9.2.1. [source]: Use patch.
Diffstat (limited to 'gnu/packages')
-rw-r--r--gnu/packages/node.scm5
-rw-r--r--gnu/packages/patches/llhttp-ponyfill-object-fromentries.patch46
2 files changed, 49 insertions, 2 deletions
diff --git a/gnu/packages/node.scm b/gnu/packages/node.scm
index 20acffb3df9..6c0031aa5a8 100644
--- a/gnu/packages/node.scm
+++ b/gnu/packages/node.scm
@@ -679,7 +679,7 @@ parser definition into a C output.")
679(define-public llhttp-bootstrap 679(define-public llhttp-bootstrap
680 (package 680 (package
681 (name "llhttp") 681 (name "llhttp")
682 (version "8.1.2") 682 (version "9.2.1")
683 (source (origin 683 (source (origin
684 (method git-fetch) 684 (method git-fetch)
685 (uri (git-reference 685 (uri (git-reference
@@ -688,7 +688,8 @@ parser definition into a C output.")
688 (file-name (git-file-name name version)) 688 (file-name (git-file-name name version))
689 (sha256 689 (sha256
690 (base32 690 (base32
691 "1808y8mpdcmsi8rxndilngg4nn2fbqfgb29f47kk9mmdpqg5s17r")) 691 "0mzg19aqb1am498gms0z75cwd5kmfg9p78b1hhxw67019nsjcbac"))
692 (patches (search-patches "llhttp-ponyfill-object-fromentries.patch"))
692 (modules '((guix build utils))) 693 (modules '((guix build utils)))
693 (snippet 694 (snippet
694 '(begin 695 '(begin
diff --git a/gnu/packages/patches/llhttp-ponyfill-object-fromentries.patch b/gnu/packages/patches/llhttp-ponyfill-object-fromentries.patch
new file mode 100644
index 00000000000..16ac6b45f63
--- /dev/null
+++ b/gnu/packages/patches/llhttp-ponyfill-object-fromentries.patch
@@ -0,0 +1,46 @@
1diff --git a/src/llhttp/constants.ts b/src/llhttp/constants.ts
2index 226342e..1a4c93a 100644
3--- a/src/llhttp/constants.ts
4+++ b/src/llhttp/constants.ts
5@@ -1,4 +1,4 @@
6-import { enumToMap } from './utils';
7+import { enumToMap, fromEntries } from './utils';
8
9 export type IntDict = Record<string, number>;
10
11@@ -328,7 +328,7 @@ export const METHODS_RTSP = [
12
13 export const METHOD_MAP = enumToMap(METHODS);
14
15-export const H_METHOD_MAP = Object.fromEntries(
16+export const H_METHOD_MAP = fromEntries(
17 Object.entries(METHODS).filter(([ k ]) => k.startsWith('H'))
18 );
19
20diff --git a/src/llhttp/utils.ts b/src/llhttp/utils.ts
21index 2251125..5ac4aeb 100644
22--- a/src/llhttp/utils.ts
23+++ b/src/llhttp/utils.ts
24@@ -1,5 +1,13 @@
25 import { IntDict } from './constants';
26
27+/*! fromentries. MIT License. Copyright (c) 2018-2020 Feross Aboukhadijeh */
28+export function fromEntries (iterable) {
29+ return [...iterable].reduce((obj, [key, val]) => {
30+ obj[key] = val
31+ return obj
32+ }, {})
33+}
34+
35 export function enumToMap(
36 obj: IntDict,
37 filter: ReadonlyArray<number> = [],
38@@ -8,7 +16,7 @@ export function enumToMap(
39 const emptyFilter = (filter?.length ?? 0) === 0;
40 const emptyExceptions = (exceptions?.length ?? 0) === 0;
41
42- return Object.fromEntries(Object.entries(obj).filter(([ , value ]) => {
43+ return fromEntries(Object.entries(obj).filter(([ , value ]) => {
44 return (
45 typeof value === 'number' &&
46 (emptyFilter || filter.includes(value)) && \ No newline at end of file