{"id":16487349,"url":"https://github.com/robhogan/jsc-safe-url","last_synced_at":"2025-07-06T03:07:45.293Z","repository":{"id":164023057,"uuid":"639493697","full_name":"robhogan/jsc-safe-url","owner":"robhogan","description":null,"archived":false,"fork":false,"pushed_at":"2023-05-18T16:54:36.000Z","size":18,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-22T05:35:35.764Z","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":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/robhogan.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":"2023-05-11T15:05:34.000Z","updated_at":"2024-01-25T11:25:41.000Z","dependencies_parsed_at":"2024-06-19T01:34:37.433Z","dependency_job_id":null,"html_url":"https://github.com/robhogan/jsc-safe-url","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/robhogan/jsc-safe-url","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robhogan%2Fjsc-safe-url","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robhogan%2Fjsc-safe-url/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robhogan%2Fjsc-safe-url/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robhogan%2Fjsc-safe-url/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/robhogan","download_url":"https://codeload.github.com/robhogan/jsc-safe-url/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robhogan%2Fjsc-safe-url/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261251004,"owners_count":23130644,"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":[],"created_at":"2024-10-11T13:33:50.047Z","updated_at":"2025-07-06T03:07:45.256Z","avatar_url":"https://github.com/robhogan.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## `jsc-safe-url`\n\nJavaScriptCore santizes source URLs in error stacks by stripping query strings and fragments. Ref: [`Webkit/Webkit#49109d`](https://github.com/WebKit/WebKit/commit/49109db4ab87a715f7a8987c7ee380e63060298b).\n\nThis package contains utility functions required to implement the proposed [React Native Community RFC0646](https://github.com/react-native-community/discussions-and-proposals/pull/646). It exports three functons:\n\n## `function isJscSafeUrl(url: string): boolean`\n\nReturns `false` if the URL has a query component that could be stripped by JSC.\n\n## `function toJscSafeUrl(urlToConvert: string): string`\n\nAccepts an absolute or relative URL, and encodes any data in the input query string (if present) into the [path component](https://www.rfc-editor.org/rfc/rfc3986#section-3.3) of the URL, by using the delimiter `//\u0026` (which cannot appear in a normalized file path) to separate the original path from the orignal query string.\n\n```\ntoJscSafeUrl('https://example.com/path?foo=bar#fragment')\n// 'https://example.com/path//\u0026foo=bar#fragment'\n```\n\n## `function toNormalUrl(urlToNormalize: string): string`\n\nAccepts an absolute or relative URL, and replaces the first unescaped `//\u0026` in the [path component](https://www.rfc-editor.org/rfc/rfc3986#section-3.3) with `?`. (Effectively the reverse of `toJscSafeUrl`.)\n\n```\ntoNormalUrl('https://example.com/path//\u0026foo=bar#fragment')\n// 'https://example.com/path?foo=bar#fragment'\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobhogan%2Fjsc-safe-url","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frobhogan%2Fjsc-safe-url","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobhogan%2Fjsc-safe-url/lists"}