Skip to content

Commit

Permalink
build: 版本构建更新
Browse files Browse the repository at this point in the history
  • Loading branch information
hrope committed Sep 29, 2022
1 parent 55cadfa commit 366a1e6
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 3 deletions.
2 changes: 1 addition & 1 deletion dist/business-tools.umd.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions dist/index.cjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,23 @@ function digitUppercase(n) {
return head + s.replace(/(.)*/, '元')
.replace(/(.)+/g, '零')
.replace(/^$/, '零元整');
}
/**
* 保护手机号码隐私,隐蔽中间四位数
* @param phone {String}
* @returns {String} 结果如:138****8888
*/
function replacePhoneNum(phone) {
phone = phone.replace(/(\d{3})\d{4}(\d{4})/, '$1****$2');
return phone;
}
/**
* 去除首尾空格处理,trim(' test ')
* @param str {String} 文本内容
* @returns {String} 处理后的结果
*/
function trim(str) {
return str.replace(/(^\s*)|(\s*$)/g, '');
}

/**
Expand Down Expand Up @@ -650,9 +667,11 @@ exports.randomColor = randomColor;
exports.randomNum = randomNum;
exports.removeClass = removeClass;
exports.removeCookiesByName = removeCookiesByName;
exports.replacePhoneNum = replacePhoneNum;
exports.requestAnimFrame = requestAnimFrame;
exports.scrollTo = scrollTo;
exports.setCookie = setCookie;
exports.setScrollTop = setScrollTop;
exports.stringfyQueryString = stringfyQueryString;
exports.timeLeft = timeLeft;
exports.trim = trim;
14 changes: 13 additions & 1 deletion dist/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,18 @@ declare function isUrl(str: string): boolean;
* @return {String}
*/
declare function digitUppercase(n: number): string;
/**
* 保护手机号码隐私,隐蔽中间四位数
* @param phone {String}
* @returns {String} 结果如:138****8888
*/
declare function replacePhoneNum(phone: string): string;
/**
* 去除首尾空格处理,trim(' test ')
* @param str {String} 文本内容
* @returns {String} 处理后的结果
*/
declare function trim(str: string): string;

/**
*
Expand Down Expand Up @@ -215,4 +227,4 @@ declare function parseQueryString(url?: string): {};
*/
declare function stringfyQueryString(obj: any): string;

export { addClass, deepClone, digitUppercase, formatPassTime, formatRemainTime, getBrowserInfo, getCookieByName, getKeyName, getOSInfo, getScrollTop, hasClass, hasSupportWebP, isColor, isEmail, isEmptyObject, isIdCard, isLeapYear, isPhoneNum, isSameDay, isUrl, monthDays, parseQueryString, randomColor, randomNum, removeClass, removeCookiesByName, requestAnimFrame, scrollTo, setCookie, setScrollTop, stringfyQueryString, timeLeft };
export { addClass, deepClone, digitUppercase, formatPassTime, formatRemainTime, getBrowserInfo, getCookieByName, getKeyName, getOSInfo, getScrollTop, hasClass, hasSupportWebP, isColor, isEmail, isEmptyObject, isIdCard, isLeapYear, isPhoneNum, isSameDay, isUrl, monthDays, parseQueryString, randomColor, randomNum, removeClass, removeCookiesByName, replacePhoneNum, requestAnimFrame, scrollTo, setCookie, setScrollTop, stringfyQueryString, timeLeft, trim };
19 changes: 18 additions & 1 deletion dist/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,23 @@ function digitUppercase(n) {
return head + s.replace(/(.)*/, '元')
.replace(/(.)+/g, '零')
.replace(/^$/, '零元整');
}
/**
* 保护手机号码隐私,隐蔽中间四位数
* @param phone {String}
* @returns {String} 结果如:138****8888
*/
function replacePhoneNum(phone) {
phone = phone.replace(/(\d{3})\d{4}(\d{4})/, '$1****$2');
return phone;
}
/**
* 去除首尾空格处理,trim(' test ')
* @param str {String} 文本内容
* @returns {String} 处理后的结果
*/
function trim(str) {
return str.replace(/(^\s*)|(\s*$)/g, '');
}

/**
Expand Down Expand Up @@ -620,4 +637,4 @@ function stringfyQueryString(obj) {
return pairs.join('&');
}

export { addClass, deepClone, digitUppercase, formatPassTime, formatRemainTime, getBrowserInfo, getCookieByName, getKeyName, getOSInfo, getScrollTop, hasClass, hasSupportWebP, isColor, isEmail, isEmptyObject, isIdCard, isLeapYear, isPhoneNum, isSameDay, isUrl, monthDays, parseQueryString, randomColor, randomNum, removeClass, removeCookiesByName, requestAnimFrame, scrollTo, setCookie, setScrollTop, stringfyQueryString, timeLeft };
export { addClass, deepClone, digitUppercase, formatPassTime, formatRemainTime, getBrowserInfo, getCookieByName, getKeyName, getOSInfo, getScrollTop, hasClass, hasSupportWebP, isColor, isEmail, isEmptyObject, isIdCard, isLeapYear, isPhoneNum, isSameDay, isUrl, monthDays, parseQueryString, randomColor, randomNum, removeClass, removeCookiesByName, replacePhoneNum, requestAnimFrame, scrollTo, setCookie, setScrollTop, stringfyQueryString, timeLeft, trim };
12 changes: 12 additions & 0 deletions dist/lib/string/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,15 @@
* @return {String}
*/
export declare function digitUppercase(n: number): string;
/**
* 保护手机号码隐私,隐蔽中间四位数
* @param phone {String}
* @returns {String} 结果如:138****8888
*/
export declare function replacePhoneNum(phone: string): string;
/**
* 去除首尾空格处理,trim(' test ')
* @param str {String} 文本内容
* @returns {String} 处理后的结果
*/
export declare function trim(str: string): string;

0 comments on commit 366a1e6

Please sign in to comment.