UNPKG

1.01 kBSource Map (JSON)View Raw
1{"version":3,"sources":["../../server/htmlescape.ts"],"names":["ESCAPE_LOOKUP","ESCAPE_REGEX","htmlEscapeJsonString","str","replace","match"],"mappings":"uFAAA;AACA;AAEA,KAAMA,CAAAA,aAA0C,CAAG,CACjD,IAAK,SAD4C,CAEjD,IAAK,SAF4C,CAGjD,IAAK,SAH4C,CAIjD,SAAU,SAJuC,CAKjD,SAAU,SALuC,CAAnD,CAQA,KAAMC,CAAAA,YAAY,CAAG,oBAArB,CAEO,QAASC,CAAAA,oBAAT,CAA8BC,GAA9B,CAAmD,CACxD,MAAOA,CAAAA,GAAG,CAACC,OAAJ,CAAYH,YAAZ,CAA2BI,KAAD,EAAWL,aAAa,CAACK,KAAD,CAAlD,CAAP,CACD","sourcesContent":["// This utility is based on https://github.com/zertosh/htmlescape\n// License: https://github.com/zertosh/htmlescape/blob/0527ca7156a524d256101bb310a9f970f63078ad/LICENSE\n\nconst ESCAPE_LOOKUP: { [match: string]: string } = {\n '&': '\\\\u0026',\n '>': '\\\\u003e',\n '<': '\\\\u003c',\n '\\u2028': '\\\\u2028',\n '\\u2029': '\\\\u2029',\n}\n\nconst ESCAPE_REGEX = /[&><\\u2028\\u2029]/g\n\nexport function htmlEscapeJsonString(str: string): string {\n return str.replace(ESCAPE_REGEX, (match) => ESCAPE_LOOKUP[match])\n}\n"]}
\No newline at end of file