oren_z0 on Nostr: And the most vile and offensive text written in this file is this piece of ...
And the most vile and offensive text written in this file is this piece of inefficient “reduce”:
export const reservedSubdomains: Record<string, boolean> = [
...atpSpecific,
...commonlyReserved,
...famousAccounts,
...slurs,
].reduce((acc, cur) => {
return {
...acc,
[cur]: true,
}
}, {})
Why not use “Object.fromEntries(…)”??
Published at
2023-07-14 17:48:56Event JSON
{
"id": "226851e1ee4218af678abf7b303889861a792a31aa035573d331bd90e32bd8ce",
"pubkey": "3316e2d88ff91e1089c75feedcd8baa2258b45455a3b156af617d7ec79b45fe5",
"created_at": 1689349736,
"kind": 1,
"tags": [
[
"e",
"1877c591b0acf8323d7423920f42f494f39f71c0c76bc1fcc4c330cee94f3efa"
],
[
"p",
"3bf0c63fcb93463407af97a5e5ee64fa883d107ef9e558472c4eb9aaaefa459d"
]
],
"content": "And the most vile and offensive text written in this file is this piece of inefficient “reduce”:\n\nexport const reservedSubdomains: Record\u003cstring, boolean\u003e = [\n ...atpSpecific,\n ...commonlyReserved,\n ...famousAccounts,\n ...slurs,\n].reduce((acc, cur) =\u003e {\n return {\n ...acc,\n [cur]: true,\n }\n}, {})\n\nWhy not use “Object.fromEntries(…)”??",
"sig": "d1e2a0e5f125f7eaa144a8f21b083958054baad751cadaca958ca1502d790097289ad8e382b2f00a8608306c2fd3e2becdf7a21605f37122f703aaa71f3c886d"
}