mazey 1.4.37 → 2.0.0
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/LICENSE +21 -21
- package/README.md +477 -317
- package/README_CN.md +335 -0
- package/lib/example.d.ts +2 -0
- package/lib/example.d.ts.map +1 -0
- package/lib/index.cjs.js +244 -446
- package/lib/index.d.ts +85 -131
- package/lib/index.d.ts.map +1 -1
- package/lib/index.esm.js +242 -438
- package/package.json +86 -85
- package/src/example.html +21 -0
- package/src/example.ts +49 -0
- package/src/index.ts +1360 -1619
- package/tsconfig.json +73 -73
- package/typing.d.ts +3 -3
- package/lib/test.d.ts +0 -2
- package/lib/test.d.ts.map +0 -1
- package/src/js/data-structure/MSet.js +0 -89
- package/src/js/polyfill.js +0 -63
- package/src/js/service/common.js +0 -4
- package/src/scss/extend/index.scss +0 -149
- package/src/scss/index.scss +0 -5
- package/src/scss/mixin/index.scss +0 -41
- package/src/scss/variate/index.scss +0 -28
- package/src/test.html +0 -33
- package/src/test.ts +0 -26
package/package.json
CHANGED
|
@@ -1,85 +1,86 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "mazey",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "Mazey's library for front end.",
|
|
5
|
-
"main": "lib/index.cjs.js",
|
|
6
|
-
"module": "lib/index.esm.js",
|
|
7
|
-
"typings": "lib/index.d.ts",
|
|
8
|
-
"mainEntryPointFilePath": "lib/index.d.ts",
|
|
9
|
-
"directories": {
|
|
10
|
-
"
|
|
11
|
-
},
|
|
12
|
-
"scripts": {
|
|
13
|
-
"dev": "webpack-dev-server --open",
|
|
14
|
-
"build": "npx rollup -c",
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
"
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
"
|
|
36
|
-
|
|
37
|
-
"@babel/
|
|
38
|
-
"@babel/plugin-proposal-
|
|
39
|
-
"@babel/plugin-
|
|
40
|
-
"@babel/
|
|
41
|
-
"@babel/preset-
|
|
42
|
-
"@
|
|
43
|
-
"@commitlint/
|
|
44
|
-
"@
|
|
45
|
-
"@typescript-eslint/eslint-plugin": "^4.22.0",
|
|
46
|
-
"@typescript-eslint/parser": "^4.22.0",
|
|
47
|
-
"babel-eslint": "10.1.0",
|
|
48
|
-
"clean-webpack-plugin": "1.0.1",
|
|
49
|
-
"eslint": "6.8.0",
|
|
50
|
-
"eslint-config-standard": "14.1.0",
|
|
51
|
-
"eslint-plugin-import": "2.20.1",
|
|
52
|
-
"eslint-plugin-node": "11.0.0",
|
|
53
|
-
"eslint-plugin-promise": "4.2.1",
|
|
54
|
-
"eslint-plugin-standard": "4.0.1",
|
|
55
|
-
"html-webpack-plugin": "3.2.0",
|
|
56
|
-
"http-server": "0.11.1",
|
|
57
|
-
"husky": "4.2.3",
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"prettier
|
|
62
|
-
"
|
|
63
|
-
"rollup
|
|
64
|
-
"rollup-plugin-
|
|
65
|
-
"rollup-plugin-
|
|
66
|
-
"
|
|
67
|
-
"
|
|
68
|
-
"
|
|
69
|
-
"
|
|
70
|
-
"
|
|
71
|
-
"
|
|
72
|
-
"webpack
|
|
73
|
-
"webpack-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
"
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
"
|
|
84
|
-
|
|
85
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "mazey",
|
|
3
|
+
"version": "2.0.0",
|
|
4
|
+
"description": "Mazey's library for front end.",
|
|
5
|
+
"main": "lib/index.cjs.js",
|
|
6
|
+
"module": "lib/index.esm.js",
|
|
7
|
+
"typings": "lib/index.d.ts",
|
|
8
|
+
"mainEntryPointFilePath": "lib/index.d.ts",
|
|
9
|
+
"directories": {
|
|
10
|
+
"lib": "./lib"
|
|
11
|
+
},
|
|
12
|
+
"scripts": {
|
|
13
|
+
"dev": "webpack-dev-server --open",
|
|
14
|
+
"build": "npx rollup -c",
|
|
15
|
+
"test": "jest",
|
|
16
|
+
"docs": "npx typedoc --out docs/ src/",
|
|
17
|
+
"release": "npm run build && npm publish",
|
|
18
|
+
"lint-and-fix": "eslint ./src/index.ts --ext 'ts,tsx' --fix"
|
|
19
|
+
},
|
|
20
|
+
"repository": {
|
|
21
|
+
"type": "git",
|
|
22
|
+
"url": "git+https://github.com/mazeyqian/mazey.git"
|
|
23
|
+
},
|
|
24
|
+
"keywords": [
|
|
25
|
+
"JavaScript",
|
|
26
|
+
"Function",
|
|
27
|
+
"Math",
|
|
28
|
+
"Load"
|
|
29
|
+
],
|
|
30
|
+
"author": "MazeyQian",
|
|
31
|
+
"license": "MIT",
|
|
32
|
+
"bugs": {
|
|
33
|
+
"url": "https://github.com/mazeyqian/mazey/issues"
|
|
34
|
+
},
|
|
35
|
+
"homepage": "https://mazey.cn/docs/mazey/",
|
|
36
|
+
"devDependencies": {
|
|
37
|
+
"@babel/core": "7.8.4",
|
|
38
|
+
"@babel/plugin-proposal-class-properties": "7.10.4",
|
|
39
|
+
"@babel/plugin-proposal-object-rest-spread": "7.11.0",
|
|
40
|
+
"@babel/plugin-transform-runtime": "7.11.0",
|
|
41
|
+
"@babel/preset-env": "7.5.5",
|
|
42
|
+
"@babel/preset-typescript": "7.10.4",
|
|
43
|
+
"@commitlint/cli": "8.3.5",
|
|
44
|
+
"@commitlint/config-conventional": "8.3.4",
|
|
45
|
+
"@typescript-eslint/eslint-plugin": "^4.22.0",
|
|
46
|
+
"@typescript-eslint/parser": "^4.22.0",
|
|
47
|
+
"babel-eslint": "10.1.0",
|
|
48
|
+
"clean-webpack-plugin": "1.0.1",
|
|
49
|
+
"eslint": "6.8.0",
|
|
50
|
+
"eslint-config-standard": "14.1.0",
|
|
51
|
+
"eslint-plugin-import": "2.20.1",
|
|
52
|
+
"eslint-plugin-node": "11.0.0",
|
|
53
|
+
"eslint-plugin-promise": "4.2.1",
|
|
54
|
+
"eslint-plugin-standard": "4.0.1",
|
|
55
|
+
"html-webpack-plugin": "3.2.0",
|
|
56
|
+
"http-server": "0.11.1",
|
|
57
|
+
"husky": "4.2.3",
|
|
58
|
+
"jest": "^27.5.1",
|
|
59
|
+
"jsdoc": "3.6.3",
|
|
60
|
+
"lint-staged": "10.0.8",
|
|
61
|
+
"prettier": "1.19.1",
|
|
62
|
+
"prettier-eslint-cli": "5.0.0",
|
|
63
|
+
"rollup": "1.31.1",
|
|
64
|
+
"rollup-plugin-babel": "4.3.3",
|
|
65
|
+
"rollup-plugin-commonjs": "^10.1.0",
|
|
66
|
+
"rollup-plugin-typescript2": "0.27.2",
|
|
67
|
+
"ts-loader": "8.0.2",
|
|
68
|
+
"typedoc": "0.18.0",
|
|
69
|
+
"typescript": "3.9.7",
|
|
70
|
+
"uglify-js": "3.4.7",
|
|
71
|
+
"uglifycss": "0.0.29",
|
|
72
|
+
"webpack": "4.30.0",
|
|
73
|
+
"webpack-cli": "3.3.2",
|
|
74
|
+
"webpack-dev-server": "3.10.3"
|
|
75
|
+
},
|
|
76
|
+
"husky": {
|
|
77
|
+
"hooks": {
|
|
78
|
+
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS",
|
|
79
|
+
"pre-commit": "lint-staged"
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
"dependencies": {
|
|
83
|
+
"@babel/runtime-corejs3": "7.11.2",
|
|
84
|
+
"core-js": "3.6.5"
|
|
85
|
+
}
|
|
86
|
+
}
|
package/src/example.html
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<title>Test Page</title>
|
|
6
|
+
<link rel="shortcut icon" type="image/png" href="https://mazey.cn/fav/logo-dark-circle-transparent-144x144.png">
|
|
7
|
+
<style>
|
|
8
|
+
.box {
|
|
9
|
+
color: #333;
|
|
10
|
+
}
|
|
11
|
+
</style>
|
|
12
|
+
</head>
|
|
13
|
+
<body>
|
|
14
|
+
<div class="container">
|
|
15
|
+
<div class="box">
|
|
16
|
+
<span>Box</span>
|
|
17
|
+
</div>
|
|
18
|
+
<div class="s"></div>
|
|
19
|
+
</div>
|
|
20
|
+
</body>
|
|
21
|
+
</html>
|
package/src/example.ts
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import {
|
|
2
|
+
isNumber,
|
|
3
|
+
getQueryParam,
|
|
4
|
+
getUrlParam,
|
|
5
|
+
updateQueryParam,
|
|
6
|
+
getHashQueryParam,
|
|
7
|
+
getDomain,
|
|
8
|
+
camelCaseToKebabCase,
|
|
9
|
+
camelCase2Underscore,
|
|
10
|
+
mTrim,
|
|
11
|
+
newLine,
|
|
12
|
+
deepCopyObject,
|
|
13
|
+
isJsonString,
|
|
14
|
+
generateRndNum,
|
|
15
|
+
} from './index';
|
|
16
|
+
|
|
17
|
+
// 数字测试
|
|
18
|
+
console.log('数字测试:', isNumber(Infinity, { isUnFiniteAsNumber: true }));
|
|
19
|
+
|
|
20
|
+
const hashParam = getHashQueryParam('ttt');
|
|
21
|
+
|
|
22
|
+
console.log('hashParam', hashParam);
|
|
23
|
+
|
|
24
|
+
// const t3 = getQueryParam('t3');
|
|
25
|
+
// const t4 = getQueryParam('t4');
|
|
26
|
+
|
|
27
|
+
// console.log('t3', t3);
|
|
28
|
+
// console.log('t4', t4);
|
|
29
|
+
|
|
30
|
+
// const t3 = getUrlParam('http://example.com/?t1=1&t2=2&t3=3&t4=4', 't3');
|
|
31
|
+
// const t4 = getUrlParam('http://example.com/?t1=1&t2=2&t3=3&t4=4', 't4');
|
|
32
|
+
|
|
33
|
+
// const t3 = updateQueryParam('http://example.com/?t1=1&t2=2&t3=3&t4=4', 't3', 'three');
|
|
34
|
+
// const t4 = updateQueryParam('http://example.com/?t1=1&t2=2&t3=3&t4=4', 't4', 'four');
|
|
35
|
+
|
|
36
|
+
// const t3 = getHashQueryParam('t3'); // 3
|
|
37
|
+
// const t4 = getHashQueryParam('t4'); // 4
|
|
38
|
+
|
|
39
|
+
// const t3 = getDomain('http://example.com/?t1=1&t2=2&t3=3&t4=4'); // example.com
|
|
40
|
+
// const t4 = getDomain('http://example.com/test/thanks?t1=1&t2=2&t3=3&t4=4', ['hostname', 'pathname']); // example.com/test/thanks
|
|
41
|
+
|
|
42
|
+
// const m1 = camelCaseToKebabCase('aBC'); // a-b-c
|
|
43
|
+
// const m2 = camelCase2Underscore('bBC'); // a_b_c
|
|
44
|
+
|
|
45
|
+
const m1 = generateRndNum(4); // '9730'
|
|
46
|
+
const m2 = generateRndNum(7); // '2262490'
|
|
47
|
+
|
|
48
|
+
console.log('m1', m1);
|
|
49
|
+
console.log('m2', m2);
|