BREAKING CHANGE(scope): change scope to @pushrocks

This commit is contained in:
2018-07-21 14:37:39 +02:00
parent e9899e5451
commit 62336aa2cf
42 changed files with 1312 additions and 1289 deletions

View File

@@ -1,22 +1,22 @@
import * as plugins from './smartstring.plugins'
import * as plugins from './smartstring.plugins';
/**
* replaces all occurences of something in a string
* @param stringArg
* @param searchRegExp
* @param replacementString
* @param searchRegExp
* @param replacementString
*/
export const replaceAll = (stringArg: string, searchRegExp: any, replacementString: string) => {
return stringArg.replace(new RegExp(searchRegExp, 'g'), replacementString)
}
return stringArg.replace(new RegExp(searchRegExp, 'g'), replacementString);
};
/**
* normalizes a string
* @param stringArg
*/
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
return fix3
}
let fix1 = plugins.stripIndent(stringArg); // fix indention
let fix2 = plugins.normalizeNewline(fix1); // fix newlines
let fix3 = replaceAll(fix2, /\t/, ' '); // fix tabs
return fix3;
};