[
  {
    "path": ".editorconfig",
    "content": "root = true\n\n[*]\nindent_style = tab\nend_of_line = lf\ncharset = utf-8\ntrim_trailing_whitespace = true\ninsert_final_newline = true\n\n[*.yml]\nindent_style = space\nindent_size = 2\n"
  },
  {
    "path": ".gitattributes",
    "content": "* text=auto eol=lf\n"
  },
  {
    "path": ".github/funding.yml",
    "content": "github: sindresorhus\nopen_collective: sindresorhus\ntidelift: npm/slash\ncustom: https://sindresorhus.com/donate\n"
  },
  {
    "path": ".github/security.md",
    "content": "# Security Policy\n\nTo report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure.\n"
  },
  {
    "path": ".github/workflows/main.yml",
    "content": "name: CI\non:\n  - push\n  - pull_request\njobs:\n  test:\n    name: Node.js ${{ matrix.node-version }}\n    runs-on: ubuntu-latest\n    strategy:\n      fail-fast: false\n      matrix:\n        node-version:\n          - 18\n          - 16\n          - 14\n    steps:\n      - uses: actions/checkout@v3\n      - uses: actions/setup-node@v3\n        with:\n          node-version: ${{ matrix.node-version }}\n      - run: npm install\n      - run: npm test\n"
  },
  {
    "path": ".gitignore",
    "content": "node_modules\nyarn.lock\n"
  },
  {
    "path": ".npmrc",
    "content": "package-lock=false\n"
  },
  {
    "path": "index.d.ts",
    "content": "/**\nConvert Windows backslash paths to slash paths: `foo\\\\bar` ➔ `foo/bar`.\n\n[Forward-slash paths can be used in Windows](http://superuser.com/a/176395/6877) as long as they're not extended-length paths.\n\n@param path - A Windows backslash path.\n@returns A path with forward slashes.\n\n@example\n```\nimport path from 'node:path';\nimport slash from 'slash';\n\nconst string = path.join('foo', 'bar');\n// Unix    => foo/bar\n// Windows => foo\\\\bar\n\nslash(string);\n// Unix    => foo/bar\n// Windows => foo/bar\n```\n*/\nexport default function slash(path: string): string;\n"
  },
  {
    "path": "index.js",
    "content": "export default function slash(path) {\n\tconst isExtendedLengthPath = path.startsWith('\\\\\\\\?\\\\');\n\n\tif (isExtendedLengthPath) {\n\t\treturn path;\n\t}\n\n\treturn path.replace(/\\\\/g, '/');\n}\n"
  },
  {
    "path": "index.test-d.ts",
    "content": "import {expectType} from 'tsd';\nimport slash from './index.js';\n\nexpectType<string>(slash('foo\\\\bar'));\n"
  },
  {
    "path": "license",
    "content": "MIT License\n\nCopyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n"
  },
  {
    "path": "package.json",
    "content": "{\n\t\"name\": \"slash\",\n\t\"version\": \"5.1.0\",\n\t\"description\": \"Convert Windows backslash paths to slash paths\",\n\t\"license\": \"MIT\",\n\t\"repository\": \"sindresorhus/slash\",\n\t\"funding\": \"https://github.com/sponsors/sindresorhus\",\n\t\"author\": {\n\t\t\"name\": \"Sindre Sorhus\",\n\t\t\"email\": \"sindresorhus@gmail.com\",\n\t\t\"url\": \"https://sindresorhus.com\"\n\t},\n\t\"type\": \"module\",\n\t\"exports\": \"./index.js\",\n\t\"types\": \"./index.d.ts\",\n\t\"engines\": {\n\t\t\"node\": \">=14.16\"\n\t},\n\t\"scripts\": {\n\t\t\"test\": \"xo && ava && tsd\"\n\t},\n\t\"files\": [\n\t\t\"index.js\",\n\t\t\"index.d.ts\"\n\t],\n\t\"keywords\": [\n\t\t\"path\",\n\t\t\"seperator\",\n\t\t\"slash\",\n\t\t\"backslash\",\n\t\t\"windows\",\n\t\t\"convert\"\n\t],\n\t\"devDependencies\": {\n\t\t\"ava\": \"^5.2.0\",\n\t\t\"tsd\": \"^0.28.1\",\n\t\t\"xo\": \"^0.54.2\"\n\t}\n}\n"
  },
  {
    "path": "readme.md",
    "content": "# slash\n\n> Convert Windows backslash paths to slash paths: `foo\\\\bar` ➔ `foo/bar`\n\n[Forward-slash paths can be used in Windows](http://superuser.com/a/176395/6877) as long as they're not extended-length paths.\n\nThis was created since the `path` methods in Node.js outputs `\\\\` paths on Windows.\n\n## Install\n\n```sh\nnpm install slash\n```\n\n## Usage\n\n```js\nimport path from 'node:path';\nimport slash from 'slash';\n\nconst string = path.join('foo', 'bar');\n// Unix    => foo/bar\n// Windows => foo\\\\bar\n\nslash(string);\n// Unix    => foo/bar\n// Windows => foo/bar\n```\n\n## API\n\n### slash(path)\n\nType: `string`\n\nAccepts a Windows backslash path and returns a path with forward slashes.\n"
  },
  {
    "path": "test.js",
    "content": "import test from 'ava';\nimport slash from './index.js';\n\ntest('convert backwards-slash paths to forward slash paths', t => {\n\tt.is(slash('c:/aaaa\\\\bbbb'), 'c:/aaaa/bbbb');\n\tt.is(slash('c:\\\\aaaa\\\\bbbb'), 'c:/aaaa/bbbb');\n\tt.is(slash('c:\\\\aaaa\\\\bbbb\\\\★'), 'c:/aaaa/bbbb/★');\n});\n\ntest('not convert extended-length paths', t => {\n\tconst path = '\\\\\\\\?\\\\c:\\\\aaaa\\\\bbbb';\n\tt.is(slash(path), path);\n});\n"
  }
]