|
@@ -2,6 +2,8 @@
|
|
|
* Created by PanJiaChen on 16/11/18.
|
|
|
*/
|
|
|
|
|
|
+import { isatty } from "tty";
|
|
|
+
|
|
|
/** https
|
|
|
* @param {string} path
|
|
|
* @returns {Boolean}
|
|
@@ -392,3 +394,14 @@ export function accMul(arg1, arg2) {
|
|
|
Math.pow(10, m)
|
|
|
);
|
|
|
}
|
|
|
+
|
|
|
+export function isSpecialSymbol(s) {
|
|
|
+ const pattern = new RegExp(
|
|
|
+ "[`~!@#$^&*()=|{}':;',\\[\\].<>/?~!@#¥……&*()——|{}【】‘;:”“'。,、?%+_]"
|
|
|
+ );
|
|
|
+ let specialStr = "";
|
|
|
+ for (let i = 0; i < s.length; i++) {
|
|
|
+ specialStr += s.substr(i, 1).replace(pattern, "");
|
|
|
+ }
|
|
|
+ return s.length > specialStr.length;
|
|
|
+}
|