{"id":13447741,"url":"https://github.com/ben-ng/sourcemap-validator","last_synced_at":"2025-08-26T23:38:32.561Z","repository":{"id":11826236,"uuid":"14379896","full_name":"ben-ng/sourcemap-validator","owner":"ben-ng","description":"Map all the things, validate all the maps","archived":false,"fork":false,"pushed_at":"2024-04-22T19:07:45.000Z","size":309,"stargazers_count":40,"open_issues_count":7,"forks_count":20,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-08-14T01:26:58.640Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ben-ng.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2013-11-13T23:44:25.000Z","updated_at":"2024-10-18T06:21:18.000Z","dependencies_parsed_at":"2024-06-18T13:53:23.808Z","dependency_job_id":null,"html_url":"https://github.com/ben-ng/sourcemap-validator","commit_stats":{"total_commits":47,"total_committers":10,"mean_commits":4.7,"dds":0.5531914893617021,"last_synced_commit":"c753c81986cd70e1df58801fc83386eedff0379d"},"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"purl":"pkg:github/ben-ng/sourcemap-validator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ben-ng%2Fsourcemap-validator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ben-ng%2Fsourcemap-validator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ben-ng%2Fsourcemap-validator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ben-ng%2Fsourcemap-validator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ben-ng","download_url":"https://codeload.github.com/ben-ng/sourcemap-validator/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ben-ng%2Fsourcemap-validator/sbom","scorecard":{"id":231279,"data":{"date":"2025-08-11","repo":{"name":"github.com/ben-ng/sourcemap-validator","commit":"c753c81986cd70e1df58801fc83386eedff0379d"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.5,"checks":[{"name":"Code-Review","score":4,"reason":"Found 7/16 approved changesets -- score normalized to 4","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":5,"reason":"5 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-hxm2-r34f-qmc5","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-c9f4-xj24-8jqx","Warn: Project is vulnerable to: GHSA-wxfj-84xf-7gxv"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 22 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-17T04:54:50.489Z","repository_id":11826236,"created_at":"2025-08-17T04:54:50.489Z","updated_at":"2025-08-17T04:54:50.489Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272267825,"owners_count":24903785,"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","status":"online","status_checked_at":"2025-08-26T02:00:07.904Z","response_time":60,"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-07-31T05:01:25.722Z","updated_at":"2025-08-26T23:38:32.531Z","avatar_url":"https://github.com/ben-ng.png","language":"JavaScript","readme":"sourcemap-validator\n===================\n\n[![Build Status](https://travis-ci.org/ben-ng/sourcemap-validator.png)](https://travis-ci.org/ben-ng/sourcemap-validator)\n\nMapped all the things? Now validate all the maps.\n\n## Usage\n\n```js\nvalidate(minifiedCode, [sourceMap], [sourceContent]);\n```\n\n * `minifiedCode` is your minified code as a string\n * `sourceMap` is your sourcemap as a JSON string\n    * Optional - If left empty, the inline sourcemap in `minifiedCode` will be used\n * `sourceContent` is a map to the raw source files\n    * Optional - If left empty, the inline `sourceContent` in `sourceMap` will be used\n\n## Examples\n\n```js\nvar validate = require('sourcemap-validator')\n  , fs = require('fs')\n  , assert = require('assert')\n  , min = fs.readFileSync('jquery.min.js', 'utf-8')\n  , map = fs.readFileSync('jquery.min.map', 'utf-8');\n\nassert.doesNotThrow(function () {\n  validate(min, map, {'jquery.js': raw});\n}, 'The sourcemap is not valid');\n```\n\n```js\nvar validate = require('sourcemap-validator')\n  , fs = require('fs')\n  , assert = require('assert')\n  , min = fs.readFileSync('bundle.min.js', 'utf-8')\n  , map = fs.readFileSync('bundle.min.map', 'utf-8');\n\n// Browserify bundles have inline sourceContent in their maps\n// so no need to pass a `sourceContent` object.\nassert.doesNotThrow(function () {\n  validate(min, map);\n}, 'The sourcemap is not valid');\n```\n\n### validate(sourceContent, minifiedCode, mapJSON)\n\n## Notes\n\nThe sourcemap spec isn't exactly very mature, so this module only aims to give you a Pretty Good™ idea of whether or not your sourcemap is correct.\n\n### Quoted keys in object literals\n\nIf a sourcemap maps \"literal\" without the quotes to column 3, we will consider that valid.\n\n**Example**\n```js\nvar v = {\n  literal: true\n//^-- ok to map {name: literal, column: 3} here\n};\n\nvar t = {\n  \"literal\": true\n//^-- ok to map {name: literal, column: 3} here, even though the token actually appears in column 4\n};\n```\n\nSee the discussion [here](https://github.com/mishoo/UglifyJS2/pull/303#issuecomment-27628362)\n\nHowever, mapping something totally wrong like `\"cookie\"` to that index will throw an exception.\n\n### Missing mappings\n\nThere is no way for the validator to know if you are missing mappings. It can only ensure that the ones you made are sensible. The validator will consider a sourcemap with zero mappings invalid as a sanity check, but if your map at least one sensisble mapping, it is a valid map.\n\n## License\nThe MIT License (MIT)\n\nCopyright (c) 2013 Ben Ng\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fben-ng%2Fsourcemap-validator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fben-ng%2Fsourcemap-validator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fben-ng%2Fsourcemap-validator/lists"}