@bscotch/pathy
Advanced tools
Comparing version 2.5.0 to 2.5.1
@@ -1,3 +0,3 @@ | ||
/// <reference types="node" /> | ||
/// <reference types="node" /> | ||
/// <reference types="node" resolution-mode="require"/> | ||
/// <reference types="node" resolution-mode="require"/> | ||
import fs from 'fs'; | ||
@@ -4,0 +4,0 @@ import fse from 'fs-extra'; |
import { __decorate, __metadata } from "tslib"; | ||
import { arrayWrapped } from '@bscotch/utility'; | ||
import { ok } from 'assert'; | ||
import { arrayWrapped, assert } from '@bscotch/utility/browser'; | ||
import fs from 'fs'; | ||
@@ -144,3 +143,3 @@ import fse from 'fs-extra'; | ||
const isDirectory = metadata.isDirectory(); | ||
ok(!options?.assert || isDirectory, `${this.absolute} is not a directory`); | ||
assert(!options?.assert || isDirectory, `${this.absolute} is not a directory`); | ||
return isDirectory; | ||
@@ -243,3 +242,3 @@ } | ||
} | ||
ok(!options?.assert || isEmpty, `${this.absolute} is not an empty directory`); | ||
assert(!options?.assert || isEmpty, `${this.absolute} is not an empty directory`); | ||
return isEmpty; | ||
@@ -262,3 +261,3 @@ } | ||
async listChildren() { | ||
ok(await this.isDirectory(), `${this.normalized} is not a directory`); | ||
assert(await this.isDirectory(), `${this.normalized} is not a directory`); | ||
return (await fse.readdir(this.absolute)).map((entry) => { | ||
@@ -270,3 +269,3 @@ const path = this.join(entry); | ||
listChildrenSync() { | ||
ok(this.isDirectorySync(), `${this.normalized} is not a directory`); | ||
assert(this.isDirectorySync(), `${this.normalized} is not a directory`); | ||
return fse.readdirSync(this.absolute).map((entry) => { | ||
@@ -310,3 +309,3 @@ const path = this.join(entry); | ||
} | ||
ok(!options?.assert || child, `${this.absolute} does not have a child named ${basename}`); | ||
assert(!options?.assert || child, `${this.absolute} does not have a child named ${basename}`); | ||
return child; | ||
@@ -341,3 +340,3 @@ } | ||
if (to === undefined) { | ||
ok(typeof from === 'string', 'Function signature is wrong. If only one argument is provided it must be a string.'); | ||
assert(typeof from === 'string', 'Function signature is wrong. If only one argument is provided it must be a string.'); | ||
// Just replace the last .ext, whatever it is | ||
@@ -344,0 +343,0 @@ newPath = newPath.replace(/\.[^/.]+$/, newExtension); |
@@ -1,2 +0,2 @@ | ||
export declare const trace: import("@bscotch/utility").Decorator<any, any>; | ||
export declare const trace: import("@bscotch/utility/browser").Decorator<any, any>; | ||
//# sourceMappingURL=pathy.lib.d.ts.map |
@@ -1,3 +0,3 @@ | ||
import { Trace } from '@bscotch/utility'; | ||
import { Trace } from '@bscotch/utility/browser'; | ||
export const trace = Trace('@bscotch'); | ||
//# sourceMappingURL=pathy.lib.js.map |
@@ -1,4 +0,4 @@ | ||
/// <reference types="node" /> | ||
/// <reference types="node" /> | ||
import { Stats } from 'fs'; | ||
/// <reference types="node" resolution-mode="require"/> | ||
/// <reference types="node" resolution-mode="require"/> | ||
import type { Stats } from 'fs'; | ||
import type { Pathy } from './pathy.js'; | ||
@@ -5,0 +5,0 @@ import type { PathyFindParentOptions, PathyInfix, PathyListChildrenOptions, PathyOrString, PathyReadOptions, PathyReadOutput, PathySchema, PathyWriteOptions } from './pathy.types.js'; |
import { __decorate, __metadata } from "tslib"; | ||
import { arrayIsDuplicates, Sequential, stringIsMatch } from '@bscotch/utility'; | ||
import { arrayIsDuplicates, Sequential, stringIsMatch, } from '@bscotch/utility/browser'; | ||
import { ok } from 'assert'; | ||
@@ -4,0 +4,0 @@ import fse from 'fs-extra'; |
@@ -1,2 +0,2 @@ | ||
/// <reference types="node" /> | ||
/// <reference types="node" resolution-mode="require"/> | ||
import type { Promisable } from 'type-fest'; | ||
@@ -3,0 +3,0 @@ import type { Pathy } from './pathy.js'; |
{ | ||
"name": "@bscotch/pathy", | ||
"version": "2.5.0", | ||
"version": "2.5.1", | ||
"type": "module", | ||
@@ -14,3 +14,3 @@ "exports": { | ||
"dependencies": { | ||
"@bscotch/utility": "6.6.0", | ||
"@bscotch/utility": "6.7.0", | ||
"fs-extra": "10.1.0", | ||
@@ -17,0 +17,0 @@ "json5": "^2.2.1", |
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
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
104629
1713
+ Added@bscotch/utility@6.7.0(transitive)
- Removed@bscotch/utility@6.6.0(transitive)
Updated@bscotch/utility@6.7.0