包详细信息

path-equal

unional1.7mMIT1.2.5

Determine two file paths are equal

自述文件

path-equal

NPM version NPM downloads

GitHub NodeJS Codecov

Visual Studio Code

Compare two file paths regardless of platforms.

The file paths in Unix and Windows are different.

If you do not compare them correctly, your code might work on one platform but not another.

This library provides this comparison to check if the two paths are the same, regardless of the running platform.

Install

# npm
npm install path-equal

# yarn
yarn add path-equal

# pnpm
pnpm install path-equal

#rush
rush add -p path-equal

Usage

import { pathEqual } from 'path-equal'

pathEqual('dir/sub-dir/file.txt', 'dir\\sub-dir\\file.txt') // true

This library will not access the file system, so comparing absolute path with relative path will fail.

Contribute

# after fork and clone
yarn

# begin making changes
git checkout -b <branch>
yarn watch

# after making change(s)
git commit -m "<commit message>"
git push

# create PR

更新日志

1.2.5 (2022-11-27)

Bug Fixes

  • remove extra files from distribution (91f833c)

1.2.4 (2022-10-28)

Bug Fixes

1.2.3 (2022-10-28)

Bug Fixes

  • husky should be in prepare step (e2b807b), closes #78

1.2.2 (2022-06-13)

Bug Fixes

path-equal

1.2.2

Patch Changes

  • Fix CommonJS usage by adding the cjs/package.json workaround.

1.2.1

Patch Changes

  • cf4f7ef: remove extra source files

1.2.0

Minor Changes

  • b0ae68e: add ESM support

Patch Changes

  • 25f89bd: Remove tslib phantom dependency