]> git.codecow.com Git - libnemo.git/commitdiff
Ignore properties in the prototype chain.
authorChris Duncan <chris@codecow.com>
Wed, 5 Aug 2026 01:35:43 +0000 (18:35 -0700)
committerChris Duncan <chris@codecow.com>
Wed, 5 Aug 2026 01:35:43 +0000 (18:35 -0700)
src/lib/rpc/index.ts

index 90f6e2402b45e30ee8379963f11a848d9ef9e581..67e8e9b55b72e6a32602a16c06aa660bcb942ba2 100644 (file)
@@ -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')
                }
        }