diff --git a/src/index.ts b/src/index.ts index 7d874bc..17c4d2e 100644 --- a/src/index.ts +++ b/src/index.ts @@ -178,10 +178,10 @@ const findEscapeSequence = /["\b\t\n\v\f\r\/]/ const SANITIZE = { auto: (property: string) => `${findEscapeSequence}.test(${property})?JSON.stringify(${property}).slice(1,-1):${property}`, - manual: (property: string) => `${property}`, + manual: (property: string) => property, // Remove unnecessary template literal throw: (property: string) => `${findEscapeSequence}.test(${property})?(()=>{throw new Error("Property '${property}' contains invalid characters")})():${property}` -} satisfies Record string> + } satisfies Record string> const joinStringArray = (p: string) => `"$\{` +