{"id":16908085,"url":"https://github.com/dream2023/all-trim","last_synced_at":"2025-10-30T01:06:48.594Z","repository":{"id":34905103,"uuid":"188671763","full_name":"dream2023/all-trim","owner":"dream2023","description":"支持字符串、数组、对象、嵌套数组等等的去除空格","archived":false,"fork":false,"pushed_at":"2022-05-22T05:35:04.000Z","size":7,"stargazers_count":7,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-25T11:51:39.724Z","etag":null,"topics":["all-trim","array-trim","delete","object-trim","remove","space","string","strip","trim","whitespace"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/dream2023.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":"2019-05-26T10:59:29.000Z","updated_at":"2020-10-19T01:38:57.000Z","dependencies_parsed_at":"2022-09-01T00:52:49.819Z","dependency_job_id":null,"html_url":"https://github.com/dream2023/all-trim","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dream2023%2Fall-trim","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dream2023%2Fall-trim/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dream2023%2Fall-trim/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dream2023%2Fall-trim/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dream2023","download_url":"https://codeload.github.com/dream2023/all-trim/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248433070,"owners_count":21102498,"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":["all-trim","array-trim","delete","object-trim","remove","space","string","strip","trim","whitespace"],"created_at":"2024-10-13T18:50:07.289Z","updated_at":"2025-10-30T01:06:43.549Z","avatar_url":"https://github.com/dream2023.png","language":"JavaScript","readme":"# all-trim\n\n[![MIT Licence](https://badges.frapsoft.com/os/mit/mit.svg)](https://opensource.org/licenses/mit-license.php)\n[![npm](https://img.shields.io/npm/v/all-trim.svg)](https://www.npmjs.com/package/all-trim)\n[![size](https://img.shields.io/bundlephobia/minzip/all-trim.svg)](https://www.npmjs.com/package/all-trim)\n[![download](https://img.shields.io/npm/dw/all-trim.svg)](https://npmcharts.com/compare/all-trim?minimal=true)\n\n## 说明\n\n极少代码实现字符串、数组、对象、嵌套数组等类型的去除空格\n\n## 安装 \u0026 使用\n\n```bash\nnpm install all-trim\n```\n\n```js\nconst allTrim = require('all-trim')\n```\n\n## 示例\n\n```js\n// 字符串\nlet str = ' apple '\n\nconsole.log(allTrim(str)) // 'apple'\n```\n\n```js\n// 数组\nlet arr = [' apple ', ' orange ']\n\nconsole.log(allTrim(arr)) // ['apple', 'orange']\n```\n\n```js\n// 对象\nlet obj = {\n  name: ' zhang ',\n  age: 19,\n  hobbies: [' programming ', ' badminton ']\n}\n\nconsole.log(allTrim(obj)) // { name: 'zhang', age: 19, hobbies: ['programming', 'badminton'] }\n```\n\n```js\n// 嵌套数组\nlet arr = [\n  { city: [' 河南 ', ' 广东 '] },\n  { food: [[' 烩面 ', ' 胡辣汤 '], [' 煲仔饭 ', ' 肠粉 ']] }\n]\n\nconsole.log(allTrim(arr)) // [{ city: ['河南 ', '广东']}, {food: [['烩面', '胡辣汤'], ['煲仔饭', '肠粉']]}]\n```\n\n```js\n// 去除对象key的空格\nlet obj = { ' name ': ' zhang ' }\nconsole.log(allTrim(arr, true)) // { 'name': 'zhang' }\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdream2023%2Fall-trim","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdream2023%2Fall-trim","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdream2023%2Fall-trim/lists"}