@fast-china/utils 1.0.5 → 1.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.global.js +9 -9
- package/dist/index.global.js.map +1 -1
- package/dist/index.global.min.js +5 -5
- package/dist/index.global.min.js.map +1 -1
- package/es/base64/index.mjs +1 -1
- package/es/base64/index.mjs.map +1 -1
- package/es/color/index.mjs +3 -3
- package/es/color/index.mjs.map +1 -1
- package/es/console/index.mjs.map +1 -1
- package/es/identity/index.mjs +1 -1
- package/es/identity/index.mjs.map +1 -1
- package/es/string/index.mjs +3 -3
- package/es/string/index.mjs.map +1 -1
- package/es/vue/props.mjs.map +1 -1
- package/es/vue/useRender.mjs.map +1 -1
- package/lib/base64/index.js +1 -1
- package/lib/base64/index.js.map +1 -1
- package/lib/color/index.js +1 -1
- package/lib/color/index.js.map +1 -1
- package/lib/console/index.js.map +1 -1
- package/lib/identity/index.js +1 -1
- package/lib/identity/index.js.map +1 -1
- package/lib/string/index.js +1 -1
- package/lib/string/index.js.map +1 -1
- package/lib/vue/props.js.map +1 -1
- package/lib/vue/useRender.js.map +1 -1
- package/package.json +90 -92
package/dist/index.global.js
CHANGED
|
@@ -30,7 +30,7 @@ var FastUtils = function(exports, vue) {
|
|
|
30
30
|
}
|
|
31
31
|
};
|
|
32
32
|
const b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
|
|
33
|
-
const b64re = /^(?:[A-
|
|
33
|
+
const b64re = /^(?:[A-Z\d+/]{4})*?(?:[A-Z\d+/]{2}(?:==)?|[A-Z\d+/]{3}=?)?$/i;
|
|
34
34
|
const base64PwdDic = [
|
|
35
35
|
{ index: 977, randomIndex: 188 },
|
|
36
36
|
{ index: 926, randomIndex: 201 },
|
|
@@ -255,7 +255,7 @@ var FastUtils = function(exports, vue) {
|
|
|
255
255
|
*/
|
|
256
256
|
hexToRgb(str) {
|
|
257
257
|
let hex = "";
|
|
258
|
-
const reg = /^#?[0-9A-
|
|
258
|
+
const reg = /^#?[0-9A-F]{6}$/i;
|
|
259
259
|
if (!reg.test(str)) throw new FastError("输入错误的hex");
|
|
260
260
|
str = str.replace("#", "");
|
|
261
261
|
hex = str.match(/../g);
|
|
@@ -283,7 +283,7 @@ var FastUtils = function(exports, vue) {
|
|
|
283
283
|
* @returns 返回处理后的颜色值
|
|
284
284
|
*/
|
|
285
285
|
getDarkColor(color, level) {
|
|
286
|
-
const reg = /^#?[0-9A-
|
|
286
|
+
const reg = /^#?[0-9A-F]{6}$/i;
|
|
287
287
|
if (!reg.test(color)) throw new FastError("输入错误的hex颜色值");
|
|
288
288
|
const rgb = this.hexToRgb(color);
|
|
289
289
|
for (let i = 0; i < 3; i++) rgb[i] = Math.round(20.5 * level + rgb[i] * (1 - level));
|
|
@@ -296,7 +296,7 @@ var FastUtils = function(exports, vue) {
|
|
|
296
296
|
* @returns 返回处理后的颜色值
|
|
297
297
|
*/
|
|
298
298
|
getLightColor(color, level) {
|
|
299
|
-
const reg = /^#?[0-9A-
|
|
299
|
+
const reg = /^#?[0-9A-F]{6}$/i;
|
|
300
300
|
if (!reg.test(color)) throw new FastError("输入错误的hex颜色值");
|
|
301
301
|
const rgb = this.hexToRgb(color);
|
|
302
302
|
for (let i = 0; i < 3; i++) rgb[i] = Math.round(255 * level + rgb[i] * (1 - level));
|
|
@@ -6373,7 +6373,7 @@ var FastUtils = function(exports, vue) {
|
|
|
6373
6373
|
return n && Object.prototype.hasOwnProperty.call(n, "default") && Object.keys(n).length === 1 ? n["default"] : n;
|
|
6374
6374
|
}
|
|
6375
6375
|
function getAugmentedNamespace(n) {
|
|
6376
|
-
if (n
|
|
6376
|
+
if (Object.prototype.hasOwnProperty.call(n, "__esModule")) return n;
|
|
6377
6377
|
var f = n.default;
|
|
6378
6378
|
if (typeof f == "function") {
|
|
6379
6379
|
var a = function a2() {
|
|
@@ -13881,9 +13881,9 @@ var FastUtils = function(exports, vue) {
|
|
|
13881
13881
|
isJson(value) {
|
|
13882
13882
|
if (!isString(value)) return false;
|
|
13883
13883
|
value = value.replace(/\s/g, "").replace(/\n|\r/, "");
|
|
13884
|
-
if (/^\{
|
|
13885
|
-
if (/^\[
|
|
13886
|
-
return value.replace(/^\[/, "").replace(/\]$/, "").replace(
|
|
13884
|
+
if (/^\{.*?\}$/.test(value)) return /".*?":/.test(value);
|
|
13885
|
+
if (/^\[.*?\]$/.test(value)) {
|
|
13886
|
+
return value.replace(/^\[/, "").replace(/\]$/, "").replace(/\},\{/g, "}\n{").split(/\n/).map((s) => {
|
|
13887
13887
|
return stringUtil.isJson(s);
|
|
13888
13888
|
}).reduce((prev, curr) => {
|
|
13889
13889
|
return !!curr;
|
|
@@ -13991,7 +13991,7 @@ var FastUtils = function(exports, vue) {
|
|
|
13991
13991
|
cacheKey: "__DEVICE_ID",
|
|
13992
13992
|
deviceId: ""
|
|
13993
13993
|
});
|
|
13994
|
-
const uuidRegExp = /^[0-9a-
|
|
13994
|
+
const uuidRegExp = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
13995
13995
|
const makeIdentity = () => {
|
|
13996
13996
|
if (state.deviceId && uuidRegExp.test(state.deviceId)) {
|
|
13997
13997
|
Local.set(state.cacheKey, state.deviceId);
|