1.0.2-beta.1

This commit is contained in:
ddmt 2024-10-17 17:27:58 +08:00
parent d368a82e7c
commit 45d1530f15
4 changed files with 15 additions and 15 deletions

View File

@ -30,6 +30,19 @@ export function nextArray(arr, index) {
return arr.slice(index + 1, arr.length).concat(arr.slice(0, index + 1)); return arr.slice(index + 1, arr.length).concat(arr.slice(0, index + 1));
} }
/*
* 数组去重函数
* @param {Array} arr
*/
export function ArrayDeHeavy(arr) {
let newArr = new Set();
arr.forEach(item => {
newArr.add(item);
});
return Array.from(newArr);
}
/* /*
* 获取相对时间(中文) * 获取相对时间(中文)
* @param {Date} date * @param {Date} date

View File

@ -8,6 +8,6 @@
* @FilePath: /index.js * @FilePath: /index.js
*/ */
export { animateStart } from './Tool/animate.js'; export { animateStart } from './Tool/animate.js';
export { randomNum, nextArray, getRelativeTime } from './Tool/number.js'; export { randomNum, nextArray, ArrayDeHeavy, getRelativeTime } from './Tool/number.js';
console.log('ddmt-tool Loading successfully!! 😺'); console.log('ddmt-tool Loading successfully!! 😺');

13
package-lock.json generated
View File

@ -1,13 +0,0 @@
{
"name": "ddmt-tool",
"version": "0.0.1-beta.3",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "ddmt-tool",
"version": "0.0.1-beta.3",
"license": "MIT"
}
}
}

View File

@ -1,6 +1,6 @@
{ {
"name": "ddmt-tool", "name": "ddmt-tool",
"version": "0.0.1-beta.3", "version": "0.0.2-beta.1",
"description": "A utility library that provides commonly used functions to simplify everyday development tasks. Whether it's string manipulation, array operations, or other frequent functionalities, `ddmt-tool` helps you work more efficiently.", "description": "A utility library that provides commonly used functions to simplify everyday development tasks. Whether it's string manipulation, array operations, or other frequent functionalities, `ddmt-tool` helps you work more efficiently.",
"main": "index.js", "main": "index.js",
"type": "module", "type": "module",