all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
blob 16ac6b45f63caf9974e595f5640d655d2233d4c1 1476 bytes (raw)
name: gnu/packages/patches/llhttp-ponyfill-object-fromentries.patch 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
 
diff --git a/src/llhttp/constants.ts b/src/llhttp/constants.ts
index 226342e..1a4c93a 100644
--- a/src/llhttp/constants.ts
+++ b/src/llhttp/constants.ts
@@ -1,4 +1,4 @@
-import { enumToMap } from './utils';
+import { enumToMap, fromEntries } from './utils';
 
 export type IntDict = Record<string, number>;
 
@@ -328,7 +328,7 @@ export const METHODS_RTSP = [
 
 export const METHOD_MAP = enumToMap(METHODS);
 
-export const H_METHOD_MAP = Object.fromEntries(
+export const H_METHOD_MAP = fromEntries(
   Object.entries(METHODS).filter(([ k ]) => k.startsWith('H'))
 );
 
diff --git a/src/llhttp/utils.ts b/src/llhttp/utils.ts
index 2251125..5ac4aeb 100644
--- a/src/llhttp/utils.ts
+++ b/src/llhttp/utils.ts
@@ -1,5 +1,13 @@
 import { IntDict } from './constants';
 
+/*! fromentries. MIT License. Copyright (c) 2018-2020 Feross Aboukhadijeh */
+export function fromEntries (iterable) {
+  return [...iterable].reduce((obj, [key, val]) => {
+    obj[key] = val
+    return obj
+  }, {})
+}
+
 export function enumToMap(
   obj: IntDict,
   filter: ReadonlyArray<number> = [],
@@ -8,7 +16,7 @@ export function enumToMap(
   const emptyFilter = (filter?.length ?? 0) === 0;
   const emptyExceptions = (exceptions?.length ?? 0) === 0;
 
-  return Object.fromEntries(Object.entries(obj).filter(([ , value ]) => {
+  return fromEntries(Object.entries(obj).filter(([ , value ]) => {
     return (
       typeof value === 'number' &&
       (emptyFilter || filter.includes(value)) &&

debug log:

solving 16ac6b45f6 ...
found 16ac6b45f6 in https://yhetil.org/guix/276a2bf80aa768835c189a361d7b29ec5de1656d.1736092552.git.jlicht@fsfe.org/

applying [1/1] https://yhetil.org/guix/276a2bf80aa768835c189a361d7b29ec5de1656d.1736092552.git.jlicht@fsfe.org/
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 0000000000..16ac6b45f6

1:14: trailing whitespace.
 
1:16: trailing whitespace.
 
1:18: trailing whitespace.
 
1:20: trailing whitespace.
 
1:25: trailing whitespace.
 
Checking patch gnu/packages/patches/llhttp-ponyfill-object-fromentries.patch...
Applied patch gnu/packages/patches/llhttp-ponyfill-object-fromentries.patch cleanly.
warning: squelched 2 whitespace errors
warning: 7 lines add whitespace errors.

index at:
100644 16ac6b45f63caf9974e595f5640d655d2233d4c1	gnu/packages/patches/llhttp-ponyfill-object-fromentries.patch

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.