{"id":19619834,"url":"https://github.com/zhangchiqing/nnmap","last_synced_at":"2026-06-13T17:31:45.331Z","repository":{"id":143897346,"uuid":"95242748","full_name":"zhangchiqing/nnmap","owner":"zhangchiqing","description":"Map a function over nullable value","archived":false,"fork":false,"pushed_at":"2017-06-25T17:12:04.000Z","size":3,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-11-19T17:06:42.489Z","etag":null,"topics":["curry","functional-programming","map","nullable"],"latest_commit_sha":null,"homepage":"","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/zhangchiqing.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-06-23T17:42:52.000Z","updated_at":"2017-06-23T18:08:06.000Z","dependencies_parsed_at":null,"dependency_job_id":"7027383d-58f3-4689-ae33-183997523a62","html_url":"https://github.com/zhangchiqing/nnmap","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/zhangchiqing/nnmap","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhangchiqing%2Fnnmap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhangchiqing%2Fnnmap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhangchiqing%2Fnnmap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhangchiqing%2Fnnmap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zhangchiqing","download_url":"https://codeload.github.com/zhangchiqing/nnmap/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhangchiqing%2Fnnmap/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34294408,"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-06-13T02:00:06.617Z","response_time":62,"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":["curry","functional-programming","map","nullable"],"created_at":"2024-11-11T11:15:12.803Z","updated_at":"2026-06-13T17:31:45.314Z","avatar_url":"https://github.com/zhangchiqing.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# nnmap\n`nnmap` is a function that takes a function and a value, then call the function with the value only if the value is not nil (undefined or null).\n\nType signature:\n```haskell\nnnmap :: (a -\u003e b) -\u003e a? -\u003e b?\n```\n\n### Usage\n```\nnpm install --save nnmap\n```\n\n```js\nvar nnmap = require('nnmap');\n\nnnmap(function(a) {\n  return a + 2;\n}, 3);\n// \u003e 5\n\nnnmap(function(a) {\n  return a + 2;\n}, undefined);\n// \u003e undefined\n\nnnmap(function(a) {\n  return a + 2;\n}, null);\n// \u003e null\n```\n\nIt also supports currying\n\n```js\nvar nnmap = require('nnmap');\n\n[1,2,undefined, 4, 5].map(nnmap(function(a) {\n  return a + 2;\n}));\n// \u003e [3, 4, undefined, 6, 7]\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhangchiqing%2Fnnmap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzhangchiqing%2Fnnmap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhangchiqing%2Fnnmap/lists"}