Update app and tooling
This commit is contained in:
parent
3046531bdd
commit
e620ec7349
4950 changed files with 2975120 additions and 10 deletions
27
node_modules/code-block-writer/dist/utils/stringUtils.js
generated
vendored
Normal file
27
node_modules/code-block-writer/dist/utils/stringUtils.js
generated
vendored
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getStringFromStrOrFunc = exports.escapeChar = exports.escapeForWithinString = void 0;
|
||||
const newlineRegex = /(\r?\n)/g;
|
||||
/** @internal */
|
||||
function escapeForWithinString(str, quoteKind) {
|
||||
return escapeChar(str, quoteKind).replace(newlineRegex, "\\$1");
|
||||
}
|
||||
exports.escapeForWithinString = escapeForWithinString;
|
||||
/** @internal */
|
||||
function escapeChar(str, char) {
|
||||
if (char.length !== 1)
|
||||
throw new Error(`Specified char must be one character long.`);
|
||||
let result = "";
|
||||
for (let i = 0; i < str.length; i++) {
|
||||
if (str[i] === char)
|
||||
result += "\\";
|
||||
result += str[i];
|
||||
}
|
||||
return result;
|
||||
}
|
||||
exports.escapeChar = escapeChar;
|
||||
/** @internal */
|
||||
function getStringFromStrOrFunc(strOrFunc) {
|
||||
return strOrFunc instanceof Function ? strOrFunc() : strOrFunc;
|
||||
}
|
||||
exports.getStringFromStrOrFunc = getStringFromStrOrFunc;
|
||||
Loading…
Add table
Add a link
Reference in a new issue