{"name":"jsc-safe-url","version":"0.1.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":"372d6a25fdebef7f3ecfe9183a5d30511b6fac5d","_id":"jsc-safe-url@0.1.0","_nodeVersion":"16.17.0","_npmVersion":"8.15.0","dist":{"integrity":"sha512-gZiCpT7Y0eJLKxFh/eX4IMcehFPL6ndcalqyoNEY5NDRhsX3HnaEX9Foiq14JJ6lbChGNNrKSOa/0JNDx0eVJw==","shasum":"309122611f25c194eb3372dc027d5349f962520c","tarball":"http://registry-npm.ywwl.com/jsc-safe-url/download/jsc-safe-url-0.1.0.tgz","fileCount":8,"unpackedSize":9167,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDKmkazZBc3TfdGqj/FbalFTQR6asA+Cc1gn1Th682nIgIgRxr76eBxZc2YhuBF8qIvzlUy+xGCvTe9mn05cFh8Sx0="}],"size":3552,"noattachment":false,"key":"/jsc-safe-url/-/jsc-safe-url-0.1.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.1.0_1683902607147_0.26358304798468213"},"_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":1683902607281,"_cnpm_publish_time":1683902607281,"dist-tags":{"latest":"0.2.4"}}