{"id":42890016,"url":"https://github.com/liiiiiiu/chafingdish","last_synced_at":"2026-01-30T14:56:49.795Z","repository":{"id":64851109,"uuid":"578883954","full_name":"liiiiiiu/chafingdish","owner":"liiiiiiu","description":"为前端开发提供的工具函数，适用于 Web 及微信小程序","archived":false,"fork":false,"pushed_at":"2024-03-27T02:18:29.000Z","size":1006,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-26T13:59:50.051Z","etag":null,"topics":["javascript","typescript","utils","weapp","web"],"latest_commit_sha":null,"homepage":"https://liiiiiiu.gitee.io/chafingdish-docs","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/liiiiiiu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2022-12-16T05:30:36.000Z","updated_at":"2023-03-31T07:52:07.000Z","dependencies_parsed_at":"2024-02-28T08:54:06.250Z","dependency_job_id":null,"html_url":"https://github.com/liiiiiiu/chafingdish","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/liiiiiiu/chafingdish","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liiiiiiu%2Fchafingdish","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liiiiiiu%2Fchafingdish/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liiiiiiu%2Fchafingdish/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liiiiiiu%2Fchafingdish/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/liiiiiiu","download_url":"https://codeload.github.com/liiiiiiu/chafingdish/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liiiiiiu%2Fchafingdish/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28914895,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-30T12:13:43.263Z","status":"ssl_error","status_checked_at":"2026-01-30T12:13:22.389Z","response_time":66,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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","typescript","utils","weapp","web"],"created_at":"2026-01-30T14:56:48.997Z","updated_at":"2026-01-30T14:56:49.785Z","avatar_url":"https://github.com/liiiiiiu.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Chafingdish\n\n为前端开发提供的工具函数，适用于 Web 及微信小程序\n\n[文档网站](https://liiiiiiu.gitee.io/chafingdish-docs) | [Github](https://github.com/liiiiiiu/chafingdish) | [Gitee](https://gitee.com/liiiiiiu/chafingdish)\n\n## 使用\n\n```bash\nnpm install chafingdish --save\n```\n\n```javascript\n// 部分输入\nimport {\n  wow_array,\n\n  // 是否为字符串\n  is_string,\n  // 是否为假值\n  is_falsy,\n  // 比较两个值是否相等\n  is_equal,\n  // 是否为邮箱\n  is_email,\n  // 输入日期是否为今天\n  is_today,\n\n  // 转换为数值\n  to_number,\n  // 首字母大写\n  to_title,\n\n  // 格式化当前时间或传入的时间\n  d_format,\n\n  // 生成随机整数\n  gen_random_integer,\n\n  // 微信小程序数据深拷贝\n  wx_clone_deep,\n  // 微信小程序解析按钮传递的 event 值\n  wx_dataset,\n  // 微信小程序路由接口\n  wx_router,\n  // 微信小程序授权接口\n  wx_authorize,\n} from 'chafingdish'\n\n// 全部输入\nimport * as utils from 'chafingdish'\n```\n\n## 关于\n\n与 lodash 等工具函数库的区别在于，lodash 提供更强大专业的工具函数，而 chafingdish 提供了在前端开发中面对各种业务所需的工具函数\n\n功能如下：\n\n1. wow_array 函数，加强了数组的能力，提供切片、批量删除、嵌套等功能；\n2. is 函数除了基础的数据类型判断，还包含了对开发中某些业务场景的判断，比如判断两个值是否相等、判断传入值是否为邮箱、判断传入年份是否为闰年等；\n3. to 函数也包含了对基础、业务数据的转换，比如将传入值转换为数值、整数、浮点数类型，首字母大写等；\n4. d  函数用于时间的处理，比如在对接时就经常需要对后端返回的时间字段进行处理；\n5. gen 函数用于生成一些值，例如 uuid、随机数等；\n6. wx 函数对部分小程序接口进行 Promise 封装（语法糖），并提供 `wx_router` 路由函数、`wx_authorize` 授权函数、`wx_refresh_data` 多页数据同步更新函数、 `ResponseView` 视图交互类等多个为微信小程序定制的工具函数；\n7. 更多功能查看[文档网站](https://liiiiiiu.gitee.io/chafingdish-docs)\n\n\u003e Chafingdish 旨在覆盖前端开发中所需的工具函数，欢迎Star、Fork、PR\n\n## 近期更新\n\n## v1.0.27\n\n1. 修复 `wx_router` 跳转 Tabbar 页面失效的问题\n\n## v1.0.25\n\n1. 修复 `wx_router` 部分问题\n\n## v1.0.24\n\n1. 优化 `ResponseView` 分页判断\n\n## v1.0.23\n\n1. 修复部分函数问题\n\n## v1.0.22\n\n1. 新增 `to_percentage` 函数，用于将传入值转换为百分比\n2. 新增 `to_thousands` 函数，用于将传入值进行千分位格式化\n\n## v1.0.21\n\n1. 新增 `d_countdown` 函数，用于将时间转换为倒计时数值（天、小时、分钟、秒）\n\n## v1.0.17\n\n1. 新增 `gen_http_content_type` 对象，在添加请求头时简化写法\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliiiiiiu%2Fchafingdish","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fliiiiiiu%2Fchafingdish","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliiiiiiu%2Fchafingdish/lists"}