@platform/fs
Advanced tools
Comparing version 0.6.6 to 0.6.7
@@ -98,3 +98,3 @@ "use strict"; | ||
case 'yaml': | ||
return common_1.yaml.safeLoad(text); | ||
return common_1.yaml.load(text); | ||
default: | ||
@@ -101,0 +101,0 @@ throw new Error("The path '" + path + "' is not a supported file type for parsing. Supported types: " + SUPPORTED); |
@@ -1,2 +0,1 @@ | ||
import * as glob from './glob'; | ||
export { glob }; | ||
export { Glob } from './Glob'; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.glob = void 0; | ||
var glob = require("./glob"); | ||
exports.glob = glob; | ||
exports.Glob = void 0; | ||
var Glob_1 = require("./Glob"); | ||
Object.defineProperty(exports, "Glob", { enumerable: true, get: function () { return Glob_1.Glob; } }); |
@@ -8,1 +8,4 @@ export declare function stream(input?: any): boolean; | ||
export declare function typeSync(path: string, type?: 'FILE' | 'DIR'): boolean; | ||
export declare function symlink(path: string, options?: { | ||
ancestor?: boolean; | ||
}): Promise<boolean>; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.typeSync = exports.type = exports.fileSync = exports.file = exports.dirSync = exports.dir = exports.stream = void 0; | ||
exports.symlink = exports.typeSync = exports.type = exports.fileSync = exports.file = exports.dirSync = exports.dir = exports.stream = void 0; | ||
var tslib_1 = require("tslib"); | ||
var common_1 = require("../common"); | ||
var ancestor_1 = require("../ancestor"); | ||
var path_1 = require("path"); | ||
function stream(input) { | ||
@@ -87,1 +89,72 @@ return typeof (input === null || input === void 0 ? void 0 : input.on) === 'function'; | ||
exports.typeSync = typeSync; | ||
function symlink(path, options) { | ||
if (options === void 0) { options = {}; } | ||
return tslib_1.__awaiter(this, void 0, void 0, function () { | ||
var _a; | ||
return tslib_1.__generator(this, function (_b) { | ||
switch (_b.label) { | ||
case 0: | ||
if (typeof path !== 'string') | ||
return [2, false]; | ||
return [4, common_1.fs.pathExists(path)]; | ||
case 1: | ||
if (!(_b.sent())) | ||
return [2, false]; | ||
return [4, Symlink.isLink(path)]; | ||
case 2: | ||
if (_b.sent()) | ||
return [2, true]; | ||
if (!options.ancestor) return [3, 4]; | ||
return [4, Symlink.isWithinLinkedDir(path)]; | ||
case 3: | ||
_a = _b.sent(); | ||
return [3, 5]; | ||
case 4: | ||
_a = false; | ||
_b.label = 5; | ||
case 5: return [2, _a]; | ||
} | ||
}); | ||
}); | ||
} | ||
exports.symlink = symlink; | ||
var Symlink = { | ||
isLink: function (path) { | ||
return tslib_1.__awaiter(this, void 0, void 0, function () { | ||
return tslib_1.__generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: return [4, common_1.fs.lstat(path)]; | ||
case 1: return [2, (_a.sent()).isSymbolicLink()]; | ||
} | ||
}); | ||
}); | ||
}, | ||
isWithinLinkedDir: function (path) { | ||
return tslib_1.__awaiter(this, void 0, void 0, function () { | ||
var result; | ||
var _this = this; | ||
return tslib_1.__generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: | ||
result = false; | ||
return [4, ancestor_1.ancestor(path_1.dirname(path)).walk(function (visitor) { return tslib_1.__awaiter(_this, void 0, void 0, function () { | ||
return tslib_1.__generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: return [4, Symlink.isLink(visitor.dir)]; | ||
case 1: | ||
if (_a.sent()) { | ||
result = true; | ||
visitor.stop(); | ||
} | ||
return [2]; | ||
} | ||
}); | ||
}); })]; | ||
case 1: | ||
_a.sent(); | ||
return [2, result]; | ||
} | ||
}); | ||
}); | ||
}, | ||
}; |
@@ -22,3 +22,3 @@ "use strict"; | ||
} | ||
return [4, glob_1.glob.find(common_1.join(targetDir, '**'))]; | ||
return [4, glob_1.Glob.find(common_1.join(targetDir, '**'))]; | ||
case 2: | ||
@@ -52,3 +52,3 @@ targets = _c.sent(); | ||
switch (_b.label) { | ||
case 0: return [4, glob_1.glob.find(pattern)]; | ||
case 0: return [4, glob_1.Glob.find(pattern)]; | ||
case 1: | ||
@@ -55,0 +55,0 @@ sources = _b.sent(); |
@@ -48,3 +48,3 @@ "use strict"; | ||
pattern = path_1.resolve(path_1.join(path), '**'); | ||
return [4, glob_1.glob.find(pattern)]; | ||
return [4, glob_1.Glob.find(pattern)]; | ||
case 1: | ||
@@ -51,0 +51,0 @@ wait = (_a.sent()).map(function (path) { return tslib_1.__awaiter(_this, void 0, void 0, function () { return tslib_1.__generator(this, function (_a) { |
{ | ||
"name": "@platform/fs", | ||
"version": "0.6.6", | ||
"version": "0.6.7", | ||
"description": "POSIX style file-system tools.", | ||
@@ -14,18 +14,18 @@ "main": "lib/index", | ||
"dependencies": { | ||
"@platform/fs.types": "0.1.4", | ||
"@platform/types": "0.5.14", | ||
"@types/fs-extra": "9.0.6", | ||
"@types/js-yaml": "3.12.5", | ||
"archiver": "5.1.0", | ||
"@platform/fs.types": "0.1.5", | ||
"@platform/types": "0.5.15", | ||
"@types/fs-extra": "9.0.7", | ||
"@types/js-yaml": "4.0.0", | ||
"archiver": "5.2.0", | ||
"dotenv": "8.2.0", | ||
"extract-zip": "2.0.1", | ||
"filesize": "6.1.0", | ||
"fs-extra": "9.0.1", | ||
"fs-extra": "9.1.0", | ||
"glob": "7.1.6", | ||
"js-yaml": "3.14.1", | ||
"js-yaml": "4.0.0", | ||
"minimatch": "3.0.4" | ||
}, | ||
"devDependencies": { | ||
"@platform/test": "0.2.2", | ||
"@platform/ts.libs": "4.1.2", | ||
"@platform/test": "0.2.3", | ||
"@platform/ts.libs": "4.1.3", | ||
"@types/archiver": "5.1.0", | ||
@@ -32,0 +32,0 @@ "@types/dotenv": "8.2.0", |
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
83218
1727
73
8
+ Added@platform/fs.types@0.1.5(transitive)
+ Added@platform/types@0.5.15(transitive)
+ Added@types/fs-extra@9.0.7(transitive)
+ Added@types/js-yaml@4.0.0(transitive)
+ Addedarchiver@5.2.0(transitive)
+ Addedargparse@2.0.1(transitive)
+ Addedfs-extra@9.1.0(transitive)
+ Addedjs-yaml@4.0.0(transitive)
- Removed@platform/fs.types@0.1.4(transitive)
- Removed@platform/types@0.5.14(transitive)
- Removed@types/fs-extra@9.0.6(transitive)
- Removed@types/js-yaml@3.12.5(transitive)
- Removedarchiver@5.1.0(transitive)
- Removedargparse@1.0.10(transitive)
- Removedesprima@4.0.1(transitive)
- Removedfs-extra@9.0.1(transitive)
- Removedjs-yaml@3.14.1(transitive)
- Removedsprintf-js@1.0.3(transitive)
- Removeduniversalify@1.0.0(transitive)
Updated@platform/fs.types@0.1.5
Updated@platform/types@0.5.15
Updated@types/fs-extra@9.0.7
Updated@types/js-yaml@4.0.0
Updatedarchiver@5.2.0
Updatedfs-extra@9.1.0
Updatedjs-yaml@4.0.0