{"name":"jsc-safe-url","version":"0.2.3","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":"3d88654b80d3f48b96c1b1757b0c79d4dd5d2d54","_id":"jsc-safe-url@0.2.3","_nodeVersion":"20.1.0","_npmVersion":"9.6.4","dist":{"integrity":"sha512-85sVnu5sQyfFH99sa1Hw6LzwT9bvbgH4EYsHZM0lzc2eyq1Ia8IsJLVxL4G/NLhbjolub+zlZdigZkABh48alA==","shasum":"791351512911c9ab035d26b9251486324f8f1a28","tarball":"http://registry-npm.ywwl.com/jsc-safe-url/download/jsc-safe-url-0.2.3.tgz","fileCount":5,"unpackedSize":6043,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHAzE+N1Gi7sk2HOD3vxWEEUfP8QHpAO+iBh/kCW6uubAiEA1odYO+47FCy/XCEXnAqGxjpGuw3QIUFfBV5v14Y+/lY="}],"size":2769,"noattachment":false,"key":"/jsc-safe-url/-/jsc-safe-url-0.2.3.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.3_1684428798133_0.602669924981009"},"_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":1684428798318,"_cnpm_publish_time":1684428798318,"dist-tags":{"latest":"0.2.4"}}