pax_global_header00006660000000000000000000000064135077033720014521gustar00rootroot0000000000000052 comment=d4d1b6174ab30017d476b0210a5b01e69b3c076a is-path-cwd-2.2.0/000077500000000000000000000000001350770337200136425ustar00rootroot00000000000000is-path-cwd-2.2.0/.editorconfig000066400000000000000000000002571350770337200163230ustar00rootroot00000000000000root = true [*] indent_style = tab end_of_line = lf charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true [*.yml] indent_style = space indent_size = 2 is-path-cwd-2.2.0/.gitattributes000066400000000000000000000000231350770337200165300ustar00rootroot00000000000000* text=auto eol=lf is-path-cwd-2.2.0/.gitignore000066400000000000000000000000271350770337200156310ustar00rootroot00000000000000node_modules yarn.lock is-path-cwd-2.2.0/.npmrc000066400000000000000000000000231350770337200147550ustar00rootroot00000000000000package-lock=false is-path-cwd-2.2.0/.travis.yml000066400000000000000000000000751350770337200157550ustar00rootroot00000000000000language: node_js node_js: - '12' - '10' - '8' - '6' is-path-cwd-2.2.0/index.d.ts000066400000000000000000000004701350770337200155440ustar00rootroot00000000000000/** Check if a path is the [current working directory](https://en.wikipedia.org/wiki/Working_directory). @example ``` import isPathCwd = require('is-path-cwd'); isPathCwd(process.cwd()); //=> true isPathCwd('unicorn'); //=> false ``` */ declare function isPathCwd(path: string): boolean; export = isPathCwd; is-path-cwd-2.2.0/index.js000066400000000000000000000004001350770337200153010ustar00rootroot00000000000000'use strict'; const path = require('path'); module.exports = path_ => { let cwd = process.cwd(); path_ = path.resolve(path_); if (process.platform === 'win32') { cwd = cwd.toLowerCase(); path_ = path_.toLowerCase(); } return path_ === cwd; }; is-path-cwd-2.2.0/index.test-d.ts000066400000000000000000000001551350770337200165210ustar00rootroot00000000000000import {expectType} from 'tsd'; import isPathCwd = require('.'); expectType(isPathCwd('unicorn')); is-path-cwd-2.2.0/license000066400000000000000000000021251350770337200152070ustar00rootroot00000000000000MIT License Copyright (c) Sindre Sorhus (sindresorhus.com) Permission 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: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE 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. is-path-cwd-2.2.0/package.json000066400000000000000000000011141350770337200161250ustar00rootroot00000000000000{ "name": "is-path-cwd", "version": "2.2.0", "description": "Check if a path is the current working directory", "license": "MIT", "repository": "sindresorhus/is-path-cwd", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", "url": "sindresorhus.com" }, "engines": { "node": ">=6" }, "scripts": { "test": "xo && ava && tsd" }, "files": [ "index.js", "index.d.ts" ], "keywords": [ "path", "cwd", "pwd", "check", "filepath", "file", "folder" ], "devDependencies": { "ava": "^1.4.1", "tsd": "^0.7.2", "xo": "^0.24.0" } } is-path-cwd-2.2.0/readme.md000066400000000000000000000007571350770337200154320ustar00rootroot00000000000000# is-path-cwd [![Build Status](https://travis-ci.org/sindresorhus/is-path-cwd.svg?branch=master)](https://travis-ci.org/sindresorhus/is-path-cwd) > Check if a path is the [current working directory](https://en.wikipedia.org/wiki/Working_directory) ## Install ``` $ npm install is-path-cwd ``` ## Usage ```js const isPathCwd = require('is-path-cwd'); isPathCwd(process.cwd()); //=> true isPathCwd('unicorn'); //=> false ``` ## License MIT © [Sindre Sorhus](https://sindresorhus.com) is-path-cwd-2.2.0/test.js000066400000000000000000000012561350770337200151630ustar00rootroot00000000000000import test from 'ava'; import isPathCwd from '.'; const processCwd = process.cwd; const cwd = process.cwd(); test('main', t => { t.true(isPathCwd(cwd)); t.true(isPathCwd('.')); t.false(isPathCwd('foo')); t.false(isPathCwd('/')); t.false(isPathCwd('..')); process.cwd = () => cwd.toLowerCase(); t.false(isPathCwd(cwd.toUpperCase())); process.cwd = processCwd; }); test('win32', t => { const processPlatform = process.platform; Object.defineProperty(process, 'platform', {value: 'win32'}); process.cwd = () => cwd.toLowerCase(); t.true(isPathCwd(cwd.toUpperCase())); process.cwd = processCwd; Object.defineProperty(process, 'platform', {value: processPlatform}); });