{"id":24607155,"url":"https://github.com/staven630/es-aux","last_synced_at":"2025-05-05T21:33:39.502Z","repository":{"id":35074847,"uuid":"203707277","full_name":"staven630/es-aux","owner":"staven630","description":"JavaScript开发辅助，包含了开发过程中很多场景需要用到的函数。","archived":false,"fork":false,"pushed_at":"2023-01-04T07:52:24.000Z","size":972,"stargazers_count":24,"open_issues_count":14,"forks_count":7,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-26T14:04:57.478Z","etag":null,"topics":["javascript","js","js-helpers","lodash","rollup","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/staven630.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-08-22T03:26:49.000Z","updated_at":"2024-09-08T14:53:26.000Z","dependencies_parsed_at":"2023-01-15T13:17:54.424Z","dependency_job_id":null,"html_url":"https://github.com/staven630/es-aux","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/staven630%2Fes-aux","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/staven630%2Fes-aux/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/staven630%2Fes-aux/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/staven630%2Fes-aux/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/staven630","download_url":"https://codeload.github.com/staven630/es-aux/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252579992,"owners_count":21771248,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["javascript","js","js-helpers","lodash","rollup","typescript"],"created_at":"2025-01-24T17:21:40.961Z","updated_at":"2025-05-05T21:33:39.473Z","avatar_url":"https://github.com/staven630.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# es-aux\n\u0026emsp;\u0026emsp;JavaScript开发辅助函数库。\n\n# 安装\n```bash\nnpm i -S es-aux\n```\n\n# 使用\n```js\nconst Aux = require('es-aux')\n// or\nconst { camelToKebab } = require('es-aux')\n\nimport * as Aux from 'es-aux'\n// or\nimport { camelToKebab } from 'es-aux'\n```\n\n# 助手函数列表\n\n### 类型判断\n* [isArray: 判断是否是数组](https://github.com/staven630/es-aux/blob/master/docs/type.md#isArray)\n### 字符串相关\n* [divideText: 以某字符分隔字符串](https://github.com/staven630/es-aux/blob/master/docs/string.md#divideText)\n* [spliceText: 隐藏/替换字符串中间几位](https://github.com/staven630/es-aux/blob/master/docs/string.md#spliceText)\n* [toDecimal: 金额每三位正数添加逗号，支持保留小数](https://github.com/staven630/es-aux/blob/master/docs/string.md#toDecimal)\n* [sortJSON: 根据对象数组的某字段进项排序](https://github.com/staven630/es-aux/blob/master/docs/string.md#sortJSON)\n* [camelToKebab: 驼峰命名转换为短横线命名](https://github.com/staven630/es-aux/blob/master/docs/string.md#camelToKebab)\n* [kebabToCamel: 短横线命名转换为驼峰命名](https://github.com/staven630/es-aux/blob/master/docs/string.md#kebabToCamel)\n* [formatHTML: 过滤文本中的html标签](https://github.com/staven630/es-aux/blob/master/docs/string.md#formatHTML)\n* [randomString: 随机生成长度为len的字符串](https://github.com/staven630/es-aux/blob/master/docs/string.md#randomString)\n* [getHighlightList: 获取高亮分词列表](https://github.com/staven630/es-aux/blob/master/docs/string.md#getHighlightList)\n* [getHighlightTemplate: 获取高亮分词模板](https://github.com/staven630/es-aux/blob/master/docs/string.md#getHighlightTemplate)\n* [getHighlight: 获取高亮分词信息](https://github.com/staven630/es-aux/blob/master/docs/string.md#getHighlight)\n### 数组\n* [unionArr: 求数组并集](https://github.com/staven630/es-aux/blob/master/docs/array.md#unionArr)\n* [intersectArr: 求数组交集](https://github.com/staven630/es-aux/blob/master/docs/array.md#intersectArr)\n* [differenceArr: 求数组差集](https://github.com/staven630/es-aux/blob/master/docs/array.md#differenceArr)\n* [uniqueArr: 基本类型数组去重](https://github.com/staven630/es-aux/blob/master/docs/array.md#uniqueArr)\n* [uniqueKeyInArr: 对象数组单个键值匹配去重](https://github.com/staven630/es-aux/blob/master/docs/array.md#uniqueKeyInArr)\n* [uniqueObjInArr: 对象数组完全匹配去重](https://github.com/staven630/es-aux/blob/master/docs/array.md#uniqueObjInArr)\n* [flattenArr: 规整多重数组](https://github.com/staven630/es-aux/blob/master/docs/array.md#flattenArr)\n### 存储相关\n* [getStorage: localStorage获取值](https://github.com/staven630/es-aux/blob/master/docs/storage.md#getStorage)\n* [setStorage: localStorage设置值](https://github.com/staven630/es-aux/blob/master/docs/storage.md#setStorage)\n* [removeStorage: localStorage移除键为key的存储](https://github.com/staven630/es-aux/blob/master/docs/storage.md#removeStorage)\n* [clearStorage: localStorage清空存储](https://github.com/staven630/es-aux/blob/master/docs/storage.md#clearStorage)\n* [setCookie: 设置Cookie](https://github.com/staven630/es-aux/blob/master/docs/storage.md#setCookie)\n* [getCookie: 获取Cookie](https://github.com/staven630/es-aux/blob/master/docs/storage.md#getCookie)\n* [removeCookie: 清除Cookie](https://github.com/staven630/es-aux/blob/master/docs/storage.md#removeCookie)\n### Map、Set相关\n* [mapToObj: Map转换成Object](https://github.com/staven630/es-aux/blob/master/docs/map.md#mapToObj)\n* [objToMap: Object转换成Map](https://github.com/staven630/es-aux/blob/master/docs/map.md#objToMap)\n### 时间\n* [getDate: 返回格林威治时间](https://github.com/staven630/es-aux/blob/master/docs/date.md#getDate)\n* [prefixDate: 前缀加0](https://github.com/staven630/es-aux/blob/master/docs/date.md#prefixDate)\n* [formatDate: 自定义时间转换](https://github.com/staven630/es-aux/blob/master/docs/date.md#formatDate)\n* [getNextDate: 获取N天后的日期](https://github.com/staven630/es-aux/blob/master/docs/date.md#getNextDate)\n* [getMonthDays: 获取某个月有多少天](https://github.com/staven630/es-aux/blob/master/docs/date.md#getMonthDays)\n* [getPrevMonth: 获取上个月初时间](https://github.com/staven630/es-aux/blob/master/docs/date.md#getPrevMonth)\n* [getNextMonth: 获取下个月初时间](https://github.com/staven630/es-aux/blob/master/docs/date.md#getNextMonth)\n* [getCountDown: 获取倒计时时间](https://github.com/staven630/es-aux/blob/master/docs/date.md#getCountDown)\n* [getAgoDate: 获取N天前、N小时、N分钟前](https://github.com/staven630/es-aux/blob/master/docs/date.md#getAgoDate)\n* [getMonthLastDay: 获取某月最后一天](https://github.com/staven630/es-aux/blob/master/docs/date.md#getMonthLastDay)\n* [getWeekFirstDay: 获取某周的第一天，以周日计算](https://github.com/staven630/es-aux/blob/master/docs/date.md#getWeekFirstDay)\n* [getWeekLastDay: 获取某周的最后一天，以周六计算](https://github.com/staven630/es-aux/blob/master/docs/date.md#getWeekLastDay)\n* [getFirstMonday: 获取某月第一个周一](https://github.com/staven630/es-aux/blob/master/docs/date.md#getFirstMonday)\n* [getLastSunday: 获取某月最后一个周日](https://github.com/staven630/es-aux/blob/master/docs/date.md#getLastSunday)\n* [getFirstSunday: 获取某月第一个周日](https://github.com/staven630/es-aux/blob/master/docs/date.md#getFirstSunday)\n* [getLastSaturday: 获取某月最后一个周六](https://github.com/staven630/es-aux/blob/master/docs/date.md#getLastSaturday)\n* [getWeekIndex: 获取日期今年第几周，以周一开始算](https://github.com/staven630/es-aux/blob/master/docs/date.md#getWeekIndex)\n### 浏览器相关\n* [hasClass: 是否具有 className](https://github.com/staven630/es-aux/blob/master/docs/browser.md#hasClass)\n* [addClass: 添加 className](https://github.com/staven630/es-aux/blob/master/docs/browser.md#addClass)\n* [removeClass: 删除 className](https://github.com/staven630/es-aux/blob/master/docs/browser.md#removeClass)\n* [toggleClass: 切换 className](https://github.com/staven630/es-aux/blob/master/docs/browser.md#toggleClass)\n* [getUrlParam: 获取链接中键相应的值](https://github.com/staven630/es-aux/blob/master/docs/browser.md#getUrlParam)\n* [getUrlObj: 返回链接中所有键值对象](https://github.com/staven630/es-aux/blob/master/docs/browser.md#getUrlObj)\n* [addUrlParam: 向链接中添加键值对](https://github.com/staven630/es-aux/blob/master/docs/browser.md#addUrlParam)\n* [modifyUrlParam: 修改链接中键对应的值](https://github.com/staven630/es-aux/blob/master/docs/browser.md#modifyUrlParam)\n* [isIE: 判断是否是IE浏览器](https://github.com/staven630/es-aux/blob/master/docs/browser.md#isIE)\n* [isIE11: 判断是否是IE11](https://github.com/staven630/es-aux/blob/master/docs/browser.md#isIE11)\n* [isEdge: 判断是否是Edge](https://github.com/staven630/es-aux/blob/master/docs/browser.md#isEdge)\n* [getIEVersion: 获取IE浏览器版本](https://github.com/staven630/es-aux/blob/master/docs/browser.md#getIEVersion)\n* [isAndroid: 判断是否是Android](https://github.com/staven630/es-aux/blob/master/docs/browser.md#isAndroid)\n* [isIOS: 判断是否是IOS](https://github.com/staven630/es-aux/blob/master/docs/browser.md#isIOS)\n* [isMobile: 判断是否是移动端](https://github.com/staven630/es-aux/blob/master/docs/browser.md#isMobile)\n* [isPC: 判断是否是PC](https://github.com/staven630/es-aux/blob/master/docs/browser.md#isPC)\n* [isWX: 判断是否是微信浏览器](https://github.com/staven630/es-aux/blob/master/docs/browser.md#isWX)\n* [getEvent: 获取事件源](https://github.com/staven630/es-aux/blob/master/docs/browser.md#getEvent)\n* [getEventTarget: 获取事件对象](https://github.com/staven630/es-aux/blob/master/docs/browser.md#getEventTarget)\n* [addHandler: 添加事件](https://github.com/staven630/es-aux/blob/master/docs/browser.md#addHandler)\n* [removeHandler: 移除事件](https://github.com/staven630/es-aux/blob/master/docs/browser.md#removeHandler)\n* [preventDefault: 阻止默认事件](https://github.com/staven630/es-aux/blob/master/docs/browser.md#preventDefault)\n* [stopPropagation: 阻止事件冒泡](https://github.com/staven630/es-aux/blob/master/docs/browser.md#stopPropagation)\n* [getPageX: 获取当前位置的X轴坐标](https://github.com/staven630/es-aux/blob/master/docs/browser.md#getPageX)\n* [getPageY: 获取当前位置的Y轴坐标](https://github.com/staven630/es-aux/blob/master/docs/browser.md#getPageY)\n* [getScrollTop: 获取页面滚动高度](https://github.com/staven630/es-aux/blob/master/docs/browser.md#getScrollTop)\n### 函数相关\n* [memoize: 缓存函数调用结果](https://github.com/staven630/es-aux/blob/master/docs/function.md#memoize)\n* [debounce: 防抖函数](https://github.com/staven630/es-aux/blob/master/docs/function.md#debounce)\n* [throttle: 节流函数](https://github.com/staven630/es-aux/blob/master/docs/function.md#throttle)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstaven630%2Fes-aux","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstaven630%2Fes-aux","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstaven630%2Fes-aux/lists"}