rollup-demo-study 1.0.0 → 1.0.1
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.cjs.js +50 -0
- package/package.json +41 -41
- /package/dist/{index.js → index.esm.js} +0 -0
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var lodashEs = require('lodash-es');
|
|
4
|
+
|
|
5
|
+
var chunkArray = function chunkArray(array, size) {
|
|
6
|
+
return lodashEs.chunk(array, size);
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
var randomNumber = function randomNumber(min, max) {
|
|
10
|
+
return Math.floor(Math.random() * (max - min + 1)) + min;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
function _typeof(o) {
|
|
14
|
+
"@babel/helpers - typeof";
|
|
15
|
+
|
|
16
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
|
17
|
+
return typeof o;
|
|
18
|
+
} : function (o) {
|
|
19
|
+
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
20
|
+
}, _typeof(o);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* 深拷贝
|
|
25
|
+
*/
|
|
26
|
+
var _deepClone = function deepClone(obj) {
|
|
27
|
+
if (obj === null || _typeof(obj) !== "object") {
|
|
28
|
+
return obj;
|
|
29
|
+
}
|
|
30
|
+
if (obj instanceof Date) {
|
|
31
|
+
return new Date(obj.getTime());
|
|
32
|
+
}
|
|
33
|
+
var result = Array.isArray(obj) ? [] : {};
|
|
34
|
+
for (var key in obj) {
|
|
35
|
+
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
36
|
+
result[key] = _deepClone(obj[key]);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return result;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
// const a = [1, 2, 3, 4, 5].map((num) => num * 2);
|
|
43
|
+
// console.log(a);
|
|
44
|
+
var index = {
|
|
45
|
+
chunkArray: chunkArray,
|
|
46
|
+
randomNumber: randomNumber,
|
|
47
|
+
deepClone: _deepClone
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
module.exports = index;
|
package/package.json
CHANGED
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "rollup-demo-study",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"main": "./dist/index.cjs.js",
|
|
7
|
-
"types": "./dist/types/index.d.ts",
|
|
8
|
-
"module": "./dist/index.esm.js",
|
|
9
|
-
"exports": {
|
|
10
|
-
".": {
|
|
11
|
-
"import": "./dist/index.esm.js",
|
|
12
|
-
"require": "./dist/index.cjs.js"
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
"@
|
|
27
|
-
"@
|
|
28
|
-
"@rollup/plugin-
|
|
29
|
-
"@
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
"
|
|
37
|
-
},
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
}
|
|
41
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "rollup-demo-study",
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"description": "",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.cjs.js",
|
|
7
|
+
"types": "./dist/types/index.d.ts",
|
|
8
|
+
"module": "./dist/index.esm.js",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"import": "./dist/index.esm.js",
|
|
12
|
+
"require": "./dist/index.cjs.js",
|
|
13
|
+
"types": "./dist/types/index.d.ts"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"dist"
|
|
18
|
+
],
|
|
19
|
+
"keywords": [],
|
|
20
|
+
"author": "",
|
|
21
|
+
"license": "ISC",
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"@babel/core": "^7.29.0",
|
|
24
|
+
"@babel/preset-env": "^7.29.2",
|
|
25
|
+
"@rollup/plugin-babel": "^7.0.0",
|
|
26
|
+
"@rollup/plugin-commonjs": "^29.0.2",
|
|
27
|
+
"@rollup/plugin-node-resolve": "^16.0.3",
|
|
28
|
+
"@rollup/plugin-typescript": "^12.3.0",
|
|
29
|
+
"@types/lodash-es": "^4.17.12",
|
|
30
|
+
"rollup": "^4.60.1",
|
|
31
|
+
"rollup-plugin-delete": "^3.0.2",
|
|
32
|
+
"tslib": "^2.8.1",
|
|
33
|
+
"typescript": "^6.0.2"
|
|
34
|
+
},
|
|
35
|
+
"dependencies": {
|
|
36
|
+
"lodash-es": "^4.18.1"
|
|
37
|
+
},
|
|
38
|
+
"scripts": {
|
|
39
|
+
"build": "tsc && rollup -c"
|
|
40
|
+
}
|
|
41
|
+
}
|
|
File without changes
|