{"name":"@nuxt/ufo","version":"0.5.4","description":"URL utils for humans","repository":{"type":"git","url":"git+https://github.com/nuxt-contrib/ufo.git"},"license":"MIT","sideEffects":false,"exports":{".":{"import":"./dist/index.mjs","require":"./dist/index.js"},"./":"./"},"main":"dist/index.js","module":"dist/index.mjs","types":"dist/index.d.ts","scripts":{"build":"siroc build","lint":"eslint --ext .ts .","release":"yarn test && yarn build && standard-version && git push --follow-tags && npm publish","test":"yarn lint && jest"},"dependencies":{},"devDependencies":{"@nuxtjs/eslint-config-typescript":"latest","@types/flat":"latest","@types/jest":"latest","@types/node":"latest","eslint":"latest","jest":"latest","siroc":"latest","standard-version":"latest","ts-jest":"latest","typescript":"latest"},"gitHead":"5c6b320efd7b843dcc82543dd164548462d976bf","bugs":{"url":"https://github.com/nuxt-contrib/ufo/issues"},"homepage":"https://github.com/nuxt-contrib/ufo#readme","_id":"@nuxt/ufo@0.5.4","_nodeVersion":"14.15.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-JZOGDlt2BvLCBmLhrchhRJ6tP9PBfSWLdsHC+JVJ5Qp8/hT/2u61cSsLS30zUOwcPRaQ3y2oHNkEiKJ5v90iEQ==","shasum":"2e1428e2c947cc559d566c27786525bf0f40fbc8","tarball":"http://registry-npm.ywwl.com/@nuxt/ufo/download/@nuxt/ufo-0.5.4.tgz","fileCount":7,"unpackedSize":36977,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf9wiHCRA9TVsSAnZWagAAorwP/1nR2fBzp1BLi1sPPBfE\nB5lYw5z7a3sNjE2NjiZdLUaXGovgm40AHkTpwdZJiTQPkUoJTAvfwWVVqMnt\nAerVmHJ/IKog2GcR/9bSdV9tec7MMHGP9J0skPafJNTkq9aPPlSWAd4PWAMf\n7Nz0A+3A/vGKaBbADR+zMVKzmCJxrHoPBfQ0i6nF45YraSKwdxadehxX+Xxx\nZhrPxeR973S0enEPQ2oe06rgiQFcTMQ5YqdoznV/nlD/pC9TnlBkCCoLBaCt\n/yzdlRCcOgS6OkuGnjZLDQtyQkMVRlnyhLKbGc//Ynz0iPv7r2NrBxTgBx/B\nM8X8wKsF/eZoSqyoHzVZVsOi2ZrwrN/DdTkIsHdMmUzEwAxG77r3gIE9OEFz\neq11f/cIQOQ6kb06lEPHX9Se1FQNPgTAM+Rm9doGDEvWS1RR6ngb4pfFek6v\nXevXttmIHAuKtjK+V1K8alE3Nq+HX7dDdax6PvghkhZzZfOVV4ApEqDqjHqx\ng/OcIrUJQl0NAkpbabbCCwsWCXcPJD6q0y0Cya9S3hZgR9RFa1HY7m7zXIta\nAJYDthUZqnbabe6iEtaGE52jKbE3qhggEIP8HBZqhCAeyHPNqxjmMnGNliFY\nfl7HZDPLMJKyYgHMD8MA5mx3yraiwt0O5PEh3ILNsO6Qp7XTHThlG+bcpLHq\nV7we\r\n=HQ5Y\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAISXsvhtpKYgTQgkK8gDimXS6e/4nyQHRehBtowOZoJAiEAzFT/ljOEfjo4vE0w8i1Wpc5WdiHaPpPnzCdwhcsitmw="}],"size":8642,"noattachment":false,"key":"/@nuxt/ufo/-/@nuxt/ufo-0.5.4.tgz"},"_npmUser":{"name":"pi0","email":"pyapar@gmail.com"},"directories":{},"maintainers":[{"name":"atinux","email":"atinux@gmail.com"},{"name":"pi0","email":"pyapar@gmail.com"},{"name":"clarkdo","email":"clark.duxin@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ufo_0.5.4_1610025094794_0.6218605668666706"},"_hasShrinkwrap":false,"deprecated":"please migrate to ufo npm package","readme":"[![npm version][npm-version-src]][npm-version-href]\n[![npm downloads][npm-downloads-src]][npm-downloads-href]\n[![Github Actions][github-actions-src]][github-actions-href]\n[![Codecov][codecov-src]][codecov-href]\n[![bundle][bundle-src]][bundle-href]\n\n![👽 ufo](.github/banner.svg)\n\n## Install\n\nInstall using npm or yarn:\n\n```bash\nnpm i ufo\n# or\nyarn add ufo\n```\n\nImport:\n\n```js\n// CommonJS\nconst { normalizeURL, joinURL } = require('ufo')\n\n// ESM\nimport { normalizeURL, joinURL } from 'ufo'\n```\n\n**Notice:** You may need to transpile package and add URL polyfill for legacy environments\n\n## Usage\n\n### `normalizeURL`\n\n- Ensures URL is properly encoded\n- Ensures pathname starts with slash\n- Preserves protocol/host if provided\n\n```ts\n\n// Result: test?query=123%20123#hash,%20test\nnormalizeURL('test?query=123 123#hash, test')\n\n// Result: http://localhost:3000/\nnormalizeURL('http://localhost:3000')\n```\n\n### `joinURL`\n\n```ts\n// Result: a/b/c\njoinURL('a', '/b', '/c')\n```\n\n### `resolveURL`\n\n```ts\n// Result: http://foo.com/foo/bar/baz?test=123#token\njoinURL('http://foo.com/foo?test=123#token', 'bar', 'baz')\n```\n\n### `withQuery`\n\n```ts\n// Result: /foo?page=a&token=secret\nwithQuery('/foo?page=a', { token: 'secret' })\n```\n\n### `getQuery`\n\n```ts\n// Result: { test: '123', unicode: '好' }\ngetQuery('http://foo.com/foo?test=123&unicode=%E5%A5%BD')\n```\n\n### `$URL`\n\nImplementing URL interface with some improvements:\n\n- Supporting schemeless and hostless URLs\n- Supporting relative URLs\n- Preserving trailing-slash status\n- Decoded and mutable classs properties (`protocol`, `host`, `auth`, `pathname`, `query`, `hash`)\n- Consistent URL parser independent of environment\n- Consistent encoding independent of environment\n- Punycode support for host encoding\n\n### `withTrailingSlash`\n\nEnsures url ends with a trailing slash\n\n```ts\n// Result: /foo/\nwithTrailingSlash('/foo')\n```\n\n### `withoutTrailingSlash`\n\nEnsures url does not ends with a trailing slash\n\n```ts\n// Result: /foo\nwithoutTrailingSlash('/foo/')\n```\n\n### `cleanDoubleSlashes`\n\nEnsures url does not have double slash (except for protocol)\n\n```ts\n// Result: /foo/bar/\ncleanDoubleSlashes('//foo//bar//')\n// Result: http://example.com/analyze/http://localhost:3000/\ncleanDoubleSlashes('http://example.com/analyze//http://localhost:3000//')\n```\n\n## License\n\n[MIT](./LICENSE)\n\nSpecial thanks to Eduardo San Martin Morote ([posva](https://github.com/posva)) for [encoding utlities](https://github.com/vuejs/vue-router-next/blob/v4.0.1/src/encoding.ts)\n\n<!-- Badges -->\n[npm-version-src]: https://img.shields.io/npm/v/ufo?style=flat-square\n[npm-version-href]: https://npmjs.com/package/ufo\n\n[npm-downloads-src]: https://img.shields.io/npm/dm/ufo?style=flat-square\n[npm-downloads-href]: https://npmjs.com/package/ufo\n\n[github-actions-src]: https://img.shields.io/github/workflow/status/nuxt-contrib/ufo/ci/main?style=flat-square\n[github-actions-href]: https://github.com/nuxt-contrib/ufo/actions?query=workflow%3Aci\n\n[codecov-src]: https://img.shields.io/codecov/c/gh/nuxt-contrib/ufo/main?style=flat-square\n[codecov-href]: https://codecov.io/gh/nuxt-contrib/ufo\n\n[bundle-src]: https://img.shields.io/bundlephobia/minzip/ufo?style=flat-square\n[bundle-href]: https://bundlephobia.com/result?p=ufo\n","publish_time":1610025094927,"_cnpm_publish_time":1610025094927,"dist-tags":{"latest":"0.5.4"}}