UNPKG

lambda-live-debugger

Version:

Debug Lambda functions locally like it is running in the cloud

16 lines (12 loc) 504 B
export function safeComment(val) { return String(val) .replace(/--/g, '- -') // -- is illegal anywhere in comment content .replace(/--/g, '- -') // handle the scenario when 2 consiucative dashes appears .replace(/-$/, '- '); // trailing - would form -- with the closing --> } export function safeCdata(val) { return String(val).replace(/\]\]>/g, ']]]]><![CDATA[>') } export function escapeAttribute(val) { return String(val).replace(/"/g, '&quot;').replace(/'/g, '&apos;') }