{"name":"jsc-safe-url","version":"0.2.0","description":"Utility functions for converting to and from URLs that encode query string data into URL paths","main":"./index.js","scripts":{"test":"node --test"},"repository":{"type":"git","url":"git+https://github.com/robhogan/jsc-safe-url.git"},"keywords":["javascriptcore","metro","react-native"],"author":{"name":"Rob Hogan","email":"npm@rhogan.net"},"license":"0BSD","bugs":{"url":"https://github.com/robhogan/jsc-safe-url/issues"},"homepage":"https://github.com/robhogan/jsc-safe-url#readme","devDependencies":{"prettier":"^2.8.8"},"types":"./index.d.ts","gitHead":"9451b9022a0b62d2d931842ec1d613a8ed5464be","_id":"jsc-safe-url@0.2.0","_nodeVersion":"20.1.0","_npmVersion":"9.6.4","dist":{"integrity":"sha512-0uOKQfEjZtb6h9Lth+R0emwi7ZsqK725u7UZMIkeFOYT68f0oMToBtHaMfH0k1kvp9OYbmGM0d40BjjUX6UC3A==","shasum":"8b1351403580dccfa2203477a3a3cfdfa07550fd","tarball":"http://registry-npm.ywwl.com/jsc-safe-url/download/jsc-safe-url-0.2.0.tgz","fileCount":8,"unpackedSize":10298,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBEE9U2l8mYM9zuG3ki1VQnorLMIv71wJxBb28h0nYD9AiEAjfazMgxIbZ0st0TGwnXMR8SrL/MYUJ+9OYIWpO+VzJA="}],"size":3857,"noattachment":false,"key":"/jsc-safe-url/-/jsc-safe-url-0.2.0.tgz"},"_npmUser":{"name":"metro-bot","email":"metro-maintainers@fb.com"},"directories":{},"maintainers":[{"name":"metro-bot","email":"metro-maintainers@fb.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/jsc-safe-url_0.2.0_1684330730734_0.3318057798879206"},"_hasShrinkwrap":false,"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 `//&` (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//&foo=bar#fragment'\n```\n\n## `function toNormalUrl(urlToNormalize: string): string`\n\nAccepts an absolute or relative URL, and replaces the first unescaped `//&` 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//&foo=bar#fragment')\n// 'https://example.com/path?foo=bar#fragment'\n```\n","publish_time":1684330730902,"_cnpm_publish_time":1684330730902,"dist-tags":{"latest":"0.2.4"}}