{"name":"jsc-safe-url","version":"0.2.1","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":{"flow-bin":"^0.206.0","prettier":"^2.8.8"},"types":"./index.d.ts","gitHead":"ebc6c302fba093a45615ef47110ea3a73bebb374","_id":"jsc-safe-url@0.2.1","_nodeVersion":"20.1.0","_npmVersion":"9.6.4","dist":{"integrity":"sha512-sET0zUOUalDdQPpDQKNEXiyIV8Xlfm/e3V/ySdj22da/bzN6YQuowo/vls5KgKlrMsVh5skWZ8D1vWF0LpxIXg==","shasum":"b5cfe9b86e40ef3ad2ca16300fb9430ca38bb230","tarball":"http://registry-npm.ywwl.com/jsc-safe-url/download/jsc-safe-url-0.2.1.tgz","fileCount":5,"unpackedSize":6044,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCG9R6ReVgKzoOh79STUuhGOXVAOqRGWt6V1ahpu9b+9QIhAI9L2E7F2MT+H00zrTaNak7lmu0lZbmKkLVxu9j73G51"}],"size":2771,"noattachment":false,"key":"/jsc-safe-url/-/jsc-safe-url-0.2.1.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.1_1684422733603_0.6654855087199576"},"_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":1684422733770,"_cnpm_publish_time":1684422733770,"dist-tags":{"latest":"0.2.4"}}