初始化本地仓库

This commit is contained in:
2026-08-31 11:33:59 +08:00
commit 663f74b633
2390 changed files with 402918 additions and 0 deletions
@@ -0,0 +1,21 @@
/**
* 去除字符串空格
* @param str 输入字符串
* @param pos 去除位置,'both' | 'left' | 'right' | 'all',默认'both'
* @returns 去除空格后的字符串
*/
function trim(str: string, pos: 'both' | 'left' | 'right' | 'all' = 'both'): string {
if (pos === 'both') {
return str.replace(/^\s+|\s+$/g, '');
} else if (pos === 'left') {
return str.replace(/^\s*/, '');
} else if (pos === 'right') {
return str.replace(/(\s*$)/g, '');
} else if (pos === 'all') {
return str.replace(/\s+/g, '');
} else {
return str;
}
}
export default trim;