pull/7716/head
Ivan Hofer 4 years ago committed by tanhauhau
parent d84f3153cb
commit d883e68298

@ -1,7 +1,9 @@
export const regex_whitespace = /\s/;
export const regex_whitespaces = /\s+/;
export const regex_starts_with_whitespace = /^\s/;
export const regex_starts_with_whitespaces = /^[ \t\r\n]*/;
export const regex_ends_with_whitespace = /\s$/;
export const regex_ends_with_whitespaces = /[ \t\r\n]*$/;
export const regex_only_whitespaces = /^\s+$/;
export const regex_whitespace_characters = /\s/g;

@ -1,9 +1,9 @@
import { regex_starts_with_whitespace, regex_ends_with_whitespace } from './patterns';
import { regex_starts_with_whitespaces, regex_ends_with_whitespaces } from './patterns';
export function trim_start(str: string) {
return str.replace(regex_starts_with_whitespace, '');
return str.replace(regex_starts_with_whitespaces, '');
}
export function trim_end(str: string) {
return str.replace(regex_ends_with_whitespace, '');
return str.replace(regex_ends_with_whitespaces, '');
}

Loading…
Cancel
Save