{"_id":"safe-join","_rev":"4-44899f15cbaaeb6bd52dbe3f90056ff7","name":"safe-join","dist-tags":{"latest":"0.1.3"},"versions":{"0.1.0":{"name":"safe-join","version":"0.1.0","main":"dist/index.js","umd:main":"dist/safe-join.umd.production.js","module":"dist/safe-join.es.production.js","typings":"dist/index.d.ts","scripts":{"start":"tsdx watch","build":"tsdx build","test":"tsdx test"},"devDependencies":{"@types/jest":"^24.0.11","tsdx":"^0.3.3","typescript":"^3.3.3333"},"description":"a tiny zero dependency library to join strings with slashes in them that isn't too smart about it:","_id":"safe-join@0.1.0","dist":{"shasum":"4d115a6902a95aa686abadd627d73e0bc4861f5b","integrity":"sha512-YyYCZOVSj7tYidOElCw7DvjNrPh804iXT5o1jMp25VWkti6FR2MFItZehmRE6/UkMXewQZb0A0wf/BMTbSnP1w==","tarball":"https://registry.npmjs.org/safe-join/-/safe-join-0.1.0.tgz","fileCount":3,"unpackedSize":1875,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcjL24CRA9TVsSAnZWagAAN5oQAJeAINEEDsakOkxlcq8g\nUe6OP5kDe/ViKXfd16vIKAH4G0f0jBXeCi+V7stZ/AsVxChwFkvocNwPXT6k\nqij1CroCxeQpGzDOyyGxRAvdz85yqEDgAKqtw8dsxftpOk7a9BiFrvHKdvBa\nrBTKLkj1CavALJwlvM5lQjk0obpoNdx24hdUCvip3NupiIX6gKTF0AjZzUwz\n8kDzmikJ0h5oIkAggHTHhp0JTe3W246O8PXPF0Y6q6Xbv0Gew8YXMAeCLmMJ\nE+7rSvCwwXZmTEdbwrxHS3hO/Y8uJFvMyB/8njUSNkBAct/EbMwNCAvePpDy\n7K5BcMnOgFVx+pNuaQpF+e2WO2oUJ+xX1ZzLl+EULU0/ZIr6TOfI5faNWNKG\nVx6OEJYmyfsCkW+Bq/FGMGed7kXePqjC7ueuKyb6sfuzdwbnw0jKnVV3Yf+y\n/sIUKOp1OAL+iD+wXXQ/K/Dnbsn7EQcvuY6nEaKynXy2Kn9r1WKcRWRJIMsX\n831YQVo7gk4ZUbvqZDEhCTzXWvO7CqsTUcqkdsTpHarR10vLsBFUp7LIw+tB\n92x9iEqOoMQAOyZZcv1IGIBILUqkiDivSP70Q5bofUFO1MaRtfYS48ybe4Mr\nvzXNbBoK3ysgV7Ssnl4u5FFwn0CLIcB4ELbiR5fDgjosYTJMLjcC6byb14hP\nki1q\r\n=PAAv\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDFBKyZiPeMCv3No0HQXvo8fNjOvLZQ60pTHg63ykqBxQIgGkQPDo5Yl4q5z1iloOyEWSIqgbPeq6z5Lv1zAw0IHQ8="}]},"maintainers":[{"name":"sw-yx","email":"swyx@swyx.io"}],"_npmUser":{"name":"sw-yx","email":"swyx@swyx.io"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/safe-join_0.1.0_1552727479567_0.728978502813302"},"_hasShrinkwrap":false},"0.1.1":{"name":"safe-join","version":"0.1.1","main":"dist/index.js","umd:main":"dist/safe-join.umd.production.js","module":"dist/safe-join.es.production.js","typings":"dist/index.d.ts","scripts":{"start":"tsdx watch","build":"tsdx build","test":"tsdx test"},"devDependencies":{"@types/jest":"^24.0.11","tsdx":"^0.3.3","typescript":"^3.3.3333"},"description":"a tiny zero dependency library to join strings with slashes in them that isn't too smart about it!","_id":"safe-join@0.1.1","dist":{"shasum":"c3433f5e793d9081287771d6753466b5eeef5765","integrity":"sha512-cwEGGLAkVAcevTGCrD4w8KlbqSsyD8mF7OGUGJEiVptUYgUkRFgmIzpKxn/anGeLVz3sW2qSNk2gH1T2it/i6w==","tarball":"https://registry.npmjs.org/safe-join/-/safe-join-0.1.1.tgz","fileCount":18,"unpackedSize":9831,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcjL45CRA9TVsSAnZWagAAUJQP/R4xSP4HJAwp6joeOtaz\nME/RkaELaHFPrteWTj0KIoVpA0WjzyB+CxfFOITpafZ4Ijn3gF71LLWej/Zs\ng25fVOIdYK3w18uumhLa5gJsXp8AIAJKxCd5W5ghxUMxSAp+LRLmLBRwnTrO\n3cpHIbe3UCc2PATrlyUP6hJ9RO/DlD1btQKtwZuFBJ177pXaFPLAVgSLvCGM\n10EGlMLJzwD1wCbNo6DPVRtXFDCA8hvwlDYlYSjgzA7FAr9QFdC2s82qaSKD\ngChDI1dgMZEIqirmT0ALDdvb1pDQ3AYA9J/oiRu8KsHBg/JjhRjCEyXNwT00\nN2LxiBNhZ4AIBB3vCN5N5EoIYJPzwoj5IhMLyK6Eds0Oil9sLExORG5SfLfp\n1VBZZg8yZvEp02uaz8VGr5EJ4nnYHVIZ3yVH5CdrhLrlGfsWy7nvXo6FEgoM\n3nK83atH3wNFh/yI8wO1VKMc75yxh0gneXLfSbjatUf6y5ZfkE6uwkRilCWe\nsSOxfSzCQv0GQ6+/N8nXsVvapoVrX03TlLTawdrb0ezZCi54ECedhSE189YT\nc/DNOwObTWyuR9dZ/70FlgF3P0vM1RmxPAnIKuwbmcpuNO14pMnlejYvQpA8\nSzmb0vQfUrwj5xf9WWMu/sk5xpyKXE/YtcHWPXyzcTdohV40xK25mHfKua4t\ntHf4\r\n=yGQj\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIB/kGQ42hSiOdJSlMoCulxjO+BzrbOPVDKRptsH2qSY+AiB1GNlecdfoqiFvA8Idf3vETzKT3cxs04wKSWzA+N8ivA=="}]},"maintainers":[{"name":"sw-yx","email":"swyx@swyx.io"}],"_npmUser":{"name":"sw-yx","email":"swyx@swyx.io"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/safe-join_0.1.1_1552727609261_0.6951433584074365"},"_hasShrinkwrap":false},"0.1.2":{"name":"safe-join","version":"0.1.2","main":"dist/index.js","umd:main":"dist/safe-join.umd.production.js","module":"dist/safe-join.es.production.js","typings":"dist/index.d.ts","scripts":{"start":"tsdx watch","build":"tsdx build","test":"tsdx test"},"devDependencies":{"@types/jest":"^24.0.11","tsdx":"^0.3.3","typescript":"^3.3.3333"},"description":"a tiny zero dependency library to join strings with slashes in them that isn't too smart about it!","_id":"safe-join@0.1.2","dist":{"shasum":"f15c9eb1400e2e1709548f3c99dec004fa716220","integrity":"sha512-8434UPfhbDPtHZuoFxmFsg1j4vwB7zznFGdf19zKi255ZtDjulfmzg0q6eFVqrtUT3yIpUf6CZrF+9PjQuiJ/g==","tarball":"https://registry.npmjs.org/safe-join/-/safe-join-0.1.2.tgz","fileCount":18,"unpackedSize":9857,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcjMQ7CRA9TVsSAnZWagAAlkoP/03yHW+jPw2mH2TKYYnz\nEwm/9HTGJfsDrM3j515VgPN8fWVpLJ0JjWXvClsQFFAy8VlszO5AYwk7C1Mq\nNcQdbt/fTAMudX2mICwSXGkBU7qTjToVzg122FUI0+GLKenbYoFTW6whPcti\nsHqyf8zYAanhwIqy2vCvDdBrvry2x8sS5hCJjwoo0e7vihE9OA73aG4C86Ki\nJ+tRwT3K/vURGdGOBLcc8eI7p29OJOwSgdC9fzAzebIC8lEEmwju5os+Jd7n\nF9EVPJdmnudVta/ZvLspFWEKd+rKeTngEv8VKxqUAEXLgAypqq4jiIwSGbLm\n3WYvUVCgx4rSNJoGvh2pzefSwnUHzcjzgsoPoNOH575AkTirr3I2fQPjJ9ib\n7AJ4pkeryzMTyHZevz83m26udp2S0QPh7nYWJB42KgeZcuCUCkw+d5e2lmLU\n5gHJ9Dl9nzsaVhaNIp7e+eigjfsBBrEsTXcYpuUn/VPStd2MXTKPq5ay7YX2\nIAlPqC8XgeBqwQwgeBWrRaFtnUe4YBa7V7B/8FWgnwyCPE0f4ggCrDJPSkt/\nLdkPlyP4vvJzFt2uN9ZaecH2nFD9na2KzD4oPfmczh6Zns0tNBb3va0mJS0d\nfYiQoN5NeVGJ5NFaRgAZaNiU8dRkMFoGl8BeX3JjwGcr3tTZMU5LGhNeXExB\nUGY+\r\n=+kZZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBdXKoLfeXXcLy3vQRTkx/IhNxmDf4gObeyUShUwHK/kAiA6cwGb6sKGH5bYkZ0C0wu8Nn7coUPtn0ouOuqmLSNCWw=="}]},"maintainers":[{"name":"sw-yx","email":"swyx@swyx.io"}],"_npmUser":{"name":"sw-yx","email":"swyx@swyx.io"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/safe-join_0.1.2_1552729146509_0.8649636176571098"},"_hasShrinkwrap":false},"0.1.3":{"name":"safe-join","version":"0.1.3","main":"dist/index.js","umd:main":"dist/safe-join.umd.production.js","module":"dist/safe-join.es.production.js","typings":"dist/index.d.ts","scripts":{"start":"tsdx watch","build":"tsdx build","test":"tsdx test"},"devDependencies":{"@types/jest":"^24.0.11","tsdx":"^0.3.3","typescript":"^3.3.3333"},"description":"a tiny zero dependency library to join strings with slashes in them that isn't too smart about it!","_id":"safe-join@0.1.3","dist":{"shasum":"02ca7a7f2fed4f9cde3f72eb6ade4423bd73d506","integrity":"sha512-Ylh1EWn4pmL57HRV/oi4Ye7ws5AxKkdGpyDdWsvZob5VLH8xnQpG8tqmHD5v4SdKlN7hyrBjYt7Jm3faeC+uJg==","tarball":"https://registry.npmjs.org/safe-join/-/safe-join-0.1.3.tgz","fileCount":18,"unpackedSize":6698,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcjUl/CRA9TVsSAnZWagAA/icP/RXrfKG1U5Dlj1KvhDHB\n4szgS+rwXPp2gJpSES5SIYnghXmAkw4lvpHmRuHtLQDooiyfVQ8gDv2oGYmB\nzb61uD2T/ErCk8WhwsCj3KdV5PuEBdVZTpig2D0po+9fIcYeKjO8EaYhS2jJ\nbwPk4jY5WZdVxXSou6mEJSNCAq8xkeMJMmbOgcLF12Z/H8qFKbhopb1B45am\nve9xPD8w5h4m7oX6WKqahBg5yTZMbIVj9LzyIpQ+zNxTw4yFzMDysc1iLSV9\nH4IABcRWEc3uzVvX9JxHKv18FFAhNhPjqBEUDW+E41dnPmLrqHuNkc5nm+Dm\nT9pwnmH9wUEIWFcbiTcEbpFeLLFz3PM1Lo5g7gf5u4a+1uD+5hW0uqXTpoyo\nlgvPGIssOBmiY9yuRWDGpuYhbPkSSUUd3MyMDAHwNAkve/OZAaXJEz7CDI3o\nRCdlsesWSXsJOzUjpJSzi6/9ktOWZ+QSMM9mF2Drx5zOVNj9fdlIqgGq/YoF\ndzUer66OyhcDJbkbK64Q2bjZiwsUw4VVuwNCeX4v3KqVdFTju+HFIP3Lb2gB\nH7rh6QxjhIbhAICHwuDTAKycgYjEgHM9SQP6WktvBejNQIDiCh3sQmVBI62E\nDqsXchluy6R+Dz9ENWSq58YFhpNoOjLC8sqrT/132LAkSt9pu9iBtWOTwKQl\nqs01\r\n=B5IP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD91FVOIAykFcy2OW5WvuSqQ0R9Uf9OrPZc/Yet/JWjMAIgbQC2ncgGi2ccMOCZqDmTTuQd++Dqe0x/zrnzge69o4I="}]},"maintainers":[{"name":"sw-yx","email":"swyx@swyx.io"}],"_npmUser":{"name":"sw-yx","email":"swyx@swyx.io"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/safe-join_0.1.3_1552763263122_0.42567545605346147"},"_hasShrinkwrap":false}},"time":{"created":"2019-03-16T09:11:19.567Z","0.1.0":"2019-03-16T09:11:19.726Z","modified":"2022-05-16T10:13:12.507Z","0.1.1":"2019-03-16T09:13:29.401Z","0.1.2":"2019-03-16T09:39:06.664Z","0.1.3":"2019-03-16T19:07:43.271Z"},"maintainers":[{"name":"sw-yx","email":"swyx@swyx.io"}],"description":"a tiny zero dependency library to join strings with slashes in them that isn't too smart about it!","readme":"# Safe Join\n\na tiny zero dependency library to join strings with slashes in them that isn't too smart about it!\n\n## Install\n\n```\nyarn add safe-join # or npm i safe-join\n```\n\n## Usage\n\n```ts\nimport { safeJoin } from 'safe-join'\nsafeJoin('foo', 'bar') // 'foo/bar'\nsafeJoin('foo/', 'bar') // 'foo/bar'\nsafeJoin('foo/', '/bar') // 'foo/bar'\nsafeJoin('foo', '/bar') // 'foo/bar'\nsafeJoin('http://foo/', '/bar') // 'http://foo/bar'\n\n// works on multiple args too\nsafeJoin('foo', '/bar/', '/baz') // 'foo/bar/baz'\n// etc\n```\n\nYou might normally use path.join for this in Node but this works in the browser, also it doesnt swallow `/`'s when you need `//`.\n\nUses typescript because why not.\n\nIt does NOT handle query strings for you e.g. `safeJoin(\"https://foo\", \"bar\", \"&search=baz\")` so be sure to handle those on your own. or use https://github.com/jfromaniello/url-join\n\n## entire source code\n\nso you know exactly what this\n\n```ts\nexport function safeJoin(...args: string[]) {\n  return args.reduce(_safeJoin)\n}\n// thanks to https://twitter.com/swyx/status/1106839872096985088\nfunction _safeJoin(a: string, b: string) {\n  return a.replace(/\\/$/, '') + '/' + b.replace(/^\\//, '')\n}\n```\n\n## alternatives\n\nhttps://github.com/jfromaniello/url-join\n\n## TSDX Bootstrap\n\nThis project was bootstrapped with [TSDX](https://github.com/jaredpalmer/tsdx).\n","readmeFilename":"README.md"}