|
Last change
on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 11 days ago |
|
Fix frontend appearance
|
-
Property mode
set to
100644
|
|
File size:
521 bytes
|
| Line | |
|---|
| 1 | /** Used to escape characters for inclusion in compiled string literals. */
|
|---|
| 2 | var stringEscapes = {
|
|---|
| 3 | '\\': '\\',
|
|---|
| 4 | "'": "'",
|
|---|
| 5 | '\n': 'n',
|
|---|
| 6 | '\r': 'r',
|
|---|
| 7 | '\u2028': 'u2028',
|
|---|
| 8 | '\u2029': 'u2029'
|
|---|
| 9 | };
|
|---|
| 10 |
|
|---|
| 11 | /**
|
|---|
| 12 | * Used by `_.template` to escape characters for inclusion in compiled string literals.
|
|---|
| 13 | *
|
|---|
| 14 | * @private
|
|---|
| 15 | * @param {string} chr The matched character to escape.
|
|---|
| 16 | * @returns {string} Returns the escaped character.
|
|---|
| 17 | */
|
|---|
| 18 | function escapeStringChar(chr) {
|
|---|
| 19 | return '\\' + stringEscapes[chr];
|
|---|
| 20 | }
|
|---|
| 21 |
|
|---|
| 22 | module.exports = escapeStringChar;
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.