mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-21 15:01:03 +00:00
15 lines
502 B
TypeScript
15 lines
502 B
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { isBlockedObjectKey } from "./prototype-keys.js";
|
|
|
|
describe("isBlockedObjectKey", () => {
|
|
it("blocks prototype-pollution keys and allows ordinary keys", () => {
|
|
for (const key of ["__proto__", "prototype", "constructor"]) {
|
|
expect(isBlockedObjectKey(key)).toBe(true);
|
|
}
|
|
|
|
for (const key of ["toString", "value", "constructorName", "__proto__x", "Prototype"]) {
|
|
expect(isBlockedObjectKey(key)).toBe(false);
|
|
}
|
|
});
|
|
});
|