{"_id":"jsc-safe-url","_rev":"3568230","name":"jsc-safe-url","description":"Utility functions for converting to and from URLs that encode query string data into URL paths","dist-tags":{"latest":"0.2.4"},"maintainers":[{"name":"metro-bot","email":"rafeca@fb.com"}],"time":{"modified":"2024-09-30T01:23:50.000Z","created":"2023-05-12T11:03:59.884Z","0.2.4":"2023-05-18T16:54:57.380Z","0.2.3":"2023-05-18T16:53:18.318Z","0.2.2":"2023-05-18T15:36:33.773Z","0.2.1":"2023-05-18T15:12:13.770Z","0.2.0":"2023-05-17T13:38:50.902Z","0.1.0":"2023-05-12T14:43:27.281Z","0.0.1":"2023-05-12T11:03:59.884Z"},"users":{},"author":{"name":"Rob Hogan","email":"npm@rhogan.net"},"repository":{"type":"git","url":"git+https://github.com/robhogan/jsc-safe-url.git"},"versions":{"0.2.4":{"name":"jsc-safe-url","version":"0.2.4","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":"9b00f6543466325f0663db0e34cd81a0c812e839","_id":"jsc-safe-url@0.2.4","_nodeVersion":"20.1.0","_npmVersion":"9.6.4","dist":{"shasum":"141c14fbb43791e88d5dc64e85a374575a83477a","size":2771,"noattachment":false,"key":"/jsc-safe-url/-/jsc-safe-url-0.2.4.tgz","tarball":"http://registry.cnpm.dingdandao.com/jsc-safe-url/download/jsc-safe-url-0.2.4.tgz"},"_npmUser":{"name":"metro-bot","email":"metro-maintainers@fb.com"},"directories":{},"maintainers":[{"name":"metro-bot","email":"rafeca@fb.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/jsc-safe-url_0.2.4_1684428897127_0.43860819485507085"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-05-18T16:54:57.380Z","publish_time":1684428897380,"_source_registry_name":"default","_cnpm_publish_time":1684428897380},"0.2.3":{"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":{"shasum":"791351512911c9ab035d26b9251486324f8f1a28","size":2769,"noattachment":false,"key":"/jsc-safe-url/-/jsc-safe-url-0.2.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/jsc-safe-url/download/jsc-safe-url-0.2.3.tgz"},"_npmUser":{"name":"metro-bot","email":"metro-maintainers@fb.com"},"directories":{},"maintainers":[{"name":"metro-bot","email":"rafeca@fb.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/jsc-safe-url_0.2.3_1684428798133_0.602669924981009"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-05-18T16:53:18.318Z","publish_time":1684428798318,"_source_registry_name":"default","_cnpm_publish_time":1684428798318},"0.2.2":{"name":"jsc-safe-url","version":"0.2.2","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":"c4a7508ab600ef86ea70dc86af516adeb912bacc","_id":"jsc-safe-url@0.2.2","_nodeVersion":"20.1.0","_npmVersion":"9.6.4","dist":{"shasum":"9ce79116d6271fce4b3d1b59b879e66b82457be1","size":2772,"noattachment":false,"key":"/jsc-safe-url/-/jsc-safe-url-0.2.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/jsc-safe-url/download/jsc-safe-url-0.2.2.tgz"},"_npmUser":{"name":"metro-bot","email":"metro-maintainers@fb.com"},"directories":{},"maintainers":[{"name":"metro-bot","email":"rafeca@fb.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/jsc-safe-url_0.2.2_1684424193562_0.44191790597511993"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-05-18T15:36:33.773Z","publish_time":1684424193773,"_source_registry_name":"default","_cnpm_publish_time":1684424193773},"0.2.1":{"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":{"shasum":"b5cfe9b86e40ef3ad2ca16300fb9430ca38bb230","size":2771,"noattachment":false,"key":"/jsc-safe-url/-/jsc-safe-url-0.2.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/jsc-safe-url/download/jsc-safe-url-0.2.1.tgz"},"_npmUser":{"name":"metro-bot","email":"metro-maintainers@fb.com"},"directories":{},"maintainers":[{"name":"metro-bot","email":"rafeca@fb.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/jsc-safe-url_0.2.1_1684422733603_0.6654855087199576"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-05-18T15:12:13.770Z","publish_time":1684422733770,"_source_registry_name":"default","_cnpm_publish_time":1684422733770},"0.2.0":{"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":{"shasum":"8b1351403580dccfa2203477a3a3cfdfa07550fd","size":3857,"noattachment":false,"key":"/jsc-safe-url/-/jsc-safe-url-0.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/jsc-safe-url/download/jsc-safe-url-0.2.0.tgz"},"_npmUser":{"name":"metro-bot","email":"metro-maintainers@fb.com"},"directories":{},"maintainers":[{"name":"metro-bot","email":"rafeca@fb.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/jsc-safe-url_0.2.0_1684330730734_0.3318057798879206"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-05-17T13:38:50.902Z","publish_time":1684330730902,"_source_registry_name":"default","_cnpm_publish_time":1684330730902},"0.1.0":{"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":{"shasum":"309122611f25c194eb3372dc027d5349f962520c","size":3552,"noattachment":false,"key":"/jsc-safe-url/-/jsc-safe-url-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/jsc-safe-url/download/jsc-safe-url-0.1.0.tgz"},"_npmUser":{"name":"metro-bot","email":"metro-maintainers@fb.com"},"directories":{},"maintainers":[{"name":"metro-bot","email":"rafeca@fb.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/jsc-safe-url_0.1.0_1683902607147_0.26358304798468213"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-05-12T14:43:27.281Z","publish_time":1683902607281,"_source_registry_name":"default","_cnpm_publish_time":1683902607281},"0.0.1":{"name":"jsc-safe-url","version":"0.0.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":{"prettier":"^2.8.8"},"gitHead":"82da633b78b75a8406906d30e684aca610b75ba7","_id":"jsc-safe-url@0.0.1","_nodeVersion":"16.17.0","_npmVersion":"8.15.0","dist":{"shasum":"462b7148fe045edc2227daff365f1b84861ba591","size":3516,"noattachment":false,"key":"/jsc-safe-url/-/jsc-safe-url-0.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/jsc-safe-url/download/jsc-safe-url-0.0.1.tgz"},"_npmUser":{"name":"metro-bot","email":"metro-maintainers@fb.com"},"directories":{},"maintainers":[{"name":"metro-bot","email":"rafeca@fb.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/jsc-safe-url_0.0.1_1683889439697_0.1016311814067572"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-05-12T11:03:59.884Z","publish_time":1683889439884,"_source_registry_name":"default","_cnpm_publish_time":1683889439884}},"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","_attachments":{},"homepage":"https://github.com/robhogan/jsc-safe-url#readme","bugs":{"url":"https://github.com/robhogan/jsc-safe-url/issues"},"license":"0BSD"}