mirror of
https://github.com/CopilotKit/CopilotKit.git
synced 2026-09-14 16:26:20 +08:00
test(integrations): tighten retired env boundaries
This commit is contained in:
committed by
Max Korp
parent
a26767c538
commit
b48bbd20ea
@@ -60,6 +60,18 @@ describe("retiredNameReference", () => {
|
||||
false,
|
||||
);
|
||||
});
|
||||
|
||||
it("allows a lowercase-prefixed identifier containing the retired name", () => {
|
||||
expect(retiredNameReference(RETIRED, "my" + RETIRED + "=cpk-...")).toBe(
|
||||
false,
|
||||
);
|
||||
});
|
||||
|
||||
it("allows a lowercase-suffixed identifier containing the retired name", () => {
|
||||
expect(retiredNameReference(RETIRED, RETIRED + "Legacy=cpk-...")).toBe(
|
||||
false,
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
/**
|
||||
|
||||
@@ -225,7 +225,9 @@ export function managedUrlEnvFileAssignment(text: string): string | null {
|
||||
* @returns `true` when the line carries that exact name.
|
||||
*/
|
||||
export function retiredNameReference(name: string, text: string): boolean {
|
||||
return new RegExp(String.raw`(?<![A-Z0-9_])${name}(?![A-Z0-9_])`).test(text);
|
||||
return new RegExp(String.raw`(?<![A-Za-z0-9_])${name}(?![A-Za-z0-9_])`).test(
|
||||
text,
|
||||
);
|
||||
}
|
||||
|
||||
interface Violation {
|
||||
|
||||
Reference in New Issue
Block a user