fix(core): update

This commit is contained in:
Philipp Kunz 2019-01-12 20:19:16 +01:00
parent f5838f6d6a
commit 5e69664f59

View File

@ -3,11 +3,11 @@ import * as plugins from './smartstring.plugins';
/**
* replaces all occurences of something in a string
* @param stringArg
* @param searchRegExp
* @param searchPattern
* @param replacementString
*/
export const replaceAll = (stringArg: string, searchRegExp: any, replacementString: string) => {
return stringArg.replace(new RegExp(searchRegExp, 'g'), replacementString);
export const replaceAll = (stringArg: string, searchPattern: string, replacementString: string) => {
return stringArg.replace(new RegExp(searchPattern, 'g'), replacementString);
};
/**
@ -17,6 +17,6 @@ export const replaceAll = (stringArg: string, searchRegExp: any, replacementStri
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
let fix3 = replaceAll(fix2, '\t/', ' '); // fix tabs
return fix3;
};