{"id":15022487,"url":"https://github.com/mdornseif/json-schema-empty-strings","last_synced_at":"2025-10-30T03:50:39.291Z","repository":{"id":45014475,"uuid":"438273285","full_name":"mdornseif/json-schema-empty-strings","owner":"mdornseif","description":"Generate empty strings for all JSON-Schema string fields.","archived":false,"fork":false,"pushed_at":"2024-08-01T14:32:53.000Z","size":1605,"stargazers_count":2,"open_issues_count":5,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-01T11:53:26.450Z","etag":null,"topics":["json","json-schema","schema"],"latest_commit_sha":null,"homepage":"https://mdornseif.github.io/json-schema-empty-strings/","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/mdornseif.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2021-12-14T13:58:04.000Z","updated_at":"2024-05-21T22:20:16.000Z","dependencies_parsed_at":"2024-06-21T20:19:51.634Z","dependency_job_id":"6cc6ec14-b264-4bde-9790-efcfb5f3e27f","html_url":"https://github.com/mdornseif/json-schema-empty-strings","commit_stats":{"total_commits":33,"total_committers":4,"mean_commits":8.25,"dds":"0.24242424242424243","last_synced_commit":"2664a1575f02e0036756af1161423a087a5008bb"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/mdornseif/json-schema-empty-strings","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdornseif%2Fjson-schema-empty-strings","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdornseif%2Fjson-schema-empty-strings/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdornseif%2Fjson-schema-empty-strings/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdornseif%2Fjson-schema-empty-strings/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mdornseif","download_url":"https://codeload.github.com/mdornseif/json-schema-empty-strings/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdornseif%2Fjson-schema-empty-strings/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262048683,"owners_count":23250609,"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":["json","json-schema","schema"],"created_at":"2024-09-24T19:58:01.207Z","updated_at":"2025-10-30T03:50:34.259Z","avatar_url":"https://github.com/mdornseif.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"![NPM License](https://img.shields.io/npm/l/json-schema-empty-strings)\n[![NPM Version](https://img.shields.io/npm/v/json-schema-empty-strings)](https://www.npmjs.com/package/json-schema-empty-strings)\n[![NPM Types](https://img.shields.io/npm/types/json-schema-empty-strings)](https://www.npmjs.com/package/json-schema-empty-strings)\n[![Last Commit](https://img.shields.io/github/last-commit/mdornseif/json-schema-empty-strings)](https://github.com/mdornseif/json-schema-empty-strings)\n\n# json-schema-empty-strings\n\nGenerate empty strings for all [JSON-Schema](https://json-schema.org) string fields.\n\nThere are four different ways in Javsscript / Typescript to represent \"no text\":\n\n- `\"\"`\n- `null`\n- `undefined`\n- absence of the corresponding property\n\nIn the context of JSON-Schema absence of the corresponding property is widely used to represent absence of strings. Sometimes you might not want that.\n\nFor a given schema `jsonEmptyStrings()` generates an object containing empty strings for all properties of `type: string`.\n\nThe output can easily [merged](https://www.npmjs.com/package/lodash.merge) with your existing data to get empty strings instead of missing properties.\n\n```js\nimport { jsonEmptyStrings } from 'json-schema-empty-strings'\nimport merge from 'lodash.merge'\n\nconst finalData = merge({}, jsonEmptyStrings(schema), inputData)\n```\n\nIy you have `null` or `undefined` values in your data [deep-clean](https://www.npmjs.com/package/clean-deep) them before merging:\n\n```js\nimport { jsonEmptyStrings } from 'json-schema-empty-strings'\nimport merge from 'lodash.merge'\nimport cleanDeep from 'clean-deep'\n\nconst finalData = merge({}, jsonEmptyStrings(schema), cleanDeep(inputData, {\n    emptyArrays: false,\n    emptyObjects: false,\n    emptyStrings: false,\n  })\n```\n\n# See also:\n\n- [json-schema-empty](https://www.npmjs.com/package/json-schema-empty)\n- [json-schema-default](https://www.npmjs.com/package/json-schema-default)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmdornseif%2Fjson-schema-empty-strings","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmdornseif%2Fjson-schema-empty-strings","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmdornseif%2Fjson-schema-empty-strings/lists"}