@descope/escape-markdown 0.1.6 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
package/dist/cjs/index.cjs.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const e
|
|
1
|
+
"use strict";const e=/[\\*#/()[\]_<>`]/g,r=/\\([\\*#/()[\]_<>`])/g;exports.escapeMarkdown=r=>"string"!=typeof r?r:r.replace(e,"\\$&"),exports.unescapeMarkdown=e=>"string"!=typeof e?e:e.replace(r,"$1");
|
|
2
2
|
//# sourceMappingURL=index.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs.js","sources":["../../src/escapeMarkdown.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":["../../src/escapeMarkdown.ts"],"sourcesContent":["// Markdown characters escaped in values, the backslash included.\n// `.`, `@`, `-` and `&` are left as is, so emails and links keep working.\nconst escapeRegexp = /[\\\\*#/()[\\]_<>`]/g;\nconst unescapeRegexp = /\\\\([\\\\*#/()[\\]_<>`])/g;\n\nexport const escapeMarkdown = (s: string) => {\n if (typeof s !== 'string') return s;\n return s.replace(escapeRegexp, '\\\\$&');\n};\n\nexport const unescapeMarkdown = (s: string) => {\n if (typeof s !== 'string') return s;\n return s.replace(unescapeRegexp, '$1');\n};\n"],"names":["escapeRegexp","unescapeRegexp","s","replace"],"mappings":"aAEA,MAAMA,EAAe,oBACfC,EAAiB,+CAEQC,GACZ,iBAANA,EAAuBA,EAC3BA,EAAEC,QAAQH,EAAc,iCAGAE,GACd,iBAANA,EAAuBA,EAC3BA,EAAEC,QAAQF,EAAgB"}
|
package/dist/index.esm.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e
|
|
1
|
+
const e=/[\\*#/()[\]_<>`]/g,t=/\\([\\*#/()[\]_<>`])/g,p=t=>"string"!=typeof t?t:t.replace(e,"\\$&"),r=e=>"string"!=typeof e?e:e.replace(t,"$1");export{p as escapeMarkdown,r as unescapeMarkdown};
|
|
2
2
|
//# sourceMappingURL=index.esm.js.map
|
package/dist/index.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.js","sources":["../src/escapeMarkdown.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":["../src/escapeMarkdown.ts"],"sourcesContent":["// Markdown characters escaped in values, the backslash included.\n// `.`, `@`, `-` and `&` are left as is, so emails and links keep working.\nconst escapeRegexp = /[\\\\*#/()[\\]_<>`]/g;\nconst unescapeRegexp = /\\\\([\\\\*#/()[\\]_<>`])/g;\n\nexport const escapeMarkdown = (s: string) => {\n if (typeof s !== 'string') return s;\n return s.replace(escapeRegexp, '\\\\$&');\n};\n\nexport const unescapeMarkdown = (s: string) => {\n if (typeof s !== 'string') return s;\n return s.replace(unescapeRegexp, '$1');\n};\n"],"names":["escapeRegexp","unescapeRegexp","escapeMarkdown","s","replace","unescapeMarkdown"],"mappings":"AAEA,MAAMA,EAAe,oBACfC,EAAiB,wBAEVC,EAAkBC,GACZ,iBAANA,EAAuBA,EAC3BA,EAAEC,QAAQJ,EAAc,QAGpBK,EAAoBF,GACd,iBAANA,EAAuBA,EAC3BA,EAAEC,QAAQH,EAAgB"}
|