@stryke/path
Version:
A package containing various utilities that expand the functionality of NodeJs's built-in `path` module
72 lines • 2.37 kB
text/typescript
//#region src/is-type.d.ts
/**
* Check if the path is an absolute path.
*
* @param path - The path to check
* @returns An indicator specifying if the path is an absolute path
*/
declare function isAbsolutePath(path: string): boolean;
/**
* Check if the path is an absolute path.
*
* @remarks
* This is an alias for {@link isAbsolutePath}.
*
* @param path - The path to check
* @returns An indicator specifying if the path is an absolute path
*/
declare function isAbsolute(path: string): boolean;
/**
* Check if the path is a relative path.
*
* @param path - The path to check
* @returns An indicator specifying if the path is a relative path
*/
declare function isRelativePath(path: string): boolean;
/**
* Check if the path is a relative path.
*
* @remarks
* This is an alias for {@link isRelativePath}.
*
* @param path - The path to check
* @returns An indicator specifying if the path is a relative path
*/
declare function isRelative(path: string): boolean;
/**
* Check if the path is a npm package path.
*
* @remarks
* This only checks if the path matches the npm namespace scoped package naming convention such as `@scope/package-name`. This is an alias for {@link isNpmScopedPackage}.
*
* @example
* ```ts
* isNpmScopedPackage("@stryke/path"); // returns true
* isNpmScopedPackage("lodash"); // returns false
* isNpmNamespacePackage("./src/index.ts"); // returns false
* ```
*
* @param path - The path to check
* @returns An indicator specifying if the path is a npm package path
*/
declare function isNpmScopedPackagePath(path: string): boolean;
/**
* Check if the path is a npm package path.
*
* @remarks
* This only checks if the path matches the npm namespace scoped package naming convention such as `@scope/package-name`. This is an alias for {@link isNpmScopedPackagePath}.
*
* @example
* ```ts
* isNpmScopedPackagePath("@stryke/path"); // returns true
* isNpmScopedPackagePath("lodash"); // returns false
* isNpmScopedPackagePath("./src/index.ts"); // returns false
* ```
*
* @param path - The path to check
* @returns An indicator specifying if the path is a npm package path
*/
declare function isNpmScopedPackage(path: string): boolean;
//#endregion
export { isAbsolute, isAbsolutePath, isNpmScopedPackage, isNpmScopedPackagePath, isRelative, isRelativePath };
//# sourceMappingURL=is-type.d.mts.map