path-parents
Advanced tools
Comparing version 1.0.16 to 1.0.17
@@ -6,2 +6,13 @@ # Change Log | ||
## [1.0.17](https://github.com/bluelovers/ws-iconv/compare/path-parents@1.0.16...path-parents@1.0.17) (2021-12-06) | ||
### ✨ Features | ||
* add `pathSplit` method ([5e616cd](https://github.com/bluelovers/ws-iconv/commit/5e616cdbda04d9e82eb7a94108a972fb63a7015e)) | ||
## [1.0.16](https://github.com/bluelovers/ws-iconv/compare/path-parents@1.0.15...path-parents@1.0.16) (2021-08-20) | ||
@@ -8,0 +19,0 @@ |
@@ -1,2 +0,2 @@ | ||
import { IPathPlatform, IPathNode } from 'upath2/lib/type'; | ||
import { IPathNode, IPathPlatform } from 'upath2/lib/type'; | ||
export interface IOptions { | ||
@@ -14,2 +14,4 @@ platform?: IPathPlatform; | ||
export declare function pathParents(cwd?: string | IOptions, opts?: IOptions): string[]; | ||
export declare function pathSplitGenerator(cwd?: string | IOptions, opts?: IOptions): Generator<string, void, unknown>; | ||
export declare function pathSplit(cwd?: string | IOptions, opts?: IOptions): string[]; | ||
export default pathParents; |
17
index.js
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.pathParents = exports.pathParentsGenerator = exports.pathParentsCore = exports.handleOptions = void 0; | ||
exports.pathSplit = exports.pathSplitGenerator = exports.pathParents = exports.pathParentsGenerator = exports.pathParentsCore = exports.handleOptions = void 0; | ||
const tslib_1 = require("tslib"); | ||
@@ -69,3 +69,18 @@ const core_1 = (0, tslib_1.__importDefault)(require("upath2/core")); | ||
exports.pathParents = pathParents; | ||
function* pathSplitGenerator(cwd, opts) { | ||
const runtime = handleOptions(cwd, opts); | ||
for (const p of pathParentsGenerator(cwd, runtime.opts)) { | ||
let r = runtime.path.basename(p); | ||
if (!(r === null || r === void 0 ? void 0 : r.length)) { | ||
r = p; | ||
} | ||
yield r; | ||
} | ||
} | ||
exports.pathSplitGenerator = pathSplitGenerator; | ||
function pathSplit(cwd, opts) { | ||
return [...pathSplitGenerator(cwd, opts)]; | ||
} | ||
exports.pathSplit = pathSplit; | ||
exports.default = pathParents; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "path-parents", | ||
"version": "1.0.16", | ||
"version": "1.0.17", | ||
"description": "return all the parent directories for a directory", | ||
@@ -39,3 +39,3 @@ "keywords": [ | ||
}, | ||
"gitHead": "7dfaf939ffe60fafb242a6a706ad649cfbf7aaa9" | ||
"gitHead": "d191647544bb12e909dcbe181280d087666d4995" | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
16200
100