@bscotch/pathy
Advanced tools
Comparing version 2.5.1 to 2.6.0
@@ -0,0 +0,0 @@ export * from './lib/pathy.js'; |
@@ -0,0 +0,0 @@ export * from './lib/pathy.js'; |
@@ -267,3 +267,3 @@ /// <reference types="node" resolution-mode="require"/> | ||
*/ | ||
static asInstance(stringOrInstance: string | Pathy | undefined): Pathy<unknown>; | ||
static asInstance<T = unknown>(stringOrInstance: string | Pathy | undefined): Pathy<T>; | ||
static isString(thing: any): thing is string; | ||
@@ -270,0 +270,0 @@ static isPathy(thing: any): thing is Pathy; |
@@ -341,3 +341,3 @@ import { __decorate, __metadata } from "tslib"; | ||
const fromPattern = arrayWrapped(from).map(ensureDot).join('|'); | ||
newPath = newPath.replace(new RegExp(`(${fromPattern})$`), newPath); | ||
newPath = newPath.replace(new RegExp(`(${fromPattern})$`), newExtension); | ||
} | ||
@@ -344,0 +344,0 @@ return new Pathy(newPath, this.workingDirectory); |
export declare const trace: import("@bscotch/utility/browser").Decorator<any, any>; | ||
//# sourceMappingURL=pathy.lib.d.ts.map |
import { Trace } from '@bscotch/utility/browser'; | ||
export const trace = Trace('@bscotch'); | ||
//# sourceMappingURL=pathy.lib.js.map |
@@ -57,2 +57,3 @@ /// <reference types="node" resolution-mode="require"/> | ||
static explode(path: PathyOrString): string[]; | ||
static compare(path1: PathyOrString, path2: PathyOrString): number; | ||
/** | ||
@@ -59,0 +60,0 @@ * Get all parent paths eventually leading to a given |
@@ -120,2 +120,15 @@ import { __decorate, __metadata } from "tslib"; | ||
} | ||
static compare(path1, path2) { | ||
const path1Parts = PathyStatic.explode(path1); | ||
const path2Parts = PathyStatic.explode(path2); | ||
const minParts = Math.min(path1Parts.length, path2Parts.length); | ||
for (let i = 0; i < minParts; i++) { | ||
const part1 = path1Parts[i]; | ||
const part2 = path2Parts[i]; | ||
if (part1 !== part2) { | ||
return part1.localeCompare(part2); | ||
} | ||
} | ||
return path1Parts.length - path2Parts.length; | ||
} | ||
/** | ||
@@ -253,2 +266,3 @@ * Get all parent paths eventually leading to a given | ||
static async listChildrenRecursively(dir, options = {}) { | ||
await dir.isDirectory({ assert: true }); | ||
const _children = []; | ||
@@ -255,0 +269,0 @@ const addChild = (child) => { |
export {}; | ||
//# sourceMappingURL=pathy.test.d.ts.map |
@@ -0,0 +0,0 @@ /// <reference types="node" resolution-mode="require"/> |
export {}; | ||
//# sourceMappingURL=pathy.types.js.map |
{ | ||
"name": "@bscotch/pathy", | ||
"version": "2.5.1", | ||
"version": "2.6.0", | ||
"type": "module", | ||
@@ -14,19 +14,19 @@ "exports": { | ||
"dependencies": { | ||
"@bscotch/utility": "6.7.0", | ||
"fs-extra": "10.1.0", | ||
"json5": "^2.2.1", | ||
"tslib": "^2.4.0", | ||
"yaml": "2.1.3" | ||
"fs-extra": "11.1.0", | ||
"json5": "^2.2.3", | ||
"tslib": "^2.4.1", | ||
"yaml": "2.2.1", | ||
"@bscotch/utility": "6.8.0" | ||
}, | ||
"devDependencies": { | ||
"@local/helpers": "0.0.0", | ||
"@types/chai": "^4.3.3", | ||
"@types/fs-extra": "^9.0.13", | ||
"@types/mocha": "^10.0.0", | ||
"chai": "^4.3.6", | ||
"mocha": "^10.1.0", | ||
"rimraf": "^3.0.2", | ||
"type-fest": "^3.0.0", | ||
"typescript": "4.9.1-beta", | ||
"zod": "3.19.1" | ||
"@types/chai": "^4.3.4", | ||
"@types/fs-extra": "^11.0.1", | ||
"@types/mocha": "^10.0.1", | ||
"chai": "^4.3.7", | ||
"mocha": "^10.2.0", | ||
"rimraf": "^4.1.0", | ||
"type-fest": "^3.5.2", | ||
"typescript": "4.9.4", | ||
"zod": "^3.20.2", | ||
"@local/helpers": "0.0.0" | ||
}, | ||
@@ -33,0 +33,0 @@ "publishConfig": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
1728
104297
+ Added@bscotch/utility@6.8.0(transitive)
+ Addedeventemitter2@6.4.9(transitive)
+ Addedfs-extra@11.1.0(transitive)
+ Addedyaml@2.2.1(transitive)
- Removed@bscotch/utility@6.7.0(transitive)
- Removedfs-extra@10.1.0(transitive)
- Removedyaml@2.1.3(transitive)
Updated@bscotch/utility@6.8.0
Updatedfs-extra@11.1.0
Updatedjson5@^2.2.3
Updatedtslib@^2.4.1
Updatedyaml@2.2.1