{"id":20078034,"url":"https://github.com/cn-src/snippets-js","last_synced_at":"2026-05-29T23:01:22.759Z","repository":{"id":42730214,"uuid":"282577784","full_name":"cn-src/snippets-js","owner":"cn-src","description":"JS 代码片段","archived":false,"fork":false,"pushed_at":"2023-01-07T04:52:13.000Z","size":724,"stargazers_count":2,"open_issues_count":7,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-22T22:06:25.527Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/cn-src.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}},"created_at":"2020-07-26T04:47:15.000Z","updated_at":"2021-12-28T09:06:58.000Z","dependencies_parsed_at":"2023-02-06T12:16:48.778Z","dependency_job_id":null,"html_url":"https://github.com/cn-src/snippets-js","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/cn-src/snippets-js","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cn-src%2Fsnippets-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cn-src%2Fsnippets-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cn-src%2Fsnippets-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cn-src%2Fsnippets-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cn-src","download_url":"https://codeload.github.com/cn-src/snippets-js/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cn-src%2Fsnippets-js/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33673628,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-29T02:00:06.066Z","response_time":107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2024-11-13T15:12:30.961Z","updated_at":"2026-05-29T23:01:22.736Z","avatar_url":"https://github.com/cn-src.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"![GitHub](https://img.shields.io/github/license/cn-src/snippets-js)\n![CI](https://github.com/cn-src/snippets-js/workflows/CI/badge.svg)\n[![codecov](https://codecov.io/gh/cn-src/snippets-js/branch/master/graph/badge.svg)](https://codecov.io/gh/cn-src/snippets-js)\n\n# snippets-js\n\n\u003e - 一些 js 代码片段\n\u003e - src 为 ts 版, js 版在 lib 目录\n\u003e - 用法可参考 `__tests__` 目录里的测试样例。\n\n- assert\n  - 参数校验\n- axios-client\n  - axios 简单封装\n\n# AxiosClient\n特性\n* 支持配置项与参数分离：比如可以将 URL 和传入的参数分开，便于集中式管理 API。\n* 支持统一回调函数：比如 delete 请求时，可自定义请求前，后，异常时的处理。\n* 支持自动提取响应结果的 data。\n* 支持链式传参\n* 支持参数自动处理，比如在文件上传情况下将 js 对象转换成 FormData\n* 支持相同 key 参数多值情况，可用数组来传递多值。","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcn-src%2Fsnippets-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcn-src%2Fsnippets-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcn-src%2Fsnippets-js/lists"}