{"id":20435936,"url":"https://github.com/d4nyll/rundef","last_synced_at":"2025-04-12T21:37:06.989Z","repository":{"id":27879987,"uuid":"115447612","full_name":"d4nyll/rundef","owner":"d4nyll","description":"Remove undefined properties from object","archived":false,"fork":false,"pushed_at":"2024-06-08T06:51:54.000Z","size":95,"stargazers_count":3,"open_issues_count":5,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-08T20:46:57.061Z","etag":null,"topics":["javascript","object","undefined"],"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/d4nyll.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,"publiccode":null,"codemeta":null}},"created_at":"2017-12-26T19:00:02.000Z","updated_at":"2023-03-10T09:27:04.000Z","dependencies_parsed_at":"2024-06-19T13:20:27.140Z","dependency_job_id":"c0a29b29-cd59-48ea-844d-d9f6db92b1b4","html_url":"https://github.com/d4nyll/rundef","commit_stats":{"total_commits":19,"total_committers":6,"mean_commits":"3.1666666666666665","dds":0.4736842105263158,"last_synced_commit":"f4c4d74b50204b69053ecfbbf7d51398074e5768"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d4nyll%2Frundef","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d4nyll%2Frundef/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d4nyll%2Frundef/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d4nyll%2Frundef/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/d4nyll","download_url":"https://codeload.github.com/d4nyll/rundef/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248637772,"owners_count":21137537,"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","object","undefined"],"created_at":"2024-11-15T08:38:33.129Z","updated_at":"2025-04-12T21:37:06.967Z","avatar_url":"https://github.com/d4nyll.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rundef\n\nRemove `undefined` properties from object.\n\n[![Build Status](https://travis-ci.org/d4nyll/rundef.svg?branch=master)](https://travis-ci.org/d4nyll/rundef) [![codecov](https://codecov.io/gh/d4nyll/rundef/branch/master/graph/badge.svg)](https://codecov.io/gh/d4nyll/rundef) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/5d03700550e441c59d343b1af0a8e783)](https://www.codacy.com/app/d4nyll/rundef?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=d4nyll/rundef\u0026amp;utm_campaign=Badge_Grade) [![CodeFactor](https://www.codefactor.io/repository/github/d4nyll/rundef/badge)](https://www.codefactor.io/repository/github/d4nyll/rundef) [![Test Coverage](https://api.codeclimate.com/v1/badges/104604b0609a8722f8b6/test_coverage)](https://codeclimate.com/github/d4nyll/rundef/test_coverage) [![Maintainability](https://api.codeclimate.com/v1/badges/104604b0609a8722f8b6/maintainability)](https://codeclimate.com/github/d4nyll/rundef/maintainability) [![NSP Status](https://nodesecurity.io/orgs/d4nyll/projects/d5c67ec9-8c1b-4aef-8971-fe60572adc08/badge)](https://nodesecurity.io/orgs/d4nyll/projects/d5c67ec9-8c1b-4aef-8971-fe60572adc08) [![Known Vulnerabilities](https://snyk.io/test/github/d4nyll/rundef/badge.svg)](https://snyk.io/test/github/d4nyll/rundef) [![Greenkeeper badge](https://badges.greenkeeper.io/d4nyll/rundef.svg)](https://greenkeeper.io/) \n[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fd4nyll%2Frundef.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2Fd4nyll%2Frundef?ref=badge_shield)\n\n**N.B.** Does not remove `null` or falsy values, just `undefined`.\n\n## Install\n\n[![NPM](https://nodei.co/npm/rundef.png?compact=true)](https://nodei.co/npm/rundef/)\n\n```\n$ npm install rundef\n$ yarn add rundef\n```\n\n## Usage\n\n```\nconst rundef = require('rundef');\nimport rundef from 'rundef';\n```\n\n_For the most accurate examples, see the `test.js` file_\n\n### Basic\n\n```\nconst input = {\n  a: undefined,\n  b: 1\n}\n\nrundef(input); // { b: 1 }\n```\n\n### Advanced\n\n`rundef` supports two options:\n\n* `mutate` _boolean_ - if truthy, the original object will be mutated; if falsy, a new object will be constructed and returned. Defaults to `false`\n* `recursive` _boolean | int_ - whether `rundef` should recursively process nested objects. If it's an integer, it will specify the number of nested layers, or levels, to process. If it is set to `true`, it will recursively process all layers. Defaults to `0`, which is equivalent to `false`.\n\n```\nconst input = {\n  a: undefined,     // Level 0\n  b: {\n    c: 1,\n    d: undefined,   // Level 1\n    e: {\n      f: undefined  // Level 2\n    }\n  }\n}\n\nconst output = rundef(\n  input,\n  false, // mutate - whether to mutate the original object or return a new one\n  1,     // recursive - whether to apply recursively\n);\n\noutput;\n\n{                   // Level 0\n  b: {\n    c: 1,           // Level 1\n    e: {\n      f: undefined  // Level 2 - Not removed as level 1 was specified\n    }\n  }\n}\n\n```\n\n\n## License\n[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fd4nyll%2Frundef.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Fd4nyll%2Frundef?ref=badge_large)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fd4nyll%2Frundef","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fd4nyll%2Frundef","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fd4nyll%2Frundef/lists"}