mirror of https://github.com/sveltejs/svelte
parent
f80e85f79f
commit
595e6a773e
@ -1,6 +1,6 @@
|
||||
export const whitespace = /[ \t\r\n]/;
|
||||
export const start_whitespace = /^[ \t\r\n]*/;
|
||||
export const end_whitespace = /[ \t\r\n]*$/;
|
||||
export const start_newline = /^\r?\n/;
|
||||
export const regex_whitespace = /[ \t\r\n]/;
|
||||
export const regex_start_whitespace = /^[ \t\r\n]*/;
|
||||
export const regex_end_whitespace = /[ \t\r\n]*$/;
|
||||
export const regex_start_newline = /^\r?\n/;
|
||||
|
||||
export const dimensions = /^(?:offset|client)(?:Width|Height)$/;
|
||||
export const regex_dimensions = /^(?:offset|client)(?:Width|Height)$/;
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
import { start_whitespace, end_whitespace } from './patterns';
|
||||
import { regex_start_whitespace, regex_end_whitespace } from './patterns';
|
||||
|
||||
export function trim_start(str: string) {
|
||||
return str.replace(start_whitespace, '');
|
||||
return str.replace(regex_start_whitespace, '');
|
||||
}
|
||||
|
||||
export function trim_end(str: string) {
|
||||
return str.replace(end_whitespace, '');
|
||||
return str.replace(regex_end_whitespace, '');
|
||||
}
|
||||
|
||||
Loading…
Reference in new issue