refactor to const
This commit is contained in:
parent
4a94ce3038
commit
235f380139
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,4 +1,4 @@
|
||||
coverage/
|
||||
.yarn/
|
||||
pages/
|
||||
public/
|
||||
node_modules/
|
||||
|
4
dist/smartstring.create.d.ts
vendored
4
dist/smartstring.create.d.ts
vendored
@ -1,2 +1,2 @@
|
||||
export declare let createRandomString: (patternArg: string, lengthArg: number, optionsArg: any) => string;
|
||||
export declare let createCryptoRandomString: (lengthArg: any) => string;
|
||||
export declare const createRandomString: (patternArg: string, lengthArg: number, optionsArg: any) => string;
|
||||
export declare const createCryptoRandomString: (lengthArg: any) => string;
|
||||
|
2
dist/smartstring.create.js
vendored
2
dist/smartstring.create.js
vendored
@ -7,4 +7,4 @@ exports.createRandomString = (patternArg, lengthArg, optionsArg) => {
|
||||
exports.createCryptoRandomString = (lengthArg) => {
|
||||
return plugins.cryptoRandomString(lengthArg);
|
||||
};
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRzdHJpbmcuY3JlYXRlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvc21hcnRzdHJpbmcuY3JlYXRlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQUEsaURBQWdEO0FBRXJDLFFBQUEsa0JBQWtCLEdBQUcsQ0FDOUIsVUFBa0IsRUFDbEIsU0FBaUIsRUFDakIsVUFBZSxFQUNQLEVBQUU7SUFDVixNQUFNLENBQUMsT0FBTyxDQUFDLFVBQVUsQ0FBQyxVQUFVLEVBQUUsU0FBUyxFQUFFLFVBQVUsQ0FBQyxDQUFBO0FBQzlELENBQUMsQ0FBQTtBQUVVLFFBQUEsd0JBQXdCLEdBQUcsQ0FBQyxTQUFTLEVBQVUsRUFBRTtJQUMxRCxNQUFNLENBQUMsT0FBTyxDQUFDLGtCQUFrQixDQUFDLFNBQVMsQ0FBQyxDQUFBO0FBQzlDLENBQUMsQ0FBQSJ9
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRzdHJpbmcuY3JlYXRlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvc21hcnRzdHJpbmcuY3JlYXRlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQUEsaURBQWdEO0FBRW5DLFFBQUEsa0JBQWtCLEdBQUcsQ0FDaEMsVUFBa0IsRUFDbEIsU0FBaUIsRUFDakIsVUFBZSxFQUNQLEVBQUU7SUFDVixNQUFNLENBQUMsT0FBTyxDQUFDLFVBQVUsQ0FBQyxVQUFVLEVBQUUsU0FBUyxFQUFFLFVBQVUsQ0FBQyxDQUFBO0FBQzlELENBQUMsQ0FBQTtBQUVZLFFBQUEsd0JBQXdCLEdBQUcsQ0FBQyxTQUFTLEVBQVUsRUFBRTtJQUM1RCxNQUFNLENBQUMsT0FBTyxDQUFDLGtCQUFrQixDQUFDLFNBQVMsQ0FBQyxDQUFBO0FBQzlDLENBQUMsQ0FBQSJ9
|
2
dist/smartstring.docker.d.ts
vendored
2
dist/smartstring.docker.d.ts
vendored
@ -3,4 +3,4 @@
|
||||
* @param envArrayArg
|
||||
* @returns {}
|
||||
*/
|
||||
export declare let makeEnvObject: (envArrayArg: string[]) => {};
|
||||
export declare const makeEnvObject: (envArrayArg: string[]) => {};
|
||||
|
2
dist/smartstring.docker.js
vendored
2
dist/smartstring.docker.js
vendored
@ -16,4 +16,4 @@ exports.makeEnvObject = function (envArrayArg) {
|
||||
}
|
||||
return returnObject;
|
||||
};
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRzdHJpbmcuZG9ja2VyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvc21hcnRzdHJpbmcuZG9ja2VyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGlu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FdBQVcsQ0FBQyxDQUFDLENBQUM7WUFDL0IsSUFBSSxZQUFZLEdBQUcsV0FBVyxDQUFDLElBQUksQ0FBQyxXQUFXLENBQUUsTUFBTSxDQUFFLENBQUMsQ0FBQTtZQUMxRCxZQUFZLENBQUUsWUFBWSxDQUFFLENBQUMsQ0FBRSxDQUFFLEdBQUcsWUFBWSxDQUFFLENBQUMsQ0FBRSxDQUFBO1FBQ3ZELENBQUM7SUFDSCxDQUFDO0lBQ0QsTUFBTSxDQUFDLFlBQVksQ0FBQTtBQUNyQixDQUFDLENBQUEifQ==
|
8
dist/smartstring.git.js
vendored
8
dist/smartstring.git.js
vendored
@ -18,12 +18,12 @@ exports.GitRepo = GitRepo;
|
||||
/* ---------------------------------------------- *
|
||||
* ------------------ helpers ------------------- *
|
||||
* ---------------------------------------------- */
|
||||
let gitRegex = function (stringArg) {
|
||||
let regexString = /([a-zA-Z0-9\-\.]*)(?:\/|\:)([a-zA-Z0-9\-\.]*)(?:\/)([a-zA-Z0-9\-\.]*)(?:\.git)/;
|
||||
const gitRegex = function (stringArg) {
|
||||
const regexString = /([a-zA-Z0-9\-\.]*)(?:\/|\:)([a-zA-Z0-9\-\.]*)(?:\/)([a-zA-Z0-9\-\.]*)(?:\.git)/;
|
||||
let regexMatches = regexString.exec(stringArg);
|
||||
return regexMatches;
|
||||
};
|
||||
let gitLink = function (hostArg, userArg, repoArg, tokenArg = '', linkTypeArg) {
|
||||
const gitLink = function (hostArg, userArg, repoArg, tokenArg = '', linkTypeArg) {
|
||||
let returnString;
|
||||
if (tokenArg !== '') {
|
||||
tokenArg = tokenArg + '@';
|
||||
@ -43,4 +43,4 @@ let gitLink = function (hostArg, userArg, repoArg, tokenArg = '', linkTypeArg) {
|
||||
}
|
||||
return returnString;
|
||||
};
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRzdHJpbmcuZ2l0LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZ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sRUFBRSxPQUFlLEVBQUUsV0FBbUIsRUFBRSxFQUFFLFdBQVc7SUFDN0csSUFBSSxZQUFZLENBQUE7SUFDaEIsRUFBRSxDQUFDLENBQUMsUUFBUSxLQUFLLEVBQUUsQ0FBQyxDQUFDLENBQUM7UUFDcEIsUUFBUSxHQUFHLFFBQVEsR0FBRyxHQUFHLENBQUE7SUFDM0IsQ0FBQztJQUNELE1BQU0sQ0FBQyxDQUFDLFdBQVcsQ0FBQyxDQUFDLENBQUM7UUFDcEIsS0FBSyxPQUFPO1lBQ1YsWUFBWSxHQUFHLFVBQVU7Z0JBQ3ZCLFFBQVEsR0FBRyxPQUFPLEdBQUcsR0FBRyxHQUFHLE9BQU8sR0FBRyxHQUFHLEdBQUcsT0FBTyxHQUFHLE1BQU0sQ0FBQTtZQUM3RCxLQUFLLENBQUE7UUFDUCxLQUFLLEtBQUs7WUFDUixZQUFZLEdBQUcsTUFBTTtnQkFDbkIsT0FBTyxHQUFHLEdBQUcsR0FBRyxPQUFPLEdBQUcsR0FBRyxHQUFHLE9BQU8sR0FBRyxNQUFNLENBQUE7WUFDbEQsS0FBSyxDQUFBO1FBQ1A7WUFDRSxPQUFPLENBQUMsS0FBSyxDQUFDLFlBQVksR0FBRyxXQUFXLEdBQUcsWUFBWSxDQUFDLENBQUE7WUFDeEQsS0FBSyxDQUFBO0lBQ1QsQ0FBQztJQUNELE1BQU0sQ0FBQyxZQUFZLENBQUE7QUFDckIsQ0FBQyxDQUFBIn0=
|
6
dist/smartstring.indent.d.ts
vendored
6
dist/smartstring.indent.d.ts
vendored
@ -3,11 +3,11 @@
|
||||
* @param stringArg
|
||||
* @param spaceAmount
|
||||
*/
|
||||
export declare let indent: (stringArg: string, spaceAmount: number) => string;
|
||||
export declare const indent: (stringArg: string, spaceAmount: number) => string;
|
||||
/**
|
||||
* indents a string with prefix
|
||||
* @param stringArg
|
||||
* @param prefixArg
|
||||
*/
|
||||
export declare let indentWithPrefix: (stringArg: string, prefixArg: string) => string;
|
||||
export declare let normalize: (stringArg: string) => string;
|
||||
export declare const indentWithPrefix: (stringArg: string, prefixArg: string) => string;
|
||||
export declare const normalize: (stringArg: string) => string;
|
||||
|
12
dist/smartstring.indent.js
vendored
12
dist/smartstring.indent.js
vendored
@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||
* splits a string into an array
|
||||
* @param stringArg
|
||||
*/
|
||||
let splitStringAtLineBreak = (stringArg) => {
|
||||
const splitStringAtLineBreak = (stringArg) => {
|
||||
let resultArray = stringArg.split('\n');
|
||||
return cleanStringArray(resultArray);
|
||||
};
|
||||
@ -12,7 +12,7 @@ let splitStringAtLineBreak = (stringArg) => {
|
||||
* joins a string together again
|
||||
* @param stringArrayArg
|
||||
*/
|
||||
let joinStringWithLineBreaks = (stringArrayArg) => {
|
||||
const joinStringWithLineBreaks = (stringArrayArg) => {
|
||||
let resultString = '';
|
||||
for (let line of stringArrayArg) {
|
||||
resultString = resultString + line + '\n'; // add new line at end
|
||||
@ -23,7 +23,7 @@ let joinStringWithLineBreaks = (stringArrayArg) => {
|
||||
* cleans first and last line in case they are empty
|
||||
* @param stringArrayArg
|
||||
*/
|
||||
let cleanStringArray = (stringArrayArg) => {
|
||||
const cleanStringArray = (stringArrayArg) => {
|
||||
let testRegex = /^[\s]*$/;
|
||||
if (testRegex.test(stringArrayArg[0])) {
|
||||
stringArrayArg.shift();
|
||||
@ -65,8 +65,8 @@ exports.normalize = (stringArg) => {
|
||||
let resultString;
|
||||
let splitStringArray = splitStringAtLineBreak(stringArg);
|
||||
let minCommonLeftOffset;
|
||||
let deIndentRegex = /^(\s*)/;
|
||||
let emptyLineRegex = /^(\s*)$/;
|
||||
const deIndentRegex = /^(\s*)/;
|
||||
const emptyLineRegex = /^(\s*)$/;
|
||||
for (let stringItem of splitStringArray) {
|
||||
let offsetString = deIndentRegex.exec(stringItem)[1];
|
||||
if ((typeof minCommonLeftOffset === 'undefined' || offsetString.length < minCommonLeftOffset)
|
||||
@ -82,4 +82,4 @@ exports.normalize = (stringArg) => {
|
||||
resultString = joinStringWithLineBreaks(resultSplitStringArray);
|
||||
return resultString;
|
||||
};
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRzdHJpbmcuaW5kZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvc21hcnRzdHJpbmcuaW5kZW50LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBRUE7OztHQUdHO0FBQ0gsSUFBSSxzQkFBc0IsR0FBRyxDQUFDLFNBQWlCLEVBQVksRUFBRTtJQUMzRCxJQUFJLFdBQVcsR0FBRyxTQUFTLENBQUMsS0FBSyxDQUFDLElBQUksQ0FBQyxDQUFBO0lBQ3ZDLE1BQU0sQ0FBQyxnQkFBZ0IsQ0FBQyxXQUFXLENBQUMsQ0FBQTtBQUN0QyxDQUFDLENBQUE7QUFFRDs7O0dBR0c7QUFDSCxJQUFJLHdCQUF3QixHQUFHLENBQUMsY0FBd0IsRUFBVSxFQUFFO0lBQ2xFLElBQUksWUFBWSxHQUFXLEVBQUUsQ0FBQTtJQUM3QixHQUFHLENBQUMsQ0FBQyxJQUFJLElBQUksSUFBSSxjQUFjLENBQUMsQ0FBQyxDQUFDO1FBQ2hDLFlBQVksR0FBRyxZQUFZLEdBQUcsSUFBSSxHQUFHLElBQUksQ0FBQSxDQUFDLHNCQUFzQjtJQUNsRSxDQUFDO0lBQ0QsTUFBTSxDQUFDLFlBQVksQ0FBQTtBQUNyQixDQUFDLENBQUE7QUFFRDs7O0dBR0c7QUFDSCxJQUFJLGdCQUFnQixHQUFHLENBQUMsY0FBd0IsRUFBWSxFQUFFO0lBQzVELElBQUksU0FBUyxHQUFHLFNBQVMsQ0FBQTtJQUN6QixFQUFFLENBQUMsQ0FBQyxTQUFTLENBQUMsSUFBSSxDQUFDLGNBQWMsQ0FBRSxDQUFDLENBQUUsQ0FBQyxDQUF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EdBQUcsWUFBWSxDQUFDLE1BQU0sQ0FBQTtRQUMzQyxDQUFDO0lBQ0gsQ0FBQztJQUFBLENBQUM7SUFDRixJQUFJLHNCQUFzQixHQUFHLEVBQUUsQ0FBQTtJQUMvQixHQUFHLENBQUMsQ0FBQyxJQUFJLFVBQVUsSUFBSSxnQkFBZ0IsQ0FBQyxDQUFDLENBQUM7UUFDeEMsc0JBQXNCLENBQUMsSUFBSSxDQUFDLFVBQVUsQ0FBQyxNQUFNLENBQUMsbUJBQW1CLENBQUMsQ0FBQyxDQUFBO0lBQ3JFLENBQUM7SUFDRCxZQUFZLEdBQUcsd0JBQXdCLENBQUMsc0JBQXNCLENBQUMsQ0FBQTtJQUMvRCxNQUFNLENBQUMsWUFBWSxDQUFBO0FBQ3JCLENBQUMsQ0FBQSJ9
|
4
dist/smartstring.normalize.d.ts
vendored
4
dist/smartstring.normalize.d.ts
vendored
@ -4,9 +4,9 @@
|
||||
* @param searchRegExp
|
||||
* @param replacementString
|
||||
*/
|
||||
export declare let replaceAll: (stringArg: string, searchRegExp: any, replacementString: string) => string;
|
||||
export declare const replaceAll: (stringArg: string, searchRegExp: any, replacementString: string) => string;
|
||||
/**
|
||||
* normalizes a string
|
||||
* @param stringArg
|
||||
*/
|
||||
export declare let standard: (stringArg: string) => string;
|
||||
export declare const standard: (stringArg: string) => string;
|
||||
|
2
dist/smartstring.normalize.js
vendored
2
dist/smartstring.normalize.js
vendored
@ -20,4 +20,4 @@ exports.standard = (stringArg) => {
|
||||
let fix3 = exports.replaceAll(fix2, /\t/, ' '); // fix tabs
|
||||
return fix3;
|
||||
};
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRzdHJpbmcubm9ybWFsaXplLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvc21hcnRzdHJpbmcubm9ybWFsaXplLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQ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0FBQyxJQUFJLE1BQU0sQ0FBQyxZQUFZLEVBQUUsR0FBRyxDQUFDLEVBQUUsaUJBQWlCLENBQUMsQ0FBQTtBQUM1RSxDQUFDLENBQUE7QUFFRDs7O0dBR0c7QUFDVSxRQUFBLFFBQVEsR0FBRyxDQUFDLFNBQWlCLEVBQVUsRUFBRTtJQUNwRCxJQUFJLElBQUksR0FBRyxPQUFPLENBQUMsV0FBVyxDQUFDLFNBQVMsQ0FBQyxDQUFBLENBQUMsZ0JBQWdCO0lBQzFELElBQUksSUFBSSxHQUFHLE9BQU8sQ0FBQyxnQkFBZ0IsQ0FBQyxJQUFJLENBQUMsQ0FBQSxDQUFDLGVBQWU7SUFDekQsSUFBSSxJQUFJLEdBQUcsa0JBQVUsQ0FBQyxJQUFJLEVBQUUsSUFBSSxFQUFFLEdBQUcsQ0FBQyxDQUFBLENBQUMsV0FBVztJQUNsRCxNQUFNLENBQUMsSUFBSSxDQUFBO0FBQ2IsQ0FBQyxDQUFBIn0=
|
2
dist/smartstring.typescript.d.ts
vendored
2
dist/smartstring.typescript.d.ts
vendored
@ -1 +1 @@
|
||||
export declare let regexReferencePath: RegExp;
|
||||
export declare const regexReferencePath: RegExp;
|
||||
|
2
dist/smartstring.typescript.js
vendored
2
dist/smartstring.typescript.js
vendored
@ -1,4 +1,4 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.regexReferencePath = /\/\/\/\s*<reference\s+path\s*=\s*["|'].*["|']\s*\/>\s*[\\n]?/;
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRzdHJpbmcudHlwZXNjcmlwdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL3NtYXJ0c3RyaW5nLnR5cGVzY3JpcHQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFFVyxRQUFBLGtCQUFrQixHQUFHLDhEQUE4RCxDQUFBIn0=
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRzdHJpbmcudHlwZXNjcmlwdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL3NtYXJ0c3RyaW5nLnR5cGVzY3JpcHQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFFYSxRQUFBLGtCQUFrQixHQUFHLDhEQUE4RCxDQUFBIn0=
|
@ -3,5 +3,10 @@
|
||||
"npmGlobalTools": [
|
||||
"npmts"
|
||||
]
|
||||
},
|
||||
"npmdocker": {
|
||||
"baseImage": "hosttoday/ht-docker-node:npmci",
|
||||
"command": "npmci node install stable && npmci npm install && npmci npm test",
|
||||
"dockerSock": false
|
||||
}
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
import * as plugins from './smartstring.plugins'
|
||||
|
||||
export let createRandomString = (
|
||||
export const createRandomString = (
|
||||
patternArg: string,
|
||||
lengthArg: number,
|
||||
optionsArg: any
|
||||
@ -8,6 +8,6 @@ export let createRandomString = (
|
||||
return plugins.randomatic(patternArg, lengthArg, optionsArg)
|
||||
}
|
||||
|
||||
export let createCryptoRandomString = (lengthArg): string => {
|
||||
export const createCryptoRandomString = (lengthArg): string => {
|
||||
return plugins.cryptoRandomString(lengthArg)
|
||||
}
|
||||
|
@ -5,7 +5,7 @@ import * as plugins from './smartstring.plugins'
|
||||
* @param envArrayArg
|
||||
* @returns {}
|
||||
*/
|
||||
export let makeEnvObject = function (envArrayArg: string[]) {
|
||||
export const makeEnvObject = function (envArrayArg: string[]) {
|
||||
let returnObject = {}
|
||||
let regexString = /(.*)=(.*)/
|
||||
if (typeof envArrayArg !== 'undefined') {
|
||||
|
@ -24,13 +24,13 @@ export class GitRepo {
|
||||
/* ---------------------------------------------- *
|
||||
* ------------------ helpers ------------------- *
|
||||
* ---------------------------------------------- */
|
||||
let gitRegex = function (stringArg: string) {
|
||||
let regexString = /([a-zA-Z0-9\-\.]*)(?:\/|\:)([a-zA-Z0-9\-\.]*)(?:\/)([a-zA-Z0-9\-\.]*)(?:\.git)/
|
||||
const gitRegex = function (stringArg: string) {
|
||||
const regexString = /([a-zA-Z0-9\-\.]*)(?:\/|\:)([a-zA-Z0-9\-\.]*)(?:\/)([a-zA-Z0-9\-\.]*)(?:\.git)/
|
||||
let regexMatches = regexString.exec(stringArg)
|
||||
return regexMatches
|
||||
}
|
||||
|
||||
let gitLink = function (hostArg: string, userArg: string, repoArg: string, tokenArg: string = '', linkTypeArg): string {
|
||||
const gitLink = function (hostArg: string, userArg: string, repoArg: string, tokenArg: string = '', linkTypeArg): string {
|
||||
let returnString
|
||||
if (tokenArg !== '') {
|
||||
tokenArg = tokenArg + '@'
|
||||
|
@ -4,7 +4,7 @@ import * as plugins from './smartstring.plugins'
|
||||
* splits a string into an array
|
||||
* @param stringArg
|
||||
*/
|
||||
let splitStringAtLineBreak = (stringArg: string): string[] => {
|
||||
const splitStringAtLineBreak = (stringArg: string): string[] => {
|
||||
let resultArray = stringArg.split('\n')
|
||||
return cleanStringArray(resultArray)
|
||||
}
|
||||
@ -13,7 +13,7 @@ let splitStringAtLineBreak = (stringArg: string): string[] => {
|
||||
* joins a string together again
|
||||
* @param stringArrayArg
|
||||
*/
|
||||
let joinStringWithLineBreaks = (stringArrayArg: string[]): string => {
|
||||
const joinStringWithLineBreaks = (stringArrayArg: string[]): string => {
|
||||
let resultString: string = ''
|
||||
for (let line of stringArrayArg) {
|
||||
resultString = resultString + line + '\n' // add new line at end
|
||||
@ -25,7 +25,7 @@ let joinStringWithLineBreaks = (stringArrayArg: string[]): string => {
|
||||
* cleans first and last line in case they are empty
|
||||
* @param stringArrayArg
|
||||
*/
|
||||
let cleanStringArray = (stringArrayArg: string[]): string[] => {
|
||||
const cleanStringArray = (stringArrayArg: string[]): string[] => {
|
||||
let testRegex = /^[\s]*$/
|
||||
if (testRegex.test(stringArrayArg[ 0 ])) {
|
||||
stringArrayArg.shift()
|
||||
@ -41,7 +41,7 @@ let cleanStringArray = (stringArrayArg: string[]): string[] => {
|
||||
* @param stringArg
|
||||
* @param spaceAmount
|
||||
*/
|
||||
export let indent = (stringArg: string, spaceAmount: number): string => {
|
||||
export const indent = (stringArg: string, spaceAmount: number): string => {
|
||||
let localStringArray = splitStringAtLineBreak(stringArg)
|
||||
for (let stringArg of localStringArray) {
|
||||
stringArg = ' '.repeat(spaceAmount) + stringArg
|
||||
@ -55,7 +55,7 @@ export let indent = (stringArg: string, spaceAmount: number): string => {
|
||||
* @param stringArg
|
||||
* @param prefixArg
|
||||
*/
|
||||
export let indentWithPrefix = (stringArg: string, prefixArg: string): string => {
|
||||
export const indentWithPrefix = (stringArg: string, prefixArg: string): string => {
|
||||
let resultString: string
|
||||
let stringArray = splitStringAtLineBreak(stringArg)
|
||||
let resultArray: string[] = []
|
||||
@ -66,12 +66,14 @@ export let indentWithPrefix = (stringArg: string, prefixArg: string): string =>
|
||||
return resultString
|
||||
}
|
||||
|
||||
export let normalize = (stringArg: string): string => {
|
||||
export const normalize = (stringArg: string): string => {
|
||||
let resultString: string
|
||||
let splitStringArray: string[] = splitStringAtLineBreak(stringArg)
|
||||
let minCommonLeftOffset: number
|
||||
let deIndentRegex = /^(\s*)/
|
||||
let emptyLineRegex = /^(\s*)$/
|
||||
|
||||
const deIndentRegex = /^(\s*)/
|
||||
const emptyLineRegex = /^(\s*)$/
|
||||
|
||||
for (let stringItem of splitStringArray) {
|
||||
let offsetString = deIndentRegex.exec(stringItem)[ 1 ]
|
||||
if (
|
||||
|
@ -6,7 +6,7 @@ import * as plugins from './smartstring.plugins'
|
||||
* @param searchRegExp
|
||||
* @param replacementString
|
||||
*/
|
||||
export let replaceAll = (stringArg: string, searchRegExp: any, replacementString: string) => {
|
||||
export const replaceAll = (stringArg: string, searchRegExp: any, replacementString: string) => {
|
||||
return stringArg.replace(new RegExp(searchRegExp, 'g'), replacementString)
|
||||
}
|
||||
|
||||
@ -14,7 +14,7 @@ export let replaceAll = (stringArg: string, searchRegExp: any, replacementString
|
||||
* normalizes a string
|
||||
* @param stringArg
|
||||
*/
|
||||
export let standard = (stringArg: string): string => {
|
||||
export const standard = (stringArg: string): string => {
|
||||
let fix1 = plugins.stripIndent(stringArg) // fix indention
|
||||
let fix2 = plugins.normalizeNewline(fix1) // fix newlines
|
||||
let fix3 = replaceAll(fix2, /\t/, ' ') // fix tabs
|
||||
|
@ -1,3 +1,3 @@
|
||||
import * as plugins from './smartstring.plugins'
|
||||
|
||||
export let regexReferencePath = /\/\/\/\s*<reference\s+path\s*=\s*["|'].*["|']\s*\/>\s*[\\n]?/
|
||||
export const regexReferencePath = /\/\/\/\s*<reference\s+path\s*=\s*["|'].*["|']\s*\/>\s*[\\n]?/
|
||||
|
Loading…
x
Reference in New Issue
Block a user