dot-slash

Normalize and detect the "./" relative path prefix

MIT 2 个版本
安装
npm install dot-slash
yarn add dot-slash
pnpm add dot-slash
bun add dot-slash
README

dot-slash Build Status

Normalize and detect the "./" relative path prefix

Installing

npm install dot-slash

API

ds.has(path) -> Boolean

Checks whether the supplied relative path begins with './'

ds.has('./foo') // => true
ds.enforce(path, prefix) -> String

Ensures that the path is or is not prefixed with './', depending on prefix. If only one argument is passed, prefix is set to true.

ds.enforce('foo', true) // => './foo'
ds.normalize(source, destination) -> String

Normalizes the source relative path to the same './' usage as the destination path.

ds.normalize('foo', './bar') // => './foo'
版本列表
1.1.0 2015-05-10
1.0.0 2015-04-03