Socket
Socket
Sign inDemoInstall

@platform/fs

Package Overview
Dependencies
Maintainers
1
Versions
112
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@platform/fs - npm Package Compare versions

Comparing version 0.6.6 to 0.6.7

lib/fs.d.ts

2

lib/file/util.js

@@ -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",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc