Socket
Socket
Sign inDemoInstall

@nodelib/fs.stat

Package Overview
Dependencies
0
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.0.4 to 2.0.5

16

out/adapters/fs.d.ts
/// <reference types="node" />
import * as fs from 'fs';
export declare type FileSystemAdapter = {
lstat: typeof fs.lstat;
stat: typeof fs.stat;
lstatSync: typeof fs.lstatSync;
statSync: typeof fs.statSync;
};
import type { ErrnoException } from '../types';
export declare type StatAsynchronousMethod = (path: string, callback: (error: ErrnoException | null, stats: fs.Stats) => void) => void;
export declare type StatSynchronousMethod = (path: string) => fs.Stats;
export interface FileSystemAdapter {
lstat: StatAsynchronousMethod;
stat: StatAsynchronousMethod;
lstatSync: StatSynchronousMethod;
statSync: StatSynchronousMethod;
}
export declare const FILE_SYSTEM_ADAPTER: FileSystemAdapter;
export declare function createFileSystemAdapter(fsMethods?: Partial<FileSystemAdapter>): FileSystemAdapter;
//# sourceMappingURL=fs.d.ts.map

@@ -0,0 +0,0 @@ "use strict";

@@ -1,5 +0,5 @@

import { FileSystemAdapter } from './adapters/fs';
import type { FileSystemAdapter, StatAsynchronousMethod, StatSynchronousMethod } from './adapters/fs';
import * as async from './providers/async';
import Settings, { Options } from './settings';
import { Stats } from './types';
import type { Stats } from './types';
declare type AsyncCallback = async.AsyncCallback;

@@ -12,3 +12,2 @@ declare function stat(path: string, callback: AsyncCallback): void;

declare function statSync(path: string, optionsOrSettings?: Options | Settings): Stats;
export { Settings, stat, statSync, AsyncCallback, FileSystemAdapter, Options, Stats };
//# sourceMappingURL=index.d.ts.map
export { Settings, stat, statSync, AsyncCallback, FileSystemAdapter, StatAsynchronousMethod, StatSynchronousMethod, Options, Stats };

@@ -10,3 +10,4 @@ "use strict";

if (typeof optionsOrSettingsOrCallback === 'function') {
return async.read(path, getSettings(), optionsOrSettingsOrCallback);
async.read(path, getSettings(), optionsOrSettingsOrCallback);
return;
}

@@ -13,0 +14,0 @@ async.read(path, getSettings(optionsOrSettingsOrCallback), callback);

@@ -1,5 +0,4 @@

import Settings from '../settings';
import { ErrnoException, Stats } from '../types';
export declare type AsyncCallback = (err: ErrnoException, stats: Stats) => void;
import type Settings from '../settings';
import type { ErrnoException, Stats } from '../types';
export declare type AsyncCallback = (error: ErrnoException, stats: Stats) => void;
export declare function read(path: string, settings: Settings, callback: AsyncCallback): void;
//# sourceMappingURL=async.d.ts.map

@@ -7,6 +7,8 @@ "use strict";

if (lstatError !== null) {
return callFailureCallback(callback, lstatError);
callFailureCallback(callback, lstatError);
return;
}
if (!lstat.isSymbolicLink() || !settings.followSymbolicLink) {
return callSuccessCallback(callback, lstat);
callSuccessCallback(callback, lstat);
return;
}

@@ -16,5 +18,7 @@ settings.fs.stat(path, (statError, stat) => {

if (settings.throwErrorOnBrokenSymbolicLink) {
return callFailureCallback(callback, statError);
callFailureCallback(callback, statError);
return;
}
return callSuccessCallback(callback, lstat);
callSuccessCallback(callback, lstat);
return;
}

@@ -21,0 +25,0 @@ if (settings.markSymbolicLink) {

@@ -1,4 +0,3 @@

import Settings from '../settings';
import { Stats } from '../types';
import type Settings from '../settings';
import type { Stats } from '../types';
export declare function read(path: string, settings: Settings): Stats;
//# sourceMappingURL=sync.d.ts.map

@@ -0,0 +0,0 @@ "use strict";

import * as fs from './adapters/fs';
export declare type Options = {
export interface Options {
followSymbolicLink?: boolean;

@@ -7,3 +7,3 @@ fs?: Partial<fs.FileSystemAdapter>;

throwErrorOnBrokenSymbolicLink?: boolean;
};
}
export default class Settings {

@@ -18,2 +18,1 @@ private readonly _options;

}
//# sourceMappingURL=settings.d.ts.map

@@ -0,0 +0,0 @@ "use strict";

/// <reference types="node" />
import * as fs from 'fs';
import type * as fs from 'fs';
export declare type Stats = fs.Stats;
export declare type ErrnoException = NodeJS.ErrnoException;
//# sourceMappingURL=index.d.ts.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
{
"name": "@nodelib/fs.stat",
"version": "2.0.4",
"version": "2.0.5",
"description": "Get the status of a file with some features",

@@ -17,2 +17,7 @@ "license": "MIT",

},
"files": [
"out/**",
"!out/**/*.map",
"!out/**/*.spec.*"
],
"main": "out/index.js",

@@ -29,3 +34,6 @@ "typings": "out/index.d.ts",

},
"gitHead": "cb5f7e893a986164c3b847a4f1faef6c54cadd68"
"devDependencies": {
"@nodelib/fs.macchiato": "1.0.4"
},
"gitHead": "d6a7960d5281d3dd5f8e2efba49bb552d090f562"
}
SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc