@daysnap/utils 0.0.5 → 0.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/es/base64ToBlob.js +0 -29
- package/es/blobToBase64.js +0 -3
- package/es/compareVersion.js +0 -1
- package/es/createHexColorByHash.js +0 -5
- package/es/downloadFile.js +0 -7
- package/es/filterBankCardNo.js +0 -5
- package/es/filterEmoji.js +0 -6
- package/es/filterIdCard.js +0 -2
- package/es/filterName.js +0 -3
- package/es/filterPhone.js +0 -2
- package/es/formatAmount.js +0 -6
- package/es/formatDate.js +0 -4
- package/es/getBlobByUrl.js +0 -4
- package/es/getImageInfo.js +0 -3
- package/es/getVideoInfo.js +0 -3
- package/es/isAndroid.js +0 -2
- package/es/isEmail.js +0 -2
- package/es/isIOS.js +0 -2
- package/es/isIdCard.js +0 -2
- package/es/isMobile.js +0 -2
- package/es/isObject.js +0 -2
- package/es/isPhone.js +0 -2
- package/es/isPromise.js +1 -4
- package/es/isRegExp.js +0 -4
- package/es/omit.js +0 -2
- package/es/parsePath.js +0 -3
- package/es/pick.js +0 -3
- package/es/replaceCrlf.js +0 -3
- package/lib/base64ToBlob.js +2 -60
- package/lib/blobToBase64.js +0 -4
- package/lib/compareVersion.js +3 -5
- package/lib/createHexColorByHash.js +0 -8
- package/lib/downloadFile.js +0 -12
- package/lib/filterBankCardNo.js +0 -8
- package/lib/filterEmoji.js +0 -10
- package/lib/filterIdCard.js +0 -2
- package/lib/filterName.js +0 -4
- package/lib/filterPhone.js +0 -2
- package/lib/formatAmount.js +0 -10
- package/lib/formatDate.js +0 -8
- package/lib/getBlobByUrl.js +0 -6
- package/lib/getImageInfo.js +0 -4
- package/lib/getVideoInfo.js +0 -4
- package/lib/index.js +0 -6
- package/lib/isAndroid.js +0 -2
- package/lib/isEmail.js +0 -2
- package/lib/isIOS.js +0 -2
- package/lib/isIdCard.js +0 -2
- package/lib/isMobile.js +0 -2
- package/lib/isObject.js +0 -2
- package/lib/isPhone.js +0 -2
- package/lib/isPromise.js +1 -5
- package/lib/isRegExp.js +0 -6
- package/lib/omit.js +2 -6
- package/lib/parsePath.js +0 -4
- package/lib/pick.js +0 -4
- package/lib/replaceCrlf.js +0 -4
- package/lib/storage/factory.js +2 -2
- package/package.json +13 -24
- package/dist/base64ToBlob.d.ts +0 -4
- package/dist/blobToBase64.d.ts +0 -4
- package/dist/compareVersion.d.ts +0 -7
- package/dist/compressImage.d.ts +0 -4
- package/dist/createHexColorByHash.d.ts +0 -4
- package/dist/downloadFile.d.ts +0 -6
- package/dist/filterBankCardNo.d.ts +0 -4
- package/dist/filterEmoji.d.ts +0 -4
- package/dist/filterIdCard.d.ts +0 -4
- package/dist/filterName.d.ts +0 -4
- package/dist/filterPhone.d.ts +0 -6
- package/dist/formatAmount.d.ts +0 -4
- package/dist/formatDate.d.ts +0 -4
- package/dist/getBlobByUrl.d.ts +0 -4
- package/dist/getImageInfo.d.ts +0 -4
- package/dist/getVideoInfo.d.ts +0 -4
- package/dist/index.d.ts +0 -38
- package/dist/index.js +0 -604
- package/dist/isAndroid.d.ts +0 -4
- package/dist/isEmail.d.ts +0 -4
- package/dist/isEmpty.d.ts +0 -4
- package/dist/isFunction.d.ts +0 -4
- package/dist/isIOS.d.ts +0 -4
- package/dist/isIdCard.d.ts +0 -4
- package/dist/isMobile.d.ts +0 -4
- package/dist/isNull.d.ts +0 -4
- package/dist/isObject.d.ts +0 -4
- package/dist/isPhone.d.ts +0 -4
- package/dist/isPromise.d.ts +0 -4
- package/dist/isRegExp.d.ts +0 -4
- package/dist/isString.d.ts +0 -4
- package/dist/isUndefined.d.ts +0 -4
- package/dist/omit.d.ts +0 -4
- package/dist/parseError.d.ts +0 -4
- package/dist/parsePath.d.ts +0 -4
- package/dist/pick.d.ts +0 -4
- package/dist/replaceCrlf.d.ts +0 -4
- package/dist/reserve.d.ts +0 -7
- package/dist/storage/factory.d.ts +0 -13
- package/dist/storage/index.d.ts +0 -26
package/lib/isPromise.js
CHANGED
|
@@ -5,13 +5,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.isPromise = isPromise;
|
|
7
7
|
|
|
8
|
-
require("core-js/modules/es.object.to-string.js");
|
|
9
|
-
|
|
10
|
-
require("core-js/modules/es.promise.js");
|
|
11
|
-
|
|
12
8
|
/**
|
|
13
9
|
* 校验是否是 promise
|
|
14
10
|
*/
|
|
15
11
|
function isPromise(val) {
|
|
16
|
-
return val instanceof Promise || !!val.then || !!val
|
|
12
|
+
return val instanceof Promise || !!val.then || !!val["catch"];
|
|
17
13
|
}
|
package/lib/isRegExp.js
CHANGED
|
@@ -5,12 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.isRegExp = isRegExp;
|
|
7
7
|
|
|
8
|
-
require("core-js/modules/es.regexp.constructor.js");
|
|
9
|
-
|
|
10
|
-
require("core-js/modules/es.regexp.exec.js");
|
|
11
|
-
|
|
12
|
-
require("core-js/modules/es.regexp.to-string.js");
|
|
13
|
-
|
|
14
8
|
/**
|
|
15
9
|
* 校验是否是正则表达式
|
|
16
10
|
*/
|
package/lib/omit.js
CHANGED
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
|
|
4
4
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports.omit = omit;
|
|
9
9
|
|
|
10
|
-
require("core-js/modules/es.object.to-string.js");
|
|
11
|
-
|
|
12
|
-
require("core-js/modules/web.dom-collections.for-each.js");
|
|
13
|
-
|
|
14
10
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
15
11
|
|
|
16
12
|
/**
|
|
@@ -18,7 +14,7 @@ var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/obje
|
|
|
18
14
|
*/
|
|
19
15
|
function omit(obj) {
|
|
20
16
|
var fields = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
21
|
-
var clone = (0, _objectSpread2
|
|
17
|
+
var clone = (0, _objectSpread2["default"])({}, obj);
|
|
22
18
|
fields.forEach(function (key) {
|
|
23
19
|
delete clone[key];
|
|
24
20
|
});
|
package/lib/parsePath.js
CHANGED
package/lib/pick.js
CHANGED
package/lib/replaceCrlf.js
CHANGED
package/lib/storage/factory.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
|
|
4
4
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
@@ -38,7 +38,7 @@ function factory(type) {
|
|
|
38
38
|
var _updateItem = function updateItem(key, val) {
|
|
39
39
|
var prev = _getItem(key);
|
|
40
40
|
|
|
41
|
-
return _setItem(key, (0, _objectSpread2
|
|
41
|
+
return _setItem(key, (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, prev), val));
|
|
42
42
|
}; // 清除
|
|
43
43
|
|
|
44
44
|
|
package/package.json
CHANGED
|
@@ -1,14 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@daysnap/utils",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.7",
|
|
4
4
|
"description": "通用的工具库",
|
|
5
|
+
"type": "module",
|
|
5
6
|
"main": "lib/index.js",
|
|
6
7
|
"module": "es/index.js",
|
|
7
8
|
"typings": "lib/index.d.ts",
|
|
8
|
-
"
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./lib/index.d.ts",
|
|
12
|
+
"require": "./lib/index.js",
|
|
13
|
+
"import": "./es/index.js",
|
|
14
|
+
"default": "./lib/index.js"
|
|
15
|
+
},
|
|
16
|
+
"./package.json": "./package.json"
|
|
17
|
+
},
|
|
9
18
|
"scripts": {
|
|
10
|
-
"docs": "typedoc --tsconfig ./tsconfig.json",
|
|
11
|
-
"rollup": "rollup -c",
|
|
12
19
|
"ts-node": "npx ts-node --project ./tsconfig.json ./src/filename.ts",
|
|
13
20
|
"gen": "plop --plopfile ./scripts/gen.js --force",
|
|
14
21
|
"del": "plop --plopfile ./scripts/del.js --force",
|
|
@@ -31,7 +38,6 @@
|
|
|
31
38
|
"tool"
|
|
32
39
|
],
|
|
33
40
|
"files": [
|
|
34
|
-
"dist",
|
|
35
41
|
"lib",
|
|
36
42
|
"es"
|
|
37
43
|
],
|
|
@@ -42,16 +48,8 @@
|
|
|
42
48
|
},
|
|
43
49
|
"homepage": "https://github.com/daysnap/utils#readme",
|
|
44
50
|
"devDependencies": {
|
|
45
|
-
"@babel/core": "^7.19.3",
|
|
46
|
-
"@babel/plugin-transform-runtime": "^7.19.1",
|
|
47
|
-
"@babel/preset-env": "^7.19.4",
|
|
48
|
-
"@babel/preset-typescript": "^7.18.6",
|
|
49
51
|
"@commitlint/cli": "^16.2.1",
|
|
50
52
|
"@commitlint/config-conventional": "^16.2.1",
|
|
51
|
-
"@rollup/plugin-babel": "^6.0.0",
|
|
52
|
-
"@rollup/plugin-commonjs": "^23.0.0",
|
|
53
|
-
"@rollup/plugin-node-resolve": "^15.0.0",
|
|
54
|
-
"@rollup/plugin-typescript": "^9.0.1",
|
|
55
53
|
"@typescript-eslint/eslint-plugin": "^5.40.0",
|
|
56
54
|
"@typescript-eslint/parser": "^5.40.0",
|
|
57
55
|
"commitizen": "^4.2.4",
|
|
@@ -66,11 +64,7 @@
|
|
|
66
64
|
"plop": "^3.1.1",
|
|
67
65
|
"prettier": "^2.7.1",
|
|
68
66
|
"rimraf": "^3.0.2",
|
|
69
|
-
"rollup": "^2.67.0",
|
|
70
|
-
"rollup-plugin-babel": "^4.4.0",
|
|
71
|
-
"rollup-plugin-terser": "^7.0.2",
|
|
72
67
|
"ts-node": "^10.9.1",
|
|
73
|
-
"typedoc": "^0.23.17",
|
|
74
68
|
"typescript": "^4.8.4"
|
|
75
69
|
},
|
|
76
70
|
"publishConfig": {
|
|
@@ -84,11 +78,6 @@
|
|
|
84
78
|
"*.{js,ts}": "eslint --fix"
|
|
85
79
|
},
|
|
86
80
|
"dependencies": {
|
|
87
|
-
"@babel/runtime": "^7.19.4"
|
|
88
|
-
|
|
89
|
-
},
|
|
90
|
-
"browserslist": [
|
|
91
|
-
"> 1%",
|
|
92
|
-
"last 2 versions"
|
|
93
|
-
]
|
|
81
|
+
"@babel/runtime": "^7.19.4"
|
|
82
|
+
}
|
|
94
83
|
}
|
package/dist/base64ToBlob.d.ts
DELETED
package/dist/blobToBase64.d.ts
DELETED
package/dist/compareVersion.d.ts
DELETED
package/dist/compressImage.d.ts
DELETED
package/dist/downloadFile.d.ts
DELETED
package/dist/filterEmoji.d.ts
DELETED
package/dist/filterIdCard.d.ts
DELETED
package/dist/filterName.d.ts
DELETED
package/dist/filterPhone.d.ts
DELETED
package/dist/formatAmount.d.ts
DELETED
package/dist/formatDate.d.ts
DELETED
package/dist/getBlobByUrl.d.ts
DELETED
package/dist/getImageInfo.d.ts
DELETED
package/dist/getVideoInfo.d.ts
DELETED
package/dist/index.d.ts
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
export declare const version = "0.0.3";
|
|
2
|
-
export * from './base64ToBlob';
|
|
3
|
-
export * from './blobToBase64';
|
|
4
|
-
export * from './compareVersion';
|
|
5
|
-
export * from './compressImage';
|
|
6
|
-
export * from './createHexColorByHash';
|
|
7
|
-
export * from './downloadFile';
|
|
8
|
-
export * from './filterBankCardNo';
|
|
9
|
-
export * from './filterEmoji';
|
|
10
|
-
export * from './filterIdCard';
|
|
11
|
-
export * from './filterName';
|
|
12
|
-
export * from './filterPhone';
|
|
13
|
-
export * from './formatAmount';
|
|
14
|
-
export * from './formatDate';
|
|
15
|
-
export * from './getBlobByUrl';
|
|
16
|
-
export * from './getImageInfo';
|
|
17
|
-
export * from './getVideoInfo';
|
|
18
|
-
export * from './isAndroid';
|
|
19
|
-
export * from './isEmail';
|
|
20
|
-
export * from './isEmpty';
|
|
21
|
-
export * from './isFunction';
|
|
22
|
-
export * from './isIOS';
|
|
23
|
-
export * from './isIdCard';
|
|
24
|
-
export * from './isMobile';
|
|
25
|
-
export * from './isNull';
|
|
26
|
-
export * from './isObject';
|
|
27
|
-
export * from './isPhone';
|
|
28
|
-
export * from './isPromise';
|
|
29
|
-
export * from './isRegExp';
|
|
30
|
-
export * from './isString';
|
|
31
|
-
export * from './isUndefined';
|
|
32
|
-
export * from './omit';
|
|
33
|
-
export * from './parseError';
|
|
34
|
-
export * from './parsePath';
|
|
35
|
-
export * from './pick';
|
|
36
|
-
export * from './replaceCrlf';
|
|
37
|
-
export * from './reserve';
|
|
38
|
-
export * from './storage';
|