diff options
author | 2020-11-16 00:10:28 +0100 | |
---|---|---|
committer | 2020-11-16 00:10:28 +0100 | |
commit | e06ec920f7a5d784e674c4c4b4e6d1da3dc7391d (patch) | |
tree | 55713f725f77b44ebfec86e4eec3ce33e71458ca /node_modules/@nodelib/fs.stat | |
download | website_creator-e06ec920f7a5d784e674c4c4b4e6d1da3dc7391d.tar.gz website_creator-e06ec920f7a5d784e674c4c4b4e6d1da3dc7391d.tar.bz2 website_creator-e06ec920f7a5d784e674c4c4b4e6d1da3dc7391d.zip |
api, login, auth
Diffstat (limited to 'node_modules/@nodelib/fs.stat')
-rw-r--r-- | node_modules/@nodelib/fs.stat/LICENSE | 21 | ||||
-rw-r--r-- | node_modules/@nodelib/fs.stat/README.md | 126 | ||||
-rw-r--r-- | node_modules/@nodelib/fs.stat/out/adapters/fs.d.ts | 11 | ||||
-rw-r--r-- | node_modules/@nodelib/fs.stat/out/adapters/fs.js | 16 | ||||
-rw-r--r-- | node_modules/@nodelib/fs.stat/out/index.d.ts | 13 | ||||
-rw-r--r-- | node_modules/@nodelib/fs.stat/out/index.js | 24 | ||||
-rw-r--r-- | node_modules/@nodelib/fs.stat/out/providers/async.d.ts | 5 | ||||
-rw-r--r-- | node_modules/@nodelib/fs.stat/out/providers/async.js | 31 | ||||
-rw-r--r-- | node_modules/@nodelib/fs.stat/out/providers/sync.d.ts | 4 | ||||
-rw-r--r-- | node_modules/@nodelib/fs.stat/out/providers/sync.js | 22 | ||||
-rw-r--r-- | node_modules/@nodelib/fs.stat/out/settings.d.ts | 17 | ||||
-rw-r--r-- | node_modules/@nodelib/fs.stat/out/settings.js | 16 | ||||
-rw-r--r-- | node_modules/@nodelib/fs.stat/out/types/index.d.ts | 5 | ||||
-rw-r--r-- | node_modules/@nodelib/fs.stat/out/types/index.js | 2 | ||||
-rw-r--r-- | node_modules/@nodelib/fs.stat/package.json | 59 |
15 files changed, 372 insertions, 0 deletions
diff --git a/node_modules/@nodelib/fs.stat/LICENSE b/node_modules/@nodelib/fs.stat/LICENSE new file mode 100644 index 0000000..65a9994 --- /dev/null +++ b/node_modules/@nodelib/fs.stat/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Denis Malinochkin + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/@nodelib/fs.stat/README.md b/node_modules/@nodelib/fs.stat/README.md new file mode 100644 index 0000000..686f047 --- /dev/null +++ b/node_modules/@nodelib/fs.stat/README.md @@ -0,0 +1,126 @@ +# @nodelib/fs.stat + +> Get the status of a file with some features. + +## :bulb: Highlights + +Wrapper around standard method `fs.lstat` and `fs.stat` with some features. + +* :beginner: Normally follows symbolic link. +* :gear: Can safely work with broken symbolic link. + +## Install + +```console +npm install @nodelib/fs.stat +``` + +## Usage + +```ts +import * as fsStat from '@nodelib/fs.stat'; + +fsStat.stat('path', (error, stats) => { /* … */ }); +``` + +## API + +### .stat(path, [optionsOrSettings], callback) + +Returns an instance of `fs.Stats` class for provided path with standard callback-style. + +```ts +fsStat.stat('path', (error, stats) => { /* … */ }); +fsStat.stat('path', {}, (error, stats) => { /* … */ }); +fsStat.stat('path', new fsStat.Settings(), (error, stats) => { /* … */ }); +``` + +### .statSync(path, [optionsOrSettings]) + +Returns an instance of `fs.Stats` class for provided path. + +```ts +const stats = fsStat.stat('path'); +const stats = fsStat.stat('path', {}); +const stats = fsStat.stat('path', new fsStat.Settings()); +``` + +#### path + +* Required: `true` +* Type: `string | Buffer | URL` + +A path to a file. If a URL is provided, it must use the `file:` protocol. + +#### optionsOrSettings + +* Required: `false` +* Type: `Options | Settings` +* Default: An instance of `Settings` class + +An [`Options`](#options) object or an instance of [`Settings`](#settings) class. + +> :book: When you pass a plain object, an instance of the `Settings` class will be created automatically. If you plan to call the method frequently, use a pre-created instance of the `Settings` class. + +### Settings([options]) + +A class of full settings of the package. + +```ts +const settings = new fsStat.Settings({ followSymbolicLink: false }); + +const stats = fsStat.stat('path', settings); +``` + +## Options + +### `followSymbolicLink` + +* Type: `boolean` +* Default: `true` + +Follow symbolic link or not. Call `fs.stat` on symbolic link if `true`. + +### `markSymbolicLink` + +* Type: `boolean` +* Default: `false` + +Mark symbolic link by setting the return value of `isSymbolicLink` function to always `true` (even after `fs.stat`). + +> :book: Can be used if you want to know what is hidden behind a symbolic link, but still continue to know that it is a symbolic link. + +### `throwErrorOnBrokenSymbolicLink` + +* Type: `boolean` +* Default: `true` + +Throw an error when symbolic link is broken if `true` or safely return `lstat` call if `false`. + +### `fs` + +* Type: [`FileSystemAdapter`](./src/adapters/fs.ts) +* Default: A default FS methods + +By default, the built-in Node.js module (`fs`) is used to work with the file system. You can replace any method with your own. + +```ts +interface FileSystemAdapter { + lstat?: typeof fs.lstat; + stat?: typeof fs.stat; + lstatSync?: typeof fs.lstatSync; + statSync?: typeof fs.statSync; +} + +const settings = new fsStat.Settings({ + fs: { lstat: fakeLstat } +}); +``` + +## Changelog + +See the [Releases section of our GitHub project](https://github.com/nodelib/nodelib/releases) for changelog for each release version. + +## License + +This software is released under the terms of the MIT license. diff --git a/node_modules/@nodelib/fs.stat/out/adapters/fs.d.ts b/node_modules/@nodelib/fs.stat/out/adapters/fs.d.ts new file mode 100644 index 0000000..d17b356 --- /dev/null +++ b/node_modules/@nodelib/fs.stat/out/adapters/fs.d.ts @@ -0,0 +1,11 @@ +/// <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;
+};
+export declare const FILE_SYSTEM_ADAPTER: FileSystemAdapter;
+export declare function createFileSystemAdapter(fsMethods?: Partial<FileSystemAdapter>): FileSystemAdapter;
+//# sourceMappingURL=fs.d.ts.map
\ No newline at end of file diff --git a/node_modules/@nodelib/fs.stat/out/adapters/fs.js b/node_modules/@nodelib/fs.stat/out/adapters/fs.js new file mode 100644 index 0000000..3a9806f --- /dev/null +++ b/node_modules/@nodelib/fs.stat/out/adapters/fs.js @@ -0,0 +1,16 @@ +"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+const fs = require("fs");
+exports.FILE_SYSTEM_ADAPTER = {
+ lstat: fs.lstat,
+ stat: fs.stat,
+ lstatSync: fs.lstatSync,
+ statSync: fs.statSync
+};
+function createFileSystemAdapter(fsMethods) {
+ if (fsMethods === undefined) {
+ return exports.FILE_SYSTEM_ADAPTER;
+ }
+ return Object.assign(Object.assign({}, exports.FILE_SYSTEM_ADAPTER), fsMethods);
+}
+exports.createFileSystemAdapter = createFileSystemAdapter;
diff --git a/node_modules/@nodelib/fs.stat/out/index.d.ts b/node_modules/@nodelib/fs.stat/out/index.d.ts new file mode 100644 index 0000000..5f092f9 --- /dev/null +++ b/node_modules/@nodelib/fs.stat/out/index.d.ts @@ -0,0 +1,13 @@ +import { FileSystemAdapter } from './adapters/fs';
+import * as async from './providers/async';
+import Settings, { Options } from './settings';
+import { Stats } from './types';
+declare type AsyncCallback = async.AsyncCallback;
+declare function stat(path: string, callback: AsyncCallback): void;
+declare function stat(path: string, optionsOrSettings: Options | Settings, callback: AsyncCallback): void;
+declare namespace stat {
+ function __promisify__(path: string, optionsOrSettings?: Options | Settings): Promise<Stats>;
+}
+declare function statSync(path: string, optionsOrSettings?: Options | Settings): Stats;
+export { Settings, stat, statSync, AsyncCallback, FileSystemAdapter, Options, Stats };
+//# sourceMappingURL=index.d.ts.map
\ No newline at end of file diff --git a/node_modules/@nodelib/fs.stat/out/index.js b/node_modules/@nodelib/fs.stat/out/index.js new file mode 100644 index 0000000..6a98f77 --- /dev/null +++ b/node_modules/@nodelib/fs.stat/out/index.js @@ -0,0 +1,24 @@ +"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+const async = require("./providers/async");
+const sync = require("./providers/sync");
+const settings_1 = require("./settings");
+exports.Settings = settings_1.default;
+function stat(path, optionsOrSettingsOrCallback, callback) {
+ if (typeof optionsOrSettingsOrCallback === 'function') {
+ return async.read(path, getSettings(), optionsOrSettingsOrCallback);
+ }
+ async.read(path, getSettings(optionsOrSettingsOrCallback), callback);
+}
+exports.stat = stat;
+function statSync(path, optionsOrSettings) {
+ const settings = getSettings(optionsOrSettings);
+ return sync.read(path, settings);
+}
+exports.statSync = statSync;
+function getSettings(settingsOrOptions = {}) {
+ if (settingsOrOptions instanceof settings_1.default) {
+ return settingsOrOptions;
+ }
+ return new settings_1.default(settingsOrOptions);
+}
diff --git a/node_modules/@nodelib/fs.stat/out/providers/async.d.ts b/node_modules/@nodelib/fs.stat/out/providers/async.d.ts new file mode 100644 index 0000000..a9637c5 --- /dev/null +++ b/node_modules/@nodelib/fs.stat/out/providers/async.d.ts @@ -0,0 +1,5 @@ +import Settings from '../settings';
+import { ErrnoException, Stats } from '../types';
+export declare type AsyncCallback = (err: ErrnoException, stats: Stats) => void;
+export declare function read(path: string, settings: Settings, callback: AsyncCallback): void;
+//# sourceMappingURL=async.d.ts.map
\ No newline at end of file diff --git a/node_modules/@nodelib/fs.stat/out/providers/async.js b/node_modules/@nodelib/fs.stat/out/providers/async.js new file mode 100644 index 0000000..ab98c29 --- /dev/null +++ b/node_modules/@nodelib/fs.stat/out/providers/async.js @@ -0,0 +1,31 @@ +"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+function read(path, settings, callback) {
+ settings.fs.lstat(path, (lstatError, lstat) => {
+ if (lstatError !== null) {
+ return callFailureCallback(callback, lstatError);
+ }
+ if (!lstat.isSymbolicLink() || !settings.followSymbolicLink) {
+ return callSuccessCallback(callback, lstat);
+ }
+ settings.fs.stat(path, (statError, stat) => {
+ if (statError !== null) {
+ if (settings.throwErrorOnBrokenSymbolicLink) {
+ return callFailureCallback(callback, statError);
+ }
+ return callSuccessCallback(callback, lstat);
+ }
+ if (settings.markSymbolicLink) {
+ stat.isSymbolicLink = () => true;
+ }
+ callSuccessCallback(callback, stat);
+ });
+ });
+}
+exports.read = read;
+function callFailureCallback(callback, error) {
+ callback(error);
+}
+function callSuccessCallback(callback, result) {
+ callback(null, result);
+}
diff --git a/node_modules/@nodelib/fs.stat/out/providers/sync.d.ts b/node_modules/@nodelib/fs.stat/out/providers/sync.d.ts new file mode 100644 index 0000000..f4c1d78 --- /dev/null +++ b/node_modules/@nodelib/fs.stat/out/providers/sync.d.ts @@ -0,0 +1,4 @@ +import Settings from '../settings';
+import { Stats } from '../types';
+export declare function read(path: string, settings: Settings): Stats;
+//# sourceMappingURL=sync.d.ts.map
\ No newline at end of file diff --git a/node_modules/@nodelib/fs.stat/out/providers/sync.js b/node_modules/@nodelib/fs.stat/out/providers/sync.js new file mode 100644 index 0000000..31dab38 --- /dev/null +++ b/node_modules/@nodelib/fs.stat/out/providers/sync.js @@ -0,0 +1,22 @@ +"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+function read(path, settings) {
+ const lstat = settings.fs.lstatSync(path);
+ if (!lstat.isSymbolicLink() || !settings.followSymbolicLink) {
+ return lstat;
+ }
+ try {
+ const stat = settings.fs.statSync(path);
+ if (settings.markSymbolicLink) {
+ stat.isSymbolicLink = () => true;
+ }
+ return stat;
+ }
+ catch (error) {
+ if (!settings.throwErrorOnBrokenSymbolicLink) {
+ return lstat;
+ }
+ throw error;
+ }
+}
+exports.read = read;
diff --git a/node_modules/@nodelib/fs.stat/out/settings.d.ts b/node_modules/@nodelib/fs.stat/out/settings.d.ts new file mode 100644 index 0000000..34c4620 --- /dev/null +++ b/node_modules/@nodelib/fs.stat/out/settings.d.ts @@ -0,0 +1,17 @@ +import * as fs from './adapters/fs';
+export declare type Options = {
+ followSymbolicLink?: boolean;
+ fs?: Partial<fs.FileSystemAdapter>;
+ markSymbolicLink?: boolean;
+ throwErrorOnBrokenSymbolicLink?: boolean;
+};
+export default class Settings {
+ private readonly _options;
+ readonly followSymbolicLink: boolean;
+ readonly fs: fs.FileSystemAdapter;
+ readonly markSymbolicLink: boolean;
+ readonly throwErrorOnBrokenSymbolicLink: boolean;
+ constructor(_options?: Options);
+ private _getValue;
+}
+//# sourceMappingURL=settings.d.ts.map
\ No newline at end of file diff --git a/node_modules/@nodelib/fs.stat/out/settings.js b/node_modules/@nodelib/fs.stat/out/settings.js new file mode 100644 index 0000000..ef4d057 --- /dev/null +++ b/node_modules/@nodelib/fs.stat/out/settings.js @@ -0,0 +1,16 @@ +"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+const fs = require("./adapters/fs");
+class Settings {
+ constructor(_options = {}) {
+ this._options = _options;
+ this.followSymbolicLink = this._getValue(this._options.followSymbolicLink, true);
+ this.fs = fs.createFileSystemAdapter(this._options.fs);
+ this.markSymbolicLink = this._getValue(this._options.markSymbolicLink, false);
+ this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, true);
+ }
+ _getValue(option, value) {
+ return option === undefined ? value : option;
+ }
+}
+exports.default = Settings;
diff --git a/node_modules/@nodelib/fs.stat/out/types/index.d.ts b/node_modules/@nodelib/fs.stat/out/types/index.d.ts new file mode 100644 index 0000000..227f7bf --- /dev/null +++ b/node_modules/@nodelib/fs.stat/out/types/index.d.ts @@ -0,0 +1,5 @@ +/// <reference types="node" />
+import * as fs from 'fs';
+export declare type Stats = fs.Stats;
+export declare type ErrnoException = NodeJS.ErrnoException;
+//# sourceMappingURL=index.d.ts.map
\ No newline at end of file diff --git a/node_modules/@nodelib/fs.stat/out/types/index.js b/node_modules/@nodelib/fs.stat/out/types/index.js new file mode 100644 index 0000000..ce03781 --- /dev/null +++ b/node_modules/@nodelib/fs.stat/out/types/index.js @@ -0,0 +1,2 @@ +"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
diff --git a/node_modules/@nodelib/fs.stat/package.json b/node_modules/@nodelib/fs.stat/package.json new file mode 100644 index 0000000..88a2543 --- /dev/null +++ b/node_modules/@nodelib/fs.stat/package.json @@ -0,0 +1,59 @@ +{ + "_from": "@nodelib/fs.stat@^2.0.2", + "_id": "@nodelib/fs.stat@2.0.3", + "_inBundle": false, + "_integrity": "sha512-bQBFruR2TAwoevBEd/NWMoAAtNGzTRgdrqnYCc7dhzfoNvqPzLyqlEQnzZ3kVnNrSp25iyxE00/3h2fqGAGArA==", + "_location": "/@nodelib/fs.stat", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "@nodelib/fs.stat@^2.0.2", + "name": "@nodelib/fs.stat", + "escapedName": "@nodelib%2ffs.stat", + "scope": "@nodelib", + "rawSpec": "^2.0.2", + "saveSpec": null, + "fetchSpec": "^2.0.2" + }, + "_requiredBy": [ + "/@nodelib/fs.scandir", + "/fast-glob" + ], + "_resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.3.tgz", + "_shasum": "34dc5f4cabbc720f4e60f75a747e7ecd6c175bd3", + "_spec": "@nodelib/fs.stat@^2.0.2", + "_where": "/home/pruss/Dev/3-minute-website/node_modules/fast-glob", + "bundleDependencies": false, + "deprecated": false, + "description": "Get the status of a file with some features", + "engines": { + "node": ">= 8" + }, + "gitHead": "3b1ef7554ad7c061b3580858101d483fba847abf", + "keywords": [ + "NodeLib", + "fs", + "FileSystem", + "file system", + "stat" + ], + "license": "MIT", + "main": "out/index.js", + "name": "@nodelib/fs.stat", + "repository": { + "type": "git", + "url": "https://github.com/nodelib/nodelib/tree/master/packages/fs/fs.stat" + }, + "scripts": { + "build": "npm run clean && npm run compile && npm run lint && npm test", + "clean": "rimraf {tsconfig.tsbuildinfo,out}", + "compile": "tsc -b .", + "compile:watch": "tsc -p . --watch --sourceMap", + "lint": "eslint \"src/**/*.ts\" --cache", + "test": "mocha \"out/**/*.spec.js\" -s 0", + "watch": "npm run clean && npm run compile:watch" + }, + "typings": "out/index.d.ts", + "version": "2.0.3" +} |