From: Chris Duncan Date: Wed, 5 Aug 2026 01:35:43 +0000 (-0700) Subject: Ignore properties in the prototype chain. X-Git-Url: https://git.codecow.com/?a=commitdiff_plain;h=87979d1312f73bf625779b9886cd990349793f5c;p=libnemo.git Ignore properties in the prototype chain. --- diff --git a/src/lib/rpc/index.ts b/src/lib/rpc/index.ts index 90f6e24..67e8e9b 100644 --- a/src/lib/rpc/index.ts +++ b/src/lib/rpc/index.ts @@ -95,10 +95,10 @@ export class Rpc { if (typeof action !== 'string') { throw new TypeError('RPC action must be a string') } - if (!/^[A-Za-z]+(_[A-Za-z]+)*$/.test(action)) { + if (!/^[a-z]+(_[a-z]+)*$/i.test(action)) { throw new TypeError('RPC action contains invalid characters') } - if (!(action in Schema)) { + if (!Object.hasOwn(action)) { throw new TypeError('Unknown RPC action') } }