UNPKG

@adeu/mcp-server

Version:

[![GitHub Repo stars](https://img.shields.io/github/stars/dealfluence/adeu?style=social)](https://github.com/dealfluence/adeu) [![MCP Compatible](https://img.shields.io/badge/MCP-Compatible-green.svg)](https://modelcontextprotocol.io/) [![License: MIT](ht

34 lines (27 loc) • 843 B
import { describe, it, expect } from "vitest"; import { coerceChangeItemInPlace } from "./index.js"; describe("coerceChangeItemInPlace: match_mode values that collide with Object.prototype keys", () => { it.each(["constructor", "__proto__", "toString"])( 'drops match_mode "%s" instead of resolving it through the prototype', (bad) => { const item: any = { type: "modify", target_text: "a", new_text: "b", match_mode: bad, }; coerceChangeItemInPlace(item); expect("match_mode" in item).toBe(false); }, ); it("still maps a real synonym", () => { const item: any = { type: "modify", target_text: "a", new_text: "b", match_mode: "First_Only", }; coerceChangeItemInPlace(item); expect(item.match_mode).toBe("first"); }); });