Galerie und tage
This commit is contained in:
@@ -5,7 +5,7 @@ var sass = require('gulp-sass')(require('sass'));
|
||||
var cleanCSS = require('gulp-clean-css');
|
||||
var rename = require('gulp-rename');
|
||||
var autoprefixer = require('gulp-autoprefixer');
|
||||
//var imagemin = require('gulp-imagemin');
|
||||
var imagemin = require('gulp-imagemin');
|
||||
var sourcemaps = require('gulp-sourcemaps');
|
||||
//var uglify = require('gulp-uglify');
|
||||
//var concat = require('gulp-concat');
|
||||
@@ -49,7 +49,7 @@ gulp.task('min-jpg', () => {
|
||||
progressive: true
|
||||
})]))
|
||||
.pipe(rename({prefix: "min-"}))
|
||||
.pipe(gulp.dest('media'))
|
||||
.pipe(gulp.dest('media/img'))
|
||||
});
|
||||
// gulp verzeichnisse beobachten
|
||||
// ------------------------------------------------
|
||||
@@ -57,7 +57,7 @@ gulp.task('watch', function() {
|
||||
gulp.series('default');
|
||||
gulp.watch('src/sass/*.sass', gulp.series('sass'));
|
||||
// gulp.watch('src/js/*', //gulp.series('min-js'));
|
||||
gulp.watch('src/images/*', //gulp.series('min-jpg'));
|
||||
// gulp.watch('src/images/*', //gulp.series('min-jpg'));
|
||||
});
|
||||
// gulp 1mal ausführen mit allen task
|
||||
// ------------------------------------------------
|
||||
|
||||
4563
inc/MwllyKallernderQR.sla
Normal file
4563
inc/MwllyKallernderQR.sla
Normal file
File diff suppressed because one or more lines are too long
BIN
inc/close.png
Normal file
BIN
inc/close.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 280 B |
BIN
inc/home_jas.pdf
Normal file
BIN
inc/home_jas.pdf
Normal file
Binary file not shown.
BIN
inc/loading.gif
Normal file
BIN
inc/loading.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 8.3 KiB |
BIN
inc/next.png
Normal file
BIN
inc/next.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.3 KiB |
BIN
inc/prev.png
Normal file
BIN
inc/prev.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.3 KiB |
@@ -14,6 +14,8 @@ if ($tab == "") {$tab = "home";}
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.0/jquery.min.js"></script>
|
||||
<script src="main/min-script.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="main/min-style.css">
|
||||
<script src="main/lightbox-plus-jquery.min.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="main/lightbox.min.css">
|
||||
</head>
|
||||
|
||||
<header>
|
||||
|
||||
5914
main/lightbox-plus-jquery.min.js
vendored
Normal file
5914
main/lightbox-plus-jquery.min.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
172
main/lightbox.min.css
vendored
Normal file
172
main/lightbox.min.css
vendored
Normal file
@@ -0,0 +1,172 @@
|
||||
.lb-loader,
|
||||
.lightbox {
|
||||
text-align: center;
|
||||
line-height: 0;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
}
|
||||
body.lb-disable-scrolling {
|
||||
overflow: hidden;
|
||||
}
|
||||
.lightboxOverlay {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
z-index: 9999;
|
||||
background-color: #000;
|
||||
filter: alpha(Opacity=80);
|
||||
opacity: 0.8;
|
||||
display: none;
|
||||
}
|
||||
.lightbox {
|
||||
width: 100%;
|
||||
z-index: 10000;
|
||||
font-weight: 400;
|
||||
outline: 0;
|
||||
}
|
||||
.lightbox .lb-image {
|
||||
display: block;
|
||||
height: auto;
|
||||
max-width: inherit;
|
||||
max-height: none;
|
||||
border-radius: 3px;
|
||||
border: 4px solid #fff;
|
||||
}
|
||||
.lightbox a img {
|
||||
border: none;
|
||||
}
|
||||
.lb-outerContainer {
|
||||
position: relative;
|
||||
width: 250px;
|
||||
height: 250px;
|
||||
margin: 0 auto;
|
||||
border-radius: 4px;
|
||||
background-color: #fff;
|
||||
}
|
||||
.lb-outerContainer:after {
|
||||
content: "";
|
||||
display: table;
|
||||
clear: both;
|
||||
}
|
||||
.lb-loader {
|
||||
top: 43%;
|
||||
height: 25%;
|
||||
width: 100%;
|
||||
}
|
||||
.lb-cancel {
|
||||
display: block;
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
margin: 0 auto;
|
||||
background: url(../include/img/loading.gif) no-repeat;
|
||||
}
|
||||
.lb-nav {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
z-index: 10;
|
||||
}
|
||||
.lb-container > .nav {
|
||||
left: 0;
|
||||
}
|
||||
.lb-nav a {
|
||||
outline: 0;
|
||||
background-image: url(data:image/gif;base64,R0lGODlhAQABAPAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==);
|
||||
}
|
||||
.lb-next,
|
||||
.lb-prev {
|
||||
height: 100%;
|
||||
cursor: pointer;
|
||||
display: block;
|
||||
}
|
||||
.lb-nav a.lb-prev {
|
||||
width: 34%;
|
||||
left: 0;
|
||||
float: left;
|
||||
background: url(../inc/prev.png) left 48% no-repeat;
|
||||
filter: alpha(Opacity=0);
|
||||
opacity: 0;
|
||||
-webkit-transition: opacity 0.6s;
|
||||
-moz-transition: opacity 0.6s;
|
||||
-o-transition: opacity 0.6s;
|
||||
transition: opacity 0.6s;
|
||||
}
|
||||
.lb-nav a.lb-prev:hover {
|
||||
filter: alpha(Opacity=100);
|
||||
opacity: 1;
|
||||
}
|
||||
.lb-nav a.lb-next {
|
||||
width: 64%;
|
||||
right: 0;
|
||||
float: right;
|
||||
background: url(../inc/next.png) right 48% no-repeat;
|
||||
filter: alpha(Opacity=0);
|
||||
opacity: 0;
|
||||
-webkit-transition: opacity 0.6s;
|
||||
-moz-transition: opacity 0.6s;
|
||||
-o-transition: opacity 0.6s;
|
||||
transition: opacity 0.6s;
|
||||
}
|
||||
.lb-nav a.lb-next:hover {
|
||||
filter: alpha(Opacity=100);
|
||||
opacity: 1;
|
||||
}
|
||||
.lb-dataContainer {
|
||||
margin: 0 auto;
|
||||
padding-top: 5px;
|
||||
width: 100%;
|
||||
border-bottom-left-radius: 4px;
|
||||
border-bottom-right-radius: 4px;
|
||||
}
|
||||
.lb-dataContainer:after {
|
||||
content: "";
|
||||
display: table;
|
||||
clear: both;
|
||||
}
|
||||
.lb-data {
|
||||
padding: 0 4px;
|
||||
color: #ccc;
|
||||
}
|
||||
.lb-data .lb-details {
|
||||
width: 85%;
|
||||
float: left;
|
||||
text-align: left;
|
||||
line-height: 1.1em;
|
||||
}
|
||||
.lb-data .lb-caption {
|
||||
font-size: 13px;
|
||||
font-weight: 700;
|
||||
line-height: 1em;
|
||||
}
|
||||
.lb-data .lb-caption a {
|
||||
color: #4ae;
|
||||
}
|
||||
.lb-data .lb-number {
|
||||
display: block;
|
||||
clear: left;
|
||||
padding-bottom: 1em;
|
||||
font-size: 12px;
|
||||
color: #999;
|
||||
}
|
||||
.lb-data .lb-close {
|
||||
display: block;
|
||||
float: right;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
background: url(../inc/close.png) top right no-repeat;
|
||||
text-align: right;
|
||||
outline: 0;
|
||||
filter: alpha(Opacity=70);
|
||||
opacity: 0.7;
|
||||
-webkit-transition: opacity 0.2s;
|
||||
-moz-transition: opacity 0.2s;
|
||||
-o-transition: opacity 0.2s;
|
||||
transition: opacity 0.2s;
|
||||
}
|
||||
.lb-data .lb-close:hover {
|
||||
cursor: pointer;
|
||||
filter: alpha(Opacity=100);
|
||||
opacity: 1;
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
node_modules/.bin/bin-version-check
generated
vendored
Symbolic link
1
node_modules/.bin/bin-version-check
generated
vendored
Symbolic link
@@ -0,0 +1 @@
|
||||
../bin-version-check/cli.js
|
||||
1
node_modules/.bin/csso
generated
vendored
Symbolic link
1
node_modules/.bin/csso
generated
vendored
Symbolic link
@@ -0,0 +1 @@
|
||||
../csso/bin/csso
|
||||
1
node_modules/.bin/executable
generated
vendored
Symbolic link
1
node_modules/.bin/executable
generated
vendored
Symbolic link
@@ -0,0 +1 @@
|
||||
../executable/cli.js
|
||||
1
node_modules/.bin/find-versions
generated
vendored
Symbolic link
1
node_modules/.bin/find-versions
generated
vendored
Symbolic link
@@ -0,0 +1 @@
|
||||
../find-versions/cli.js
|
||||
1
node_modules/.bin/pretty-bytes
generated
vendored
Symbolic link
1
node_modules/.bin/pretty-bytes
generated
vendored
Symbolic link
@@ -0,0 +1 @@
|
||||
../pretty-bytes/cli.js
|
||||
1
node_modules/.bin/rc
generated
vendored
Symbolic link
1
node_modules/.bin/rc
generated
vendored
Symbolic link
@@ -0,0 +1 @@
|
||||
../rc/cli.js
|
||||
1
node_modules/.bin/strip-dirs
generated
vendored
Symbolic link
1
node_modules/.bin/strip-dirs
generated
vendored
Symbolic link
@@ -0,0 +1 @@
|
||||
../strip-dirs/cli.js
|
||||
1
node_modules/.bin/uuid
generated
vendored
1
node_modules/.bin/uuid
generated
vendored
@@ -1 +0,0 @@
|
||||
../uuid/bin/uuid
|
||||
1
node_modules/.bin/xml2js
generated
vendored
1
node_modules/.bin/xml2js
generated
vendored
@@ -1 +0,0 @@
|
||||
../fast-xml-parser/cli.js
|
||||
5330
node_modules/.package-lock.json
generated
vendored
5330
node_modules/.package-lock.json
generated
vendored
File diff suppressed because it is too large
Load Diff
21
node_modules/@nodelib/fs.scandir/LICENSE
generated
vendored
21
node_modules/@nodelib/fs.scandir/LICENSE
generated
vendored
@@ -1,21 +0,0 @@
|
||||
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.
|
||||
171
node_modules/@nodelib/fs.scandir/README.md
generated
vendored
171
node_modules/@nodelib/fs.scandir/README.md
generated
vendored
@@ -1,171 +0,0 @@
|
||||
# @nodelib/fs.scandir
|
||||
|
||||
> List files and directories inside the specified directory.
|
||||
|
||||
## :bulb: Highlights
|
||||
|
||||
The package is aimed at obtaining information about entries in the directory.
|
||||
|
||||
* :moneybag: Returns useful information: `name`, `path`, `dirent` and `stats` (optional).
|
||||
* :gear: On Node.js 10.10+ uses the mechanism without additional calls to determine the entry type. See [`old` and `modern` mode](#old-and-modern-mode).
|
||||
* :link: Can safely work with broken symbolic links.
|
||||
|
||||
## Install
|
||||
|
||||
```console
|
||||
npm install @nodelib/fs.scandir
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```ts
|
||||
import * as fsScandir from '@nodelib/fs.scandir';
|
||||
|
||||
fsScandir.scandir('path', (error, stats) => { /* … */ });
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
### .scandir(path, [optionsOrSettings], callback)
|
||||
|
||||
Returns an array of plain objects ([`Entry`](#entry)) with information about entry for provided path with standard callback-style.
|
||||
|
||||
```ts
|
||||
fsScandir.scandir('path', (error, entries) => { /* … */ });
|
||||
fsScandir.scandir('path', {}, (error, entries) => { /* … */ });
|
||||
fsScandir.scandir('path', new fsScandir.Settings(), (error, entries) => { /* … */ });
|
||||
```
|
||||
|
||||
### .scandirSync(path, [optionsOrSettings])
|
||||
|
||||
Returns an array of plain objects ([`Entry`](#entry)) with information about entry for provided path.
|
||||
|
||||
```ts
|
||||
const entries = fsScandir.scandirSync('path');
|
||||
const entries = fsScandir.scandirSync('path', {});
|
||||
const entries = fsScandir.scandirSync(('path', new fsScandir.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`](#settingsoptions) 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 fsScandir.Settings({ followSymbolicLinks: false });
|
||||
|
||||
const entries = fsScandir.scandirSync('path', settings);
|
||||
```
|
||||
|
||||
## Entry
|
||||
|
||||
* `name` — The name of the entry (`unknown.txt`).
|
||||
* `path` — The path of the entry relative to call directory (`root/unknown.txt`).
|
||||
* `dirent` — An instance of [`fs.Dirent`](./src/types/index.ts) class. On Node.js below 10.10 will be emulated by [`DirentFromStats`](./src/utils/fs.ts) class.
|
||||
* `stats` (optional) — An instance of `fs.Stats` class.
|
||||
|
||||
For example, the `scandir` call for `tools` directory with one directory inside:
|
||||
|
||||
```ts
|
||||
{
|
||||
dirent: Dirent { name: 'typedoc', /* … */ },
|
||||
name: 'typedoc',
|
||||
path: 'tools/typedoc'
|
||||
}
|
||||
```
|
||||
|
||||
## Options
|
||||
|
||||
### stats
|
||||
|
||||
* Type: `boolean`
|
||||
* Default: `false`
|
||||
|
||||
Adds an instance of `fs.Stats` class to the [`Entry`](#entry).
|
||||
|
||||
> :book: Always use `fs.readdir` without the `withFileTypes` option. ??TODO??
|
||||
|
||||
### followSymbolicLinks
|
||||
|
||||
* Type: `boolean`
|
||||
* Default: `false`
|
||||
|
||||
Follow symbolic links or not. Call `fs.stat` on symbolic link if `true`.
|
||||
|
||||
### `throwErrorOnBrokenSymbolicLink`
|
||||
|
||||
* Type: `boolean`
|
||||
* Default: `true`
|
||||
|
||||
Throw an error when symbolic link is broken if `true` or safely use `lstat` call if `false`.
|
||||
|
||||
### `pathSegmentSeparator`
|
||||
|
||||
* Type: `string`
|
||||
* Default: `path.sep`
|
||||
|
||||
By default, this package uses the correct path separator for your OS (`\` on Windows, `/` on Unix-like systems). But you can set this option to any separator character(s) that you want to use instead.
|
||||
|
||||
### `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;
|
||||
readdir?: typeof fs.readdir;
|
||||
readdirSync?: typeof fs.readdirSync;
|
||||
}
|
||||
|
||||
const settings = new fsScandir.Settings({
|
||||
fs: { lstat: fakeLstat }
|
||||
});
|
||||
```
|
||||
|
||||
## `old` and `modern` mode
|
||||
|
||||
This package has two modes that are used depending on the environment and parameters of use.
|
||||
|
||||
### old
|
||||
|
||||
* Node.js below `10.10` or when the `stats` option is enabled
|
||||
|
||||
When working in the old mode, the directory is read first (`fs.readdir`), then the type of entries is determined (`fs.lstat` and/or `fs.stat` for symbolic links).
|
||||
|
||||
### modern
|
||||
|
||||
* Node.js 10.10+ and the `stats` option is disabled
|
||||
|
||||
In the modern mode, reading the directory (`fs.readdir` with the `withFileTypes` option) is combined with obtaining information about its entries. An additional call for symbolic links (`fs.stat`) is still present.
|
||||
|
||||
This mode makes fewer calls to the file system. It's faster.
|
||||
|
||||
## 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.
|
||||
20
node_modules/@nodelib/fs.scandir/out/adapters/fs.d.ts
generated
vendored
20
node_modules/@nodelib/fs.scandir/out/adapters/fs.d.ts
generated
vendored
@@ -1,20 +0,0 @@
|
||||
import type * as fsStat from '@nodelib/fs.stat';
|
||||
import type { Dirent, ErrnoException } from '../types';
|
||||
export interface ReaddirAsynchronousMethod {
|
||||
(filepath: string, options: {
|
||||
withFileTypes: true;
|
||||
}, callback: (error: ErrnoException | null, files: Dirent[]) => void): void;
|
||||
(filepath: string, callback: (error: ErrnoException | null, files: string[]) => void): void;
|
||||
}
|
||||
export interface ReaddirSynchronousMethod {
|
||||
(filepath: string, options: {
|
||||
withFileTypes: true;
|
||||
}): Dirent[];
|
||||
(filepath: string): string[];
|
||||
}
|
||||
export declare type FileSystemAdapter = fsStat.FileSystemAdapter & {
|
||||
readdir: ReaddirAsynchronousMethod;
|
||||
readdirSync: ReaddirSynchronousMethod;
|
||||
};
|
||||
export declare const FILE_SYSTEM_ADAPTER: FileSystemAdapter;
|
||||
export declare function createFileSystemAdapter(fsMethods?: Partial<FileSystemAdapter>): FileSystemAdapter;
|
||||
19
node_modules/@nodelib/fs.scandir/out/adapters/fs.js
generated
vendored
19
node_modules/@nodelib/fs.scandir/out/adapters/fs.js
generated
vendored
@@ -1,19 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.createFileSystemAdapter = exports.FILE_SYSTEM_ADAPTER = void 0;
|
||||
const fs = require("fs");
|
||||
exports.FILE_SYSTEM_ADAPTER = {
|
||||
lstat: fs.lstat,
|
||||
stat: fs.stat,
|
||||
lstatSync: fs.lstatSync,
|
||||
statSync: fs.statSync,
|
||||
readdir: fs.readdir,
|
||||
readdirSync: fs.readdirSync
|
||||
};
|
||||
function createFileSystemAdapter(fsMethods) {
|
||||
if (fsMethods === undefined) {
|
||||
return exports.FILE_SYSTEM_ADAPTER;
|
||||
}
|
||||
return Object.assign(Object.assign({}, exports.FILE_SYSTEM_ADAPTER), fsMethods);
|
||||
}
|
||||
exports.createFileSystemAdapter = createFileSystemAdapter;
|
||||
4
node_modules/@nodelib/fs.scandir/out/constants.d.ts
generated
vendored
4
node_modules/@nodelib/fs.scandir/out/constants.d.ts
generated
vendored
@@ -1,4 +0,0 @@
|
||||
/**
|
||||
* IS `true` for Node.js 10.10 and greater.
|
||||
*/
|
||||
export declare const IS_SUPPORT_READDIR_WITH_FILE_TYPES: boolean;
|
||||
17
node_modules/@nodelib/fs.scandir/out/constants.js
generated
vendored
17
node_modules/@nodelib/fs.scandir/out/constants.js
generated
vendored
@@ -1,17 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.IS_SUPPORT_READDIR_WITH_FILE_TYPES = void 0;
|
||||
const NODE_PROCESS_VERSION_PARTS = process.versions.node.split('.');
|
||||
if (NODE_PROCESS_VERSION_PARTS[0] === undefined || NODE_PROCESS_VERSION_PARTS[1] === undefined) {
|
||||
throw new Error(`Unexpected behavior. The 'process.versions.node' variable has invalid value: ${process.versions.node}`);
|
||||
}
|
||||
const MAJOR_VERSION = Number.parseInt(NODE_PROCESS_VERSION_PARTS[0], 10);
|
||||
const MINOR_VERSION = Number.parseInt(NODE_PROCESS_VERSION_PARTS[1], 10);
|
||||
const SUPPORTED_MAJOR_VERSION = 10;
|
||||
const SUPPORTED_MINOR_VERSION = 10;
|
||||
const IS_MATCHED_BY_MAJOR = MAJOR_VERSION > SUPPORTED_MAJOR_VERSION;
|
||||
const IS_MATCHED_BY_MAJOR_AND_MINOR = MAJOR_VERSION === SUPPORTED_MAJOR_VERSION && MINOR_VERSION >= SUPPORTED_MINOR_VERSION;
|
||||
/**
|
||||
* IS `true` for Node.js 10.10 and greater.
|
||||
*/
|
||||
exports.IS_SUPPORT_READDIR_WITH_FILE_TYPES = IS_MATCHED_BY_MAJOR || IS_MATCHED_BY_MAJOR_AND_MINOR;
|
||||
12
node_modules/@nodelib/fs.scandir/out/index.d.ts
generated
vendored
12
node_modules/@nodelib/fs.scandir/out/index.d.ts
generated
vendored
@@ -1,12 +0,0 @@
|
||||
import type { FileSystemAdapter, ReaddirAsynchronousMethod, ReaddirSynchronousMethod } from './adapters/fs';
|
||||
import * as async from './providers/async';
|
||||
import Settings, { Options } from './settings';
|
||||
import type { Dirent, Entry } from './types';
|
||||
declare type AsyncCallback = async.AsyncCallback;
|
||||
declare function scandir(path: string, callback: AsyncCallback): void;
|
||||
declare function scandir(path: string, optionsOrSettings: Options | Settings, callback: AsyncCallback): void;
|
||||
declare namespace scandir {
|
||||
function __promisify__(path: string, optionsOrSettings?: Options | Settings): Promise<Entry[]>;
|
||||
}
|
||||
declare function scandirSync(path: string, optionsOrSettings?: Options | Settings): Entry[];
|
||||
export { scandir, scandirSync, Settings, AsyncCallback, Dirent, Entry, FileSystemAdapter, ReaddirAsynchronousMethod, ReaddirSynchronousMethod, Options };
|
||||
26
node_modules/@nodelib/fs.scandir/out/index.js
generated
vendored
26
node_modules/@nodelib/fs.scandir/out/index.js
generated
vendored
@@ -1,26 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.Settings = exports.scandirSync = exports.scandir = void 0;
|
||||
const async = require("./providers/async");
|
||||
const sync = require("./providers/sync");
|
||||
const settings_1 = require("./settings");
|
||||
exports.Settings = settings_1.default;
|
||||
function scandir(path, optionsOrSettingsOrCallback, callback) {
|
||||
if (typeof optionsOrSettingsOrCallback === 'function') {
|
||||
async.read(path, getSettings(), optionsOrSettingsOrCallback);
|
||||
return;
|
||||
}
|
||||
async.read(path, getSettings(optionsOrSettingsOrCallback), callback);
|
||||
}
|
||||
exports.scandir = scandir;
|
||||
function scandirSync(path, optionsOrSettings) {
|
||||
const settings = getSettings(optionsOrSettings);
|
||||
return sync.read(path, settings);
|
||||
}
|
||||
exports.scandirSync = scandirSync;
|
||||
function getSettings(settingsOrOptions = {}) {
|
||||
if (settingsOrOptions instanceof settings_1.default) {
|
||||
return settingsOrOptions;
|
||||
}
|
||||
return new settings_1.default(settingsOrOptions);
|
||||
}
|
||||
7
node_modules/@nodelib/fs.scandir/out/providers/async.d.ts
generated
vendored
7
node_modules/@nodelib/fs.scandir/out/providers/async.d.ts
generated
vendored
@@ -1,7 +0,0 @@
|
||||
/// <reference types="node" />
|
||||
import type Settings from '../settings';
|
||||
import type { Entry } from '../types';
|
||||
export declare type AsyncCallback = (error: NodeJS.ErrnoException, entries: Entry[]) => void;
|
||||
export declare function read(directory: string, settings: Settings, callback: AsyncCallback): void;
|
||||
export declare function readdirWithFileTypes(directory: string, settings: Settings, callback: AsyncCallback): void;
|
||||
export declare function readdir(directory: string, settings: Settings, callback: AsyncCallback): void;
|
||||
104
node_modules/@nodelib/fs.scandir/out/providers/async.js
generated
vendored
104
node_modules/@nodelib/fs.scandir/out/providers/async.js
generated
vendored
@@ -1,104 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.readdir = exports.readdirWithFileTypes = exports.read = void 0;
|
||||
const fsStat = require("@nodelib/fs.stat");
|
||||
const rpl = require("run-parallel");
|
||||
const constants_1 = require("../constants");
|
||||
const utils = require("../utils");
|
||||
const common = require("./common");
|
||||
function read(directory, settings, callback) {
|
||||
if (!settings.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) {
|
||||
readdirWithFileTypes(directory, settings, callback);
|
||||
return;
|
||||
}
|
||||
readdir(directory, settings, callback);
|
||||
}
|
||||
exports.read = read;
|
||||
function readdirWithFileTypes(directory, settings, callback) {
|
||||
settings.fs.readdir(directory, { withFileTypes: true }, (readdirError, dirents) => {
|
||||
if (readdirError !== null) {
|
||||
callFailureCallback(callback, readdirError);
|
||||
return;
|
||||
}
|
||||
const entries = dirents.map((dirent) => ({
|
||||
dirent,
|
||||
name: dirent.name,
|
||||
path: common.joinPathSegments(directory, dirent.name, settings.pathSegmentSeparator)
|
||||
}));
|
||||
if (!settings.followSymbolicLinks) {
|
||||
callSuccessCallback(callback, entries);
|
||||
return;
|
||||
}
|
||||
const tasks = entries.map((entry) => makeRplTaskEntry(entry, settings));
|
||||
rpl(tasks, (rplError, rplEntries) => {
|
||||
if (rplError !== null) {
|
||||
callFailureCallback(callback, rplError);
|
||||
return;
|
||||
}
|
||||
callSuccessCallback(callback, rplEntries);
|
||||
});
|
||||
});
|
||||
}
|
||||
exports.readdirWithFileTypes = readdirWithFileTypes;
|
||||
function makeRplTaskEntry(entry, settings) {
|
||||
return (done) => {
|
||||
if (!entry.dirent.isSymbolicLink()) {
|
||||
done(null, entry);
|
||||
return;
|
||||
}
|
||||
settings.fs.stat(entry.path, (statError, stats) => {
|
||||
if (statError !== null) {
|
||||
if (settings.throwErrorOnBrokenSymbolicLink) {
|
||||
done(statError);
|
||||
return;
|
||||
}
|
||||
done(null, entry);
|
||||
return;
|
||||
}
|
||||
entry.dirent = utils.fs.createDirentFromStats(entry.name, stats);
|
||||
done(null, entry);
|
||||
});
|
||||
};
|
||||
}
|
||||
function readdir(directory, settings, callback) {
|
||||
settings.fs.readdir(directory, (readdirError, names) => {
|
||||
if (readdirError !== null) {
|
||||
callFailureCallback(callback, readdirError);
|
||||
return;
|
||||
}
|
||||
const tasks = names.map((name) => {
|
||||
const path = common.joinPathSegments(directory, name, settings.pathSegmentSeparator);
|
||||
return (done) => {
|
||||
fsStat.stat(path, settings.fsStatSettings, (error, stats) => {
|
||||
if (error !== null) {
|
||||
done(error);
|
||||
return;
|
||||
}
|
||||
const entry = {
|
||||
name,
|
||||
path,
|
||||
dirent: utils.fs.createDirentFromStats(name, stats)
|
||||
};
|
||||
if (settings.stats) {
|
||||
entry.stats = stats;
|
||||
}
|
||||
done(null, entry);
|
||||
});
|
||||
};
|
||||
});
|
||||
rpl(tasks, (rplError, entries) => {
|
||||
if (rplError !== null) {
|
||||
callFailureCallback(callback, rplError);
|
||||
return;
|
||||
}
|
||||
callSuccessCallback(callback, entries);
|
||||
});
|
||||
});
|
||||
}
|
||||
exports.readdir = readdir;
|
||||
function callFailureCallback(callback, error) {
|
||||
callback(error);
|
||||
}
|
||||
function callSuccessCallback(callback, result) {
|
||||
callback(null, result);
|
||||
}
|
||||
1
node_modules/@nodelib/fs.scandir/out/providers/common.d.ts
generated
vendored
1
node_modules/@nodelib/fs.scandir/out/providers/common.d.ts
generated
vendored
@@ -1 +0,0 @@
|
||||
export declare function joinPathSegments(a: string, b: string, separator: string): string;
|
||||
13
node_modules/@nodelib/fs.scandir/out/providers/common.js
generated
vendored
13
node_modules/@nodelib/fs.scandir/out/providers/common.js
generated
vendored
@@ -1,13 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.joinPathSegments = void 0;
|
||||
function joinPathSegments(a, b, separator) {
|
||||
/**
|
||||
* The correct handling of cases when the first segment is a root (`/`, `C:/`) or UNC path (`//?/C:/`).
|
||||
*/
|
||||
if (a.endsWith(separator)) {
|
||||
return a + b;
|
||||
}
|
||||
return a + separator + b;
|
||||
}
|
||||
exports.joinPathSegments = joinPathSegments;
|
||||
5
node_modules/@nodelib/fs.scandir/out/providers/sync.d.ts
generated
vendored
5
node_modules/@nodelib/fs.scandir/out/providers/sync.d.ts
generated
vendored
@@ -1,5 +0,0 @@
|
||||
import type Settings from '../settings';
|
||||
import type { Entry } from '../types';
|
||||
export declare function read(directory: string, settings: Settings): Entry[];
|
||||
export declare function readdirWithFileTypes(directory: string, settings: Settings): Entry[];
|
||||
export declare function readdir(directory: string, settings: Settings): Entry[];
|
||||
54
node_modules/@nodelib/fs.scandir/out/providers/sync.js
generated
vendored
54
node_modules/@nodelib/fs.scandir/out/providers/sync.js
generated
vendored
@@ -1,54 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.readdir = exports.readdirWithFileTypes = exports.read = void 0;
|
||||
const fsStat = require("@nodelib/fs.stat");
|
||||
const constants_1 = require("../constants");
|
||||
const utils = require("../utils");
|
||||
const common = require("./common");
|
||||
function read(directory, settings) {
|
||||
if (!settings.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) {
|
||||
return readdirWithFileTypes(directory, settings);
|
||||
}
|
||||
return readdir(directory, settings);
|
||||
}
|
||||
exports.read = read;
|
||||
function readdirWithFileTypes(directory, settings) {
|
||||
const dirents = settings.fs.readdirSync(directory, { withFileTypes: true });
|
||||
return dirents.map((dirent) => {
|
||||
const entry = {
|
||||
dirent,
|
||||
name: dirent.name,
|
||||
path: common.joinPathSegments(directory, dirent.name, settings.pathSegmentSeparator)
|
||||
};
|
||||
if (entry.dirent.isSymbolicLink() && settings.followSymbolicLinks) {
|
||||
try {
|
||||
const stats = settings.fs.statSync(entry.path);
|
||||
entry.dirent = utils.fs.createDirentFromStats(entry.name, stats);
|
||||
}
|
||||
catch (error) {
|
||||
if (settings.throwErrorOnBrokenSymbolicLink) {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
}
|
||||
return entry;
|
||||
});
|
||||
}
|
||||
exports.readdirWithFileTypes = readdirWithFileTypes;
|
||||
function readdir(directory, settings) {
|
||||
const names = settings.fs.readdirSync(directory);
|
||||
return names.map((name) => {
|
||||
const entryPath = common.joinPathSegments(directory, name, settings.pathSegmentSeparator);
|
||||
const stats = fsStat.statSync(entryPath, settings.fsStatSettings);
|
||||
const entry = {
|
||||
name,
|
||||
path: entryPath,
|
||||
dirent: utils.fs.createDirentFromStats(name, stats)
|
||||
};
|
||||
if (settings.stats) {
|
||||
entry.stats = stats;
|
||||
}
|
||||
return entry;
|
||||
});
|
||||
}
|
||||
exports.readdir = readdir;
|
||||
20
node_modules/@nodelib/fs.scandir/out/settings.d.ts
generated
vendored
20
node_modules/@nodelib/fs.scandir/out/settings.d.ts
generated
vendored
@@ -1,20 +0,0 @@
|
||||
import * as fsStat from '@nodelib/fs.stat';
|
||||
import * as fs from './adapters/fs';
|
||||
export interface Options {
|
||||
followSymbolicLinks?: boolean;
|
||||
fs?: Partial<fs.FileSystemAdapter>;
|
||||
pathSegmentSeparator?: string;
|
||||
stats?: boolean;
|
||||
throwErrorOnBrokenSymbolicLink?: boolean;
|
||||
}
|
||||
export default class Settings {
|
||||
private readonly _options;
|
||||
readonly followSymbolicLinks: boolean;
|
||||
readonly fs: fs.FileSystemAdapter;
|
||||
readonly pathSegmentSeparator: string;
|
||||
readonly stats: boolean;
|
||||
readonly throwErrorOnBrokenSymbolicLink: boolean;
|
||||
readonly fsStatSettings: fsStat.Settings;
|
||||
constructor(_options?: Options);
|
||||
private _getValue;
|
||||
}
|
||||
24
node_modules/@nodelib/fs.scandir/out/settings.js
generated
vendored
24
node_modules/@nodelib/fs.scandir/out/settings.js
generated
vendored
@@ -1,24 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const path = require("path");
|
||||
const fsStat = require("@nodelib/fs.stat");
|
||||
const fs = require("./adapters/fs");
|
||||
class Settings {
|
||||
constructor(_options = {}) {
|
||||
this._options = _options;
|
||||
this.followSymbolicLinks = this._getValue(this._options.followSymbolicLinks, false);
|
||||
this.fs = fs.createFileSystemAdapter(this._options.fs);
|
||||
this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path.sep);
|
||||
this.stats = this._getValue(this._options.stats, false);
|
||||
this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, true);
|
||||
this.fsStatSettings = new fsStat.Settings({
|
||||
followSymbolicLink: this.followSymbolicLinks,
|
||||
fs: this.fs,
|
||||
throwErrorOnBrokenSymbolicLink: this.throwErrorOnBrokenSymbolicLink
|
||||
});
|
||||
}
|
||||
_getValue(option, value) {
|
||||
return option !== null && option !== void 0 ? option : value;
|
||||
}
|
||||
}
|
||||
exports.default = Settings;
|
||||
20
node_modules/@nodelib/fs.scandir/out/types/index.d.ts
generated
vendored
20
node_modules/@nodelib/fs.scandir/out/types/index.d.ts
generated
vendored
@@ -1,20 +0,0 @@
|
||||
/// <reference types="node" />
|
||||
import type * as fs from 'fs';
|
||||
export interface Entry {
|
||||
dirent: Dirent;
|
||||
name: string;
|
||||
path: string;
|
||||
stats?: Stats;
|
||||
}
|
||||
export declare type Stats = fs.Stats;
|
||||
export declare type ErrnoException = NodeJS.ErrnoException;
|
||||
export interface Dirent {
|
||||
isBlockDevice: () => boolean;
|
||||
isCharacterDevice: () => boolean;
|
||||
isDirectory: () => boolean;
|
||||
isFIFO: () => boolean;
|
||||
isFile: () => boolean;
|
||||
isSocket: () => boolean;
|
||||
isSymbolicLink: () => boolean;
|
||||
name: string;
|
||||
}
|
||||
2
node_modules/@nodelib/fs.scandir/out/types/index.js
generated
vendored
2
node_modules/@nodelib/fs.scandir/out/types/index.js
generated
vendored
@@ -1,2 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
2
node_modules/@nodelib/fs.scandir/out/utils/fs.d.ts
generated
vendored
2
node_modules/@nodelib/fs.scandir/out/utils/fs.d.ts
generated
vendored
@@ -1,2 +0,0 @@
|
||||
import type { Dirent, Stats } from '../types';
|
||||
export declare function createDirentFromStats(name: string, stats: Stats): Dirent;
|
||||
19
node_modules/@nodelib/fs.scandir/out/utils/fs.js
generated
vendored
19
node_modules/@nodelib/fs.scandir/out/utils/fs.js
generated
vendored
@@ -1,19 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.createDirentFromStats = void 0;
|
||||
class DirentFromStats {
|
||||
constructor(name, stats) {
|
||||
this.name = name;
|
||||
this.isBlockDevice = stats.isBlockDevice.bind(stats);
|
||||
this.isCharacterDevice = stats.isCharacterDevice.bind(stats);
|
||||
this.isDirectory = stats.isDirectory.bind(stats);
|
||||
this.isFIFO = stats.isFIFO.bind(stats);
|
||||
this.isFile = stats.isFile.bind(stats);
|
||||
this.isSocket = stats.isSocket.bind(stats);
|
||||
this.isSymbolicLink = stats.isSymbolicLink.bind(stats);
|
||||
}
|
||||
}
|
||||
function createDirentFromStats(name, stats) {
|
||||
return new DirentFromStats(name, stats);
|
||||
}
|
||||
exports.createDirentFromStats = createDirentFromStats;
|
||||
2
node_modules/@nodelib/fs.scandir/out/utils/index.d.ts
generated
vendored
2
node_modules/@nodelib/fs.scandir/out/utils/index.d.ts
generated
vendored
@@ -1,2 +0,0 @@
|
||||
import * as fs from './fs';
|
||||
export { fs };
|
||||
5
node_modules/@nodelib/fs.scandir/out/utils/index.js
generated
vendored
5
node_modules/@nodelib/fs.scandir/out/utils/index.js
generated
vendored
@@ -1,5 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.fs = void 0;
|
||||
const fs = require("./fs");
|
||||
exports.fs = fs;
|
||||
44
node_modules/@nodelib/fs.scandir/package.json
generated
vendored
44
node_modules/@nodelib/fs.scandir/package.json
generated
vendored
@@ -1,44 +0,0 @@
|
||||
{
|
||||
"name": "@nodelib/fs.scandir",
|
||||
"version": "2.1.5",
|
||||
"description": "List files and directories inside the specified directory",
|
||||
"license": "MIT",
|
||||
"repository": "https://github.com/nodelib/nodelib/tree/master/packages/fs/fs.scandir",
|
||||
"keywords": [
|
||||
"NodeLib",
|
||||
"fs",
|
||||
"FileSystem",
|
||||
"file system",
|
||||
"scandir",
|
||||
"readdir",
|
||||
"dirent"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">= 8"
|
||||
},
|
||||
"files": [
|
||||
"out/**",
|
||||
"!out/**/*.map",
|
||||
"!out/**/*.spec.*"
|
||||
],
|
||||
"main": "out/index.js",
|
||||
"typings": "out/index.d.ts",
|
||||
"scripts": {
|
||||
"clean": "rimraf {tsconfig.tsbuildinfo,out}",
|
||||
"lint": "eslint \"src/**/*.ts\" --cache",
|
||||
"compile": "tsc -b .",
|
||||
"compile:watch": "tsc -p . --watch --sourceMap",
|
||||
"test": "mocha \"out/**/*.spec.js\" -s 0",
|
||||
"build": "npm run clean && npm run compile && npm run lint && npm test",
|
||||
"watch": "npm run clean && npm run compile:watch"
|
||||
},
|
||||
"dependencies": {
|
||||
"@nodelib/fs.stat": "2.0.5",
|
||||
"run-parallel": "^1.1.9"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@nodelib/fs.macchiato": "1.0.4",
|
||||
"@types/run-parallel": "^1.1.0"
|
||||
},
|
||||
"gitHead": "d6a7960d5281d3dd5f8e2efba49bb552d090f562"
|
||||
}
|
||||
21
node_modules/@nodelib/fs.stat/LICENSE
generated
vendored
21
node_modules/@nodelib/fs.stat/LICENSE
generated
vendored
@@ -1,21 +0,0 @@
|
||||
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.
|
||||
126
node_modules/@nodelib/fs.stat/README.md
generated
vendored
126
node_modules/@nodelib/fs.stat/README.md
generated
vendored
@@ -1,126 +0,0 @@
|
||||
# @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.
|
||||
13
node_modules/@nodelib/fs.stat/out/adapters/fs.d.ts
generated
vendored
13
node_modules/@nodelib/fs.stat/out/adapters/fs.d.ts
generated
vendored
@@ -1,13 +0,0 @@
|
||||
/// <reference types="node" />
|
||||
import * as fs from 'fs';
|
||||
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;
|
||||
17
node_modules/@nodelib/fs.stat/out/adapters/fs.js
generated
vendored
17
node_modules/@nodelib/fs.stat/out/adapters/fs.js
generated
vendored
@@ -1,17 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.createFileSystemAdapter = exports.FILE_SYSTEM_ADAPTER = void 0;
|
||||
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;
|
||||
12
node_modules/@nodelib/fs.stat/out/index.d.ts
generated
vendored
12
node_modules/@nodelib/fs.stat/out/index.d.ts
generated
vendored
@@ -1,12 +0,0 @@
|
||||
import type { FileSystemAdapter, StatAsynchronousMethod, StatSynchronousMethod } from './adapters/fs';
|
||||
import * as async from './providers/async';
|
||||
import Settings, { Options } from './settings';
|
||||
import type { 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, StatAsynchronousMethod, StatSynchronousMethod, Options, Stats };
|
||||
26
node_modules/@nodelib/fs.stat/out/index.js
generated
vendored
26
node_modules/@nodelib/fs.stat/out/index.js
generated
vendored
@@ -1,26 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.statSync = exports.stat = exports.Settings = void 0;
|
||||
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') {
|
||||
async.read(path, getSettings(), optionsOrSettingsOrCallback);
|
||||
return;
|
||||
}
|
||||
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);
|
||||
}
|
||||
4
node_modules/@nodelib/fs.stat/out/providers/async.d.ts
generated
vendored
4
node_modules/@nodelib/fs.stat/out/providers/async.d.ts
generated
vendored
@@ -1,4 +0,0 @@
|
||||
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;
|
||||
36
node_modules/@nodelib/fs.stat/out/providers/async.js
generated
vendored
36
node_modules/@nodelib/fs.stat/out/providers/async.js
generated
vendored
@@ -1,36 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.read = void 0;
|
||||
function read(path, settings, callback) {
|
||||
settings.fs.lstat(path, (lstatError, lstat) => {
|
||||
if (lstatError !== null) {
|
||||
callFailureCallback(callback, lstatError);
|
||||
return;
|
||||
}
|
||||
if (!lstat.isSymbolicLink() || !settings.followSymbolicLink) {
|
||||
callSuccessCallback(callback, lstat);
|
||||
return;
|
||||
}
|
||||
settings.fs.stat(path, (statError, stat) => {
|
||||
if (statError !== null) {
|
||||
if (settings.throwErrorOnBrokenSymbolicLink) {
|
||||
callFailureCallback(callback, statError);
|
||||
return;
|
||||
}
|
||||
callSuccessCallback(callback, lstat);
|
||||
return;
|
||||
}
|
||||
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);
|
||||
}
|
||||
3
node_modules/@nodelib/fs.stat/out/providers/sync.d.ts
generated
vendored
3
node_modules/@nodelib/fs.stat/out/providers/sync.d.ts
generated
vendored
@@ -1,3 +0,0 @@
|
||||
import type Settings from '../settings';
|
||||
import type { Stats } from '../types';
|
||||
export declare function read(path: string, settings: Settings): Stats;
|
||||
23
node_modules/@nodelib/fs.stat/out/providers/sync.js
generated
vendored
23
node_modules/@nodelib/fs.stat/out/providers/sync.js
generated
vendored
@@ -1,23 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.read = void 0;
|
||||
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;
|
||||
16
node_modules/@nodelib/fs.stat/out/settings.d.ts
generated
vendored
16
node_modules/@nodelib/fs.stat/out/settings.d.ts
generated
vendored
@@ -1,16 +0,0 @@
|
||||
import * as fs from './adapters/fs';
|
||||
export interface 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;
|
||||
}
|
||||
16
node_modules/@nodelib/fs.stat/out/settings.js
generated
vendored
16
node_modules/@nodelib/fs.stat/out/settings.js
generated
vendored
@@ -1,16 +0,0 @@
|
||||
"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 !== null && option !== void 0 ? option : value;
|
||||
}
|
||||
}
|
||||
exports.default = Settings;
|
||||
4
node_modules/@nodelib/fs.stat/out/types/index.d.ts
generated
vendored
4
node_modules/@nodelib/fs.stat/out/types/index.d.ts
generated
vendored
@@ -1,4 +0,0 @@
|
||||
/// <reference types="node" />
|
||||
import type * as fs from 'fs';
|
||||
export declare type Stats = fs.Stats;
|
||||
export declare type ErrnoException = NodeJS.ErrnoException;
|
||||
2
node_modules/@nodelib/fs.stat/out/types/index.js
generated
vendored
2
node_modules/@nodelib/fs.stat/out/types/index.js
generated
vendored
@@ -1,2 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
37
node_modules/@nodelib/fs.stat/package.json
generated
vendored
37
node_modules/@nodelib/fs.stat/package.json
generated
vendored
@@ -1,37 +0,0 @@
|
||||
{
|
||||
"name": "@nodelib/fs.stat",
|
||||
"version": "2.0.5",
|
||||
"description": "Get the status of a file with some features",
|
||||
"license": "MIT",
|
||||
"repository": "https://github.com/nodelib/nodelib/tree/master/packages/fs/fs.stat",
|
||||
"keywords": [
|
||||
"NodeLib",
|
||||
"fs",
|
||||
"FileSystem",
|
||||
"file system",
|
||||
"stat"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">= 8"
|
||||
},
|
||||
"files": [
|
||||
"out/**",
|
||||
"!out/**/*.map",
|
||||
"!out/**/*.spec.*"
|
||||
],
|
||||
"main": "out/index.js",
|
||||
"typings": "out/index.d.ts",
|
||||
"scripts": {
|
||||
"clean": "rimraf {tsconfig.tsbuildinfo,out}",
|
||||
"lint": "eslint \"src/**/*.ts\" --cache",
|
||||
"compile": "tsc -b .",
|
||||
"compile:watch": "tsc -p . --watch --sourceMap",
|
||||
"test": "mocha \"out/**/*.spec.js\" -s 0",
|
||||
"build": "npm run clean && npm run compile && npm run lint && npm test",
|
||||
"watch": "npm run clean && npm run compile:watch"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@nodelib/fs.macchiato": "1.0.4"
|
||||
},
|
||||
"gitHead": "d6a7960d5281d3dd5f8e2efba49bb552d090f562"
|
||||
}
|
||||
21
node_modules/@nodelib/fs.walk/LICENSE
generated
vendored
21
node_modules/@nodelib/fs.walk/LICENSE
generated
vendored
@@ -1,21 +0,0 @@
|
||||
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.
|
||||
215
node_modules/@nodelib/fs.walk/README.md
generated
vendored
215
node_modules/@nodelib/fs.walk/README.md
generated
vendored
@@ -1,215 +0,0 @@
|
||||
# @nodelib/fs.walk
|
||||
|
||||
> A library for efficiently walking a directory recursively.
|
||||
|
||||
## :bulb: Highlights
|
||||
|
||||
* :moneybag: Returns useful information: `name`, `path`, `dirent` and `stats` (optional).
|
||||
* :rocket: On Node.js 10.10+ uses the mechanism without additional calls to determine the entry type for performance reasons. See [`old` and `modern` mode](https://github.com/nodelib/nodelib/blob/master/packages/fs/fs.scandir/README.md#old-and-modern-mode).
|
||||
* :gear: Built-in directories/files and error filtering system.
|
||||
* :link: Can safely work with broken symbolic links.
|
||||
|
||||
## Install
|
||||
|
||||
```console
|
||||
npm install @nodelib/fs.walk
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```ts
|
||||
import * as fsWalk from '@nodelib/fs.walk';
|
||||
|
||||
fsWalk.walk('path', (error, entries) => { /* … */ });
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
### .walk(path, [optionsOrSettings], callback)
|
||||
|
||||
Reads the directory recursively and asynchronously. Requires a callback function.
|
||||
|
||||
> :book: If you want to use the Promise API, use `util.promisify`.
|
||||
|
||||
```ts
|
||||
fsWalk.walk('path', (error, entries) => { /* … */ });
|
||||
fsWalk.walk('path', {}, (error, entries) => { /* … */ });
|
||||
fsWalk.walk('path', new fsWalk.Settings(), (error, entries) => { /* … */ });
|
||||
```
|
||||
|
||||
### .walkStream(path, [optionsOrSettings])
|
||||
|
||||
Reads the directory recursively and asynchronously. [Readable Stream](https://nodejs.org/dist/latest-v12.x/docs/api/stream.html#stream_readable_streams) is used as a provider.
|
||||
|
||||
```ts
|
||||
const stream = fsWalk.walkStream('path');
|
||||
const stream = fsWalk.walkStream('path', {});
|
||||
const stream = fsWalk.walkStream('path', new fsWalk.Settings());
|
||||
```
|
||||
|
||||
### .walkSync(path, [optionsOrSettings])
|
||||
|
||||
Reads the directory recursively and synchronously. Returns an array of entries.
|
||||
|
||||
```ts
|
||||
const entries = fsWalk.walkSync('path');
|
||||
const entries = fsWalk.walkSync('path', {});
|
||||
const entries = fsWalk.walkSync('path', new fsWalk.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 fsWalk.Settings({ followSymbolicLinks: true });
|
||||
|
||||
const entries = fsWalk.walkSync('path', settings);
|
||||
```
|
||||
|
||||
## Entry
|
||||
|
||||
* `name` — The name of the entry (`unknown.txt`).
|
||||
* `path` — The path of the entry relative to call directory (`root/unknown.txt`).
|
||||
* `dirent` — An instance of [`fs.Dirent`](./src/types/index.ts) class.
|
||||
* [`stats`] — An instance of `fs.Stats` class.
|
||||
|
||||
## Options
|
||||
|
||||
### basePath
|
||||
|
||||
* Type: `string`
|
||||
* Default: `undefined`
|
||||
|
||||
By default, all paths are built relative to the root path. You can use this option to set custom root path.
|
||||
|
||||
In the example below we read the files from the `root` directory, but in the results the root path will be `custom`.
|
||||
|
||||
```ts
|
||||
fsWalk.walkSync('root'); // → ['root/file.txt']
|
||||
fsWalk.walkSync('root', { basePath: 'custom' }); // → ['custom/file.txt']
|
||||
```
|
||||
|
||||
### concurrency
|
||||
|
||||
* Type: `number`
|
||||
* Default: `Infinity`
|
||||
|
||||
The maximum number of concurrent calls to `fs.readdir`.
|
||||
|
||||
> :book: The higher the number, the higher performance and the load on the File System. If you want to read in quiet mode, set the value to `4 * os.cpus().length` (4 is default size of [thread pool work scheduling](http://docs.libuv.org/en/v1.x/threadpool.html#thread-pool-work-scheduling)).
|
||||
|
||||
### deepFilter
|
||||
|
||||
* Type: [`DeepFilterFunction`](./src/settings.ts)
|
||||
* Default: `undefined`
|
||||
|
||||
A function that indicates whether the directory will be read deep or not.
|
||||
|
||||
```ts
|
||||
// Skip all directories that starts with `node_modules`
|
||||
const filter: DeepFilterFunction = (entry) => !entry.path.startsWith('node_modules');
|
||||
```
|
||||
|
||||
### entryFilter
|
||||
|
||||
* Type: [`EntryFilterFunction`](./src/settings.ts)
|
||||
* Default: `undefined`
|
||||
|
||||
A function that indicates whether the entry will be included to results or not.
|
||||
|
||||
```ts
|
||||
// Exclude all `.js` files from results
|
||||
const filter: EntryFilterFunction = (entry) => !entry.name.endsWith('.js');
|
||||
```
|
||||
|
||||
### errorFilter
|
||||
|
||||
* Type: [`ErrorFilterFunction`](./src/settings.ts)
|
||||
* Default: `undefined`
|
||||
|
||||
A function that allows you to skip errors that occur when reading directories.
|
||||
|
||||
For example, you can skip `ENOENT` errors if required:
|
||||
|
||||
```ts
|
||||
// Skip all ENOENT errors
|
||||
const filter: ErrorFilterFunction = (error) => error.code == 'ENOENT';
|
||||
```
|
||||
|
||||
### stats
|
||||
|
||||
* Type: `boolean`
|
||||
* Default: `false`
|
||||
|
||||
Adds an instance of `fs.Stats` class to the [`Entry`](#entry).
|
||||
|
||||
> :book: Always use `fs.readdir` with additional `fs.lstat/fs.stat` calls to determine the entry type.
|
||||
|
||||
### followSymbolicLinks
|
||||
|
||||
* Type: `boolean`
|
||||
* Default: `false`
|
||||
|
||||
Follow symbolic links or not. Call `fs.stat` on symbolic link if `true`.
|
||||
|
||||
### `throwErrorOnBrokenSymbolicLink`
|
||||
|
||||
* Type: `boolean`
|
||||
* Default: `true`
|
||||
|
||||
Throw an error when symbolic link is broken if `true` or safely return `lstat` call if `false`.
|
||||
|
||||
### `pathSegmentSeparator`
|
||||
|
||||
* Type: `string`
|
||||
* Default: `path.sep`
|
||||
|
||||
By default, this package uses the correct path separator for your OS (`\` on Windows, `/` on Unix-like systems). But you can set this option to any separator character(s) that you want to use instead.
|
||||
|
||||
### `fs`
|
||||
|
||||
* Type: `FileSystemAdapter`
|
||||
* 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;
|
||||
readdir: typeof fs.readdir;
|
||||
readdirSync: typeof fs.readdirSync;
|
||||
}
|
||||
|
||||
const settings = new fsWalk.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.
|
||||
14
node_modules/@nodelib/fs.walk/out/index.d.ts
generated
vendored
14
node_modules/@nodelib/fs.walk/out/index.d.ts
generated
vendored
@@ -1,14 +0,0 @@
|
||||
/// <reference types="node" />
|
||||
import type { Readable } from 'stream';
|
||||
import type { Dirent, FileSystemAdapter } from '@nodelib/fs.scandir';
|
||||
import { AsyncCallback } from './providers/async';
|
||||
import Settings, { DeepFilterFunction, EntryFilterFunction, ErrorFilterFunction, Options } from './settings';
|
||||
import type { Entry } from './types';
|
||||
declare function walk(directory: string, callback: AsyncCallback): void;
|
||||
declare function walk(directory: string, optionsOrSettings: Options | Settings, callback: AsyncCallback): void;
|
||||
declare namespace walk {
|
||||
function __promisify__(directory: string, optionsOrSettings?: Options | Settings): Promise<Entry[]>;
|
||||
}
|
||||
declare function walkSync(directory: string, optionsOrSettings?: Options | Settings): Entry[];
|
||||
declare function walkStream(directory: string, optionsOrSettings?: Options | Settings): Readable;
|
||||
export { walk, walkSync, walkStream, Settings, AsyncCallback, Dirent, Entry, FileSystemAdapter, Options, DeepFilterFunction, EntryFilterFunction, ErrorFilterFunction };
|
||||
34
node_modules/@nodelib/fs.walk/out/index.js
generated
vendored
34
node_modules/@nodelib/fs.walk/out/index.js
generated
vendored
@@ -1,34 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.Settings = exports.walkStream = exports.walkSync = exports.walk = void 0;
|
||||
const async_1 = require("./providers/async");
|
||||
const stream_1 = require("./providers/stream");
|
||||
const sync_1 = require("./providers/sync");
|
||||
const settings_1 = require("./settings");
|
||||
exports.Settings = settings_1.default;
|
||||
function walk(directory, optionsOrSettingsOrCallback, callback) {
|
||||
if (typeof optionsOrSettingsOrCallback === 'function') {
|
||||
new async_1.default(directory, getSettings()).read(optionsOrSettingsOrCallback);
|
||||
return;
|
||||
}
|
||||
new async_1.default(directory, getSettings(optionsOrSettingsOrCallback)).read(callback);
|
||||
}
|
||||
exports.walk = walk;
|
||||
function walkSync(directory, optionsOrSettings) {
|
||||
const settings = getSettings(optionsOrSettings);
|
||||
const provider = new sync_1.default(directory, settings);
|
||||
return provider.read();
|
||||
}
|
||||
exports.walkSync = walkSync;
|
||||
function walkStream(directory, optionsOrSettings) {
|
||||
const settings = getSettings(optionsOrSettings);
|
||||
const provider = new stream_1.default(directory, settings);
|
||||
return provider.read();
|
||||
}
|
||||
exports.walkStream = walkStream;
|
||||
function getSettings(settingsOrOptions = {}) {
|
||||
if (settingsOrOptions instanceof settings_1.default) {
|
||||
return settingsOrOptions;
|
||||
}
|
||||
return new settings_1.default(settingsOrOptions);
|
||||
}
|
||||
12
node_modules/@nodelib/fs.walk/out/providers/async.d.ts
generated
vendored
12
node_modules/@nodelib/fs.walk/out/providers/async.d.ts
generated
vendored
@@ -1,12 +0,0 @@
|
||||
import AsyncReader from '../readers/async';
|
||||
import type Settings from '../settings';
|
||||
import type { Entry, Errno } from '../types';
|
||||
export declare type AsyncCallback = (error: Errno, entries: Entry[]) => void;
|
||||
export default class AsyncProvider {
|
||||
private readonly _root;
|
||||
private readonly _settings;
|
||||
protected readonly _reader: AsyncReader;
|
||||
private readonly _storage;
|
||||
constructor(_root: string, _settings: Settings);
|
||||
read(callback: AsyncCallback): void;
|
||||
}
|
||||
30
node_modules/@nodelib/fs.walk/out/providers/async.js
generated
vendored
30
node_modules/@nodelib/fs.walk/out/providers/async.js
generated
vendored
@@ -1,30 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const async_1 = require("../readers/async");
|
||||
class AsyncProvider {
|
||||
constructor(_root, _settings) {
|
||||
this._root = _root;
|
||||
this._settings = _settings;
|
||||
this._reader = new async_1.default(this._root, this._settings);
|
||||
this._storage = [];
|
||||
}
|
||||
read(callback) {
|
||||
this._reader.onError((error) => {
|
||||
callFailureCallback(callback, error);
|
||||
});
|
||||
this._reader.onEntry((entry) => {
|
||||
this._storage.push(entry);
|
||||
});
|
||||
this._reader.onEnd(() => {
|
||||
callSuccessCallback(callback, this._storage);
|
||||
});
|
||||
this._reader.read();
|
||||
}
|
||||
}
|
||||
exports.default = AsyncProvider;
|
||||
function callFailureCallback(callback, error) {
|
||||
callback(error);
|
||||
}
|
||||
function callSuccessCallback(callback, entries) {
|
||||
callback(null, entries);
|
||||
}
|
||||
4
node_modules/@nodelib/fs.walk/out/providers/index.d.ts
generated
vendored
4
node_modules/@nodelib/fs.walk/out/providers/index.d.ts
generated
vendored
@@ -1,4 +0,0 @@
|
||||
import AsyncProvider from './async';
|
||||
import StreamProvider from './stream';
|
||||
import SyncProvider from './sync';
|
||||
export { AsyncProvider, StreamProvider, SyncProvider };
|
||||
9
node_modules/@nodelib/fs.walk/out/providers/index.js
generated
vendored
9
node_modules/@nodelib/fs.walk/out/providers/index.js
generated
vendored
@@ -1,9 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.SyncProvider = exports.StreamProvider = exports.AsyncProvider = void 0;
|
||||
const async_1 = require("./async");
|
||||
exports.AsyncProvider = async_1.default;
|
||||
const stream_1 = require("./stream");
|
||||
exports.StreamProvider = stream_1.default;
|
||||
const sync_1 = require("./sync");
|
||||
exports.SyncProvider = sync_1.default;
|
||||
12
node_modules/@nodelib/fs.walk/out/providers/stream.d.ts
generated
vendored
12
node_modules/@nodelib/fs.walk/out/providers/stream.d.ts
generated
vendored
@@ -1,12 +0,0 @@
|
||||
/// <reference types="node" />
|
||||
import { Readable } from 'stream';
|
||||
import AsyncReader from '../readers/async';
|
||||
import type Settings from '../settings';
|
||||
export default class StreamProvider {
|
||||
private readonly _root;
|
||||
private readonly _settings;
|
||||
protected readonly _reader: AsyncReader;
|
||||
protected readonly _stream: Readable;
|
||||
constructor(_root: string, _settings: Settings);
|
||||
read(): Readable;
|
||||
}
|
||||
34
node_modules/@nodelib/fs.walk/out/providers/stream.js
generated
vendored
34
node_modules/@nodelib/fs.walk/out/providers/stream.js
generated
vendored
@@ -1,34 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const stream_1 = require("stream");
|
||||
const async_1 = require("../readers/async");
|
||||
class StreamProvider {
|
||||
constructor(_root, _settings) {
|
||||
this._root = _root;
|
||||
this._settings = _settings;
|
||||
this._reader = new async_1.default(this._root, this._settings);
|
||||
this._stream = new stream_1.Readable({
|
||||
objectMode: true,
|
||||
read: () => { },
|
||||
destroy: () => {
|
||||
if (!this._reader.isDestroyed) {
|
||||
this._reader.destroy();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
read() {
|
||||
this._reader.onError((error) => {
|
||||
this._stream.emit('error', error);
|
||||
});
|
||||
this._reader.onEntry((entry) => {
|
||||
this._stream.push(entry);
|
||||
});
|
||||
this._reader.onEnd(() => {
|
||||
this._stream.push(null);
|
||||
});
|
||||
this._reader.read();
|
||||
return this._stream;
|
||||
}
|
||||
}
|
||||
exports.default = StreamProvider;
|
||||
10
node_modules/@nodelib/fs.walk/out/providers/sync.d.ts
generated
vendored
10
node_modules/@nodelib/fs.walk/out/providers/sync.d.ts
generated
vendored
@@ -1,10 +0,0 @@
|
||||
import SyncReader from '../readers/sync';
|
||||
import type Settings from '../settings';
|
||||
import type { Entry } from '../types';
|
||||
export default class SyncProvider {
|
||||
private readonly _root;
|
||||
private readonly _settings;
|
||||
protected readonly _reader: SyncReader;
|
||||
constructor(_root: string, _settings: Settings);
|
||||
read(): Entry[];
|
||||
}
|
||||
14
node_modules/@nodelib/fs.walk/out/providers/sync.js
generated
vendored
14
node_modules/@nodelib/fs.walk/out/providers/sync.js
generated
vendored
@@ -1,14 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const sync_1 = require("../readers/sync");
|
||||
class SyncProvider {
|
||||
constructor(_root, _settings) {
|
||||
this._root = _root;
|
||||
this._settings = _settings;
|
||||
this._reader = new sync_1.default(this._root, this._settings);
|
||||
}
|
||||
read() {
|
||||
return this._reader.read();
|
||||
}
|
||||
}
|
||||
exports.default = SyncProvider;
|
||||
30
node_modules/@nodelib/fs.walk/out/readers/async.d.ts
generated
vendored
30
node_modules/@nodelib/fs.walk/out/readers/async.d.ts
generated
vendored
@@ -1,30 +0,0 @@
|
||||
/// <reference types="node" />
|
||||
import { EventEmitter } from 'events';
|
||||
import * as fsScandir from '@nodelib/fs.scandir';
|
||||
import type Settings from '../settings';
|
||||
import type { Entry, Errno } from '../types';
|
||||
import Reader from './reader';
|
||||
declare type EntryEventCallback = (entry: Entry) => void;
|
||||
declare type ErrorEventCallback = (error: Errno) => void;
|
||||
declare type EndEventCallback = () => void;
|
||||
export default class AsyncReader extends Reader {
|
||||
protected readonly _settings: Settings;
|
||||
protected readonly _scandir: typeof fsScandir.scandir;
|
||||
protected readonly _emitter: EventEmitter;
|
||||
private readonly _queue;
|
||||
private _isFatalError;
|
||||
private _isDestroyed;
|
||||
constructor(_root: string, _settings: Settings);
|
||||
read(): EventEmitter;
|
||||
get isDestroyed(): boolean;
|
||||
destroy(): void;
|
||||
onEntry(callback: EntryEventCallback): void;
|
||||
onError(callback: ErrorEventCallback): void;
|
||||
onEnd(callback: EndEventCallback): void;
|
||||
private _pushToQueue;
|
||||
private _worker;
|
||||
private _handleError;
|
||||
private _handleEntry;
|
||||
private _emitEntry;
|
||||
}
|
||||
export {};
|
||||
97
node_modules/@nodelib/fs.walk/out/readers/async.js
generated
vendored
97
node_modules/@nodelib/fs.walk/out/readers/async.js
generated
vendored
@@ -1,97 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const events_1 = require("events");
|
||||
const fsScandir = require("@nodelib/fs.scandir");
|
||||
const fastq = require("fastq");
|
||||
const common = require("./common");
|
||||
const reader_1 = require("./reader");
|
||||
class AsyncReader extends reader_1.default {
|
||||
constructor(_root, _settings) {
|
||||
super(_root, _settings);
|
||||
this._settings = _settings;
|
||||
this._scandir = fsScandir.scandir;
|
||||
this._emitter = new events_1.EventEmitter();
|
||||
this._queue = fastq(this._worker.bind(this), this._settings.concurrency);
|
||||
this._isFatalError = false;
|
||||
this._isDestroyed = false;
|
||||
this._queue.drain = () => {
|
||||
if (!this._isFatalError) {
|
||||
this._emitter.emit('end');
|
||||
}
|
||||
};
|
||||
}
|
||||
read() {
|
||||
this._isFatalError = false;
|
||||
this._isDestroyed = false;
|
||||
setImmediate(() => {
|
||||
this._pushToQueue(this._root, this._settings.basePath);
|
||||
});
|
||||
return this._emitter;
|
||||
}
|
||||
get isDestroyed() {
|
||||
return this._isDestroyed;
|
||||
}
|
||||
destroy() {
|
||||
if (this._isDestroyed) {
|
||||
throw new Error('The reader is already destroyed');
|
||||
}
|
||||
this._isDestroyed = true;
|
||||
this._queue.killAndDrain();
|
||||
}
|
||||
onEntry(callback) {
|
||||
this._emitter.on('entry', callback);
|
||||
}
|
||||
onError(callback) {
|
||||
this._emitter.once('error', callback);
|
||||
}
|
||||
onEnd(callback) {
|
||||
this._emitter.once('end', callback);
|
||||
}
|
||||
_pushToQueue(directory, base) {
|
||||
const queueItem = { directory, base };
|
||||
this._queue.push(queueItem, (error) => {
|
||||
if (error !== null) {
|
||||
this._handleError(error);
|
||||
}
|
||||
});
|
||||
}
|
||||
_worker(item, done) {
|
||||
this._scandir(item.directory, this._settings.fsScandirSettings, (error, entries) => {
|
||||
if (error !== null) {
|
||||
done(error, undefined);
|
||||
return;
|
||||
}
|
||||
for (const entry of entries) {
|
||||
this._handleEntry(entry, item.base);
|
||||
}
|
||||
done(null, undefined);
|
||||
});
|
||||
}
|
||||
_handleError(error) {
|
||||
if (this._isDestroyed || !common.isFatalError(this._settings, error)) {
|
||||
return;
|
||||
}
|
||||
this._isFatalError = true;
|
||||
this._isDestroyed = true;
|
||||
this._emitter.emit('error', error);
|
||||
}
|
||||
_handleEntry(entry, base) {
|
||||
if (this._isDestroyed || this._isFatalError) {
|
||||
return;
|
||||
}
|
||||
const fullpath = entry.path;
|
||||
if (base !== undefined) {
|
||||
entry.path = common.joinPathSegments(base, entry.name, this._settings.pathSegmentSeparator);
|
||||
}
|
||||
if (common.isAppliedFilter(this._settings.entryFilter, entry)) {
|
||||
this._emitEntry(entry);
|
||||
}
|
||||
if (entry.dirent.isDirectory() && common.isAppliedFilter(this._settings.deepFilter, entry)) {
|
||||
this._pushToQueue(fullpath, base === undefined ? undefined : entry.path);
|
||||
}
|
||||
}
|
||||
_emitEntry(entry) {
|
||||
this._emitter.emit('entry', entry);
|
||||
}
|
||||
}
|
||||
exports.default = AsyncReader;
|
||||
7
node_modules/@nodelib/fs.walk/out/readers/common.d.ts
generated
vendored
7
node_modules/@nodelib/fs.walk/out/readers/common.d.ts
generated
vendored
@@ -1,7 +0,0 @@
|
||||
import type { FilterFunction } from '../settings';
|
||||
import type Settings from '../settings';
|
||||
import type { Errno } from '../types';
|
||||
export declare function isFatalError(settings: Settings, error: Errno): boolean;
|
||||
export declare function isAppliedFilter<T>(filter: FilterFunction<T> | null, value: T): boolean;
|
||||
export declare function replacePathSegmentSeparator(filepath: string, separator: string): string;
|
||||
export declare function joinPathSegments(a: string, b: string, separator: string): string;
|
||||
31
node_modules/@nodelib/fs.walk/out/readers/common.js
generated
vendored
31
node_modules/@nodelib/fs.walk/out/readers/common.js
generated
vendored
@@ -1,31 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.joinPathSegments = exports.replacePathSegmentSeparator = exports.isAppliedFilter = exports.isFatalError = void 0;
|
||||
function isFatalError(settings, error) {
|
||||
if (settings.errorFilter === null) {
|
||||
return true;
|
||||
}
|
||||
return !settings.errorFilter(error);
|
||||
}
|
||||
exports.isFatalError = isFatalError;
|
||||
function isAppliedFilter(filter, value) {
|
||||
return filter === null || filter(value);
|
||||
}
|
||||
exports.isAppliedFilter = isAppliedFilter;
|
||||
function replacePathSegmentSeparator(filepath, separator) {
|
||||
return filepath.split(/[/\\]/).join(separator);
|
||||
}
|
||||
exports.replacePathSegmentSeparator = replacePathSegmentSeparator;
|
||||
function joinPathSegments(a, b, separator) {
|
||||
if (a === '') {
|
||||
return b;
|
||||
}
|
||||
/**
|
||||
* The correct handling of cases when the first segment is a root (`/`, `C:/`) or UNC path (`//?/C:/`).
|
||||
*/
|
||||
if (a.endsWith(separator)) {
|
||||
return a + b;
|
||||
}
|
||||
return a + separator + b;
|
||||
}
|
||||
exports.joinPathSegments = joinPathSegments;
|
||||
6
node_modules/@nodelib/fs.walk/out/readers/reader.d.ts
generated
vendored
6
node_modules/@nodelib/fs.walk/out/readers/reader.d.ts
generated
vendored
@@ -1,6 +0,0 @@
|
||||
import type Settings from '../settings';
|
||||
export default class Reader {
|
||||
protected readonly _root: string;
|
||||
protected readonly _settings: Settings;
|
||||
constructor(_root: string, _settings: Settings);
|
||||
}
|
||||
11
node_modules/@nodelib/fs.walk/out/readers/reader.js
generated
vendored
11
node_modules/@nodelib/fs.walk/out/readers/reader.js
generated
vendored
@@ -1,11 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const common = require("./common");
|
||||
class Reader {
|
||||
constructor(_root, _settings) {
|
||||
this._root = _root;
|
||||
this._settings = _settings;
|
||||
this._root = common.replacePathSegmentSeparator(_root, _settings.pathSegmentSeparator);
|
||||
}
|
||||
}
|
||||
exports.default = Reader;
|
||||
15
node_modules/@nodelib/fs.walk/out/readers/sync.d.ts
generated
vendored
15
node_modules/@nodelib/fs.walk/out/readers/sync.d.ts
generated
vendored
@@ -1,15 +0,0 @@
|
||||
import * as fsScandir from '@nodelib/fs.scandir';
|
||||
import type { Entry } from '../types';
|
||||
import Reader from './reader';
|
||||
export default class SyncReader extends Reader {
|
||||
protected readonly _scandir: typeof fsScandir.scandirSync;
|
||||
private readonly _storage;
|
||||
private readonly _queue;
|
||||
read(): Entry[];
|
||||
private _pushToQueue;
|
||||
private _handleQueue;
|
||||
private _handleDirectory;
|
||||
private _handleError;
|
||||
private _handleEntry;
|
||||
private _pushToStorage;
|
||||
}
|
||||
59
node_modules/@nodelib/fs.walk/out/readers/sync.js
generated
vendored
59
node_modules/@nodelib/fs.walk/out/readers/sync.js
generated
vendored
@@ -1,59 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const fsScandir = require("@nodelib/fs.scandir");
|
||||
const common = require("./common");
|
||||
const reader_1 = require("./reader");
|
||||
class SyncReader extends reader_1.default {
|
||||
constructor() {
|
||||
super(...arguments);
|
||||
this._scandir = fsScandir.scandirSync;
|
||||
this._storage = [];
|
||||
this._queue = new Set();
|
||||
}
|
||||
read() {
|
||||
this._pushToQueue(this._root, this._settings.basePath);
|
||||
this._handleQueue();
|
||||
return this._storage;
|
||||
}
|
||||
_pushToQueue(directory, base) {
|
||||
this._queue.add({ directory, base });
|
||||
}
|
||||
_handleQueue() {
|
||||
for (const item of this._queue.values()) {
|
||||
this._handleDirectory(item.directory, item.base);
|
||||
}
|
||||
}
|
||||
_handleDirectory(directory, base) {
|
||||
try {
|
||||
const entries = this._scandir(directory, this._settings.fsScandirSettings);
|
||||
for (const entry of entries) {
|
||||
this._handleEntry(entry, base);
|
||||
}
|
||||
}
|
||||
catch (error) {
|
||||
this._handleError(error);
|
||||
}
|
||||
}
|
||||
_handleError(error) {
|
||||
if (!common.isFatalError(this._settings, error)) {
|
||||
return;
|
||||
}
|
||||
throw error;
|
||||
}
|
||||
_handleEntry(entry, base) {
|
||||
const fullpath = entry.path;
|
||||
if (base !== undefined) {
|
||||
entry.path = common.joinPathSegments(base, entry.name, this._settings.pathSegmentSeparator);
|
||||
}
|
||||
if (common.isAppliedFilter(this._settings.entryFilter, entry)) {
|
||||
this._pushToStorage(entry);
|
||||
}
|
||||
if (entry.dirent.isDirectory() && common.isAppliedFilter(this._settings.deepFilter, entry)) {
|
||||
this._pushToQueue(fullpath, base === undefined ? undefined : entry.path);
|
||||
}
|
||||
}
|
||||
_pushToStorage(entry) {
|
||||
this._storage.push(entry);
|
||||
}
|
||||
}
|
||||
exports.default = SyncReader;
|
||||
30
node_modules/@nodelib/fs.walk/out/settings.d.ts
generated
vendored
30
node_modules/@nodelib/fs.walk/out/settings.d.ts
generated
vendored
@@ -1,30 +0,0 @@
|
||||
import * as fsScandir from '@nodelib/fs.scandir';
|
||||
import type { Entry, Errno } from './types';
|
||||
export declare type FilterFunction<T> = (value: T) => boolean;
|
||||
export declare type DeepFilterFunction = FilterFunction<Entry>;
|
||||
export declare type EntryFilterFunction = FilterFunction<Entry>;
|
||||
export declare type ErrorFilterFunction = FilterFunction<Errno>;
|
||||
export interface Options {
|
||||
basePath?: string;
|
||||
concurrency?: number;
|
||||
deepFilter?: DeepFilterFunction;
|
||||
entryFilter?: EntryFilterFunction;
|
||||
errorFilter?: ErrorFilterFunction;
|
||||
followSymbolicLinks?: boolean;
|
||||
fs?: Partial<fsScandir.FileSystemAdapter>;
|
||||
pathSegmentSeparator?: string;
|
||||
stats?: boolean;
|
||||
throwErrorOnBrokenSymbolicLink?: boolean;
|
||||
}
|
||||
export default class Settings {
|
||||
private readonly _options;
|
||||
readonly basePath?: string;
|
||||
readonly concurrency: number;
|
||||
readonly deepFilter: DeepFilterFunction | null;
|
||||
readonly entryFilter: EntryFilterFunction | null;
|
||||
readonly errorFilter: ErrorFilterFunction | null;
|
||||
readonly pathSegmentSeparator: string;
|
||||
readonly fsScandirSettings: fsScandir.Settings;
|
||||
constructor(_options?: Options);
|
||||
private _getValue;
|
||||
}
|
||||
26
node_modules/@nodelib/fs.walk/out/settings.js
generated
vendored
26
node_modules/@nodelib/fs.walk/out/settings.js
generated
vendored
@@ -1,26 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const path = require("path");
|
||||
const fsScandir = require("@nodelib/fs.scandir");
|
||||
class Settings {
|
||||
constructor(_options = {}) {
|
||||
this._options = _options;
|
||||
this.basePath = this._getValue(this._options.basePath, undefined);
|
||||
this.concurrency = this._getValue(this._options.concurrency, Number.POSITIVE_INFINITY);
|
||||
this.deepFilter = this._getValue(this._options.deepFilter, null);
|
||||
this.entryFilter = this._getValue(this._options.entryFilter, null);
|
||||
this.errorFilter = this._getValue(this._options.errorFilter, null);
|
||||
this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path.sep);
|
||||
this.fsScandirSettings = new fsScandir.Settings({
|
||||
followSymbolicLinks: this._options.followSymbolicLinks,
|
||||
fs: this._options.fs,
|
||||
pathSegmentSeparator: this._options.pathSegmentSeparator,
|
||||
stats: this._options.stats,
|
||||
throwErrorOnBrokenSymbolicLink: this._options.throwErrorOnBrokenSymbolicLink
|
||||
});
|
||||
}
|
||||
_getValue(option, value) {
|
||||
return option !== null && option !== void 0 ? option : value;
|
||||
}
|
||||
}
|
||||
exports.default = Settings;
|
||||
8
node_modules/@nodelib/fs.walk/out/types/index.d.ts
generated
vendored
8
node_modules/@nodelib/fs.walk/out/types/index.d.ts
generated
vendored
@@ -1,8 +0,0 @@
|
||||
/// <reference types="node" />
|
||||
import type * as scandir from '@nodelib/fs.scandir';
|
||||
export declare type Entry = scandir.Entry;
|
||||
export declare type Errno = NodeJS.ErrnoException;
|
||||
export interface QueueItem {
|
||||
directory: string;
|
||||
base?: string;
|
||||
}
|
||||
2
node_modules/@nodelib/fs.walk/out/types/index.js
generated
vendored
2
node_modules/@nodelib/fs.walk/out/types/index.js
generated
vendored
@@ -1,2 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
44
node_modules/@nodelib/fs.walk/package.json
generated
vendored
44
node_modules/@nodelib/fs.walk/package.json
generated
vendored
@@ -1,44 +0,0 @@
|
||||
{
|
||||
"name": "@nodelib/fs.walk",
|
||||
"version": "1.2.8",
|
||||
"description": "A library for efficiently walking a directory recursively",
|
||||
"license": "MIT",
|
||||
"repository": "https://github.com/nodelib/nodelib/tree/master/packages/fs/fs.walk",
|
||||
"keywords": [
|
||||
"NodeLib",
|
||||
"fs",
|
||||
"FileSystem",
|
||||
"file system",
|
||||
"walk",
|
||||
"scanner",
|
||||
"crawler"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">= 8"
|
||||
},
|
||||
"files": [
|
||||
"out/**",
|
||||
"!out/**/*.map",
|
||||
"!out/**/*.spec.*",
|
||||
"!out/**/tests/**"
|
||||
],
|
||||
"main": "out/index.js",
|
||||
"typings": "out/index.d.ts",
|
||||
"scripts": {
|
||||
"clean": "rimraf {tsconfig.tsbuildinfo,out}",
|
||||
"lint": "eslint \"src/**/*.ts\" --cache",
|
||||
"compile": "tsc -b .",
|
||||
"compile:watch": "tsc -p . --watch --sourceMap",
|
||||
"test": "mocha \"out/**/*.spec.js\" -s 0",
|
||||
"build": "npm run clean && npm run compile && npm run lint && npm test",
|
||||
"watch": "npm run clean && npm run compile:watch"
|
||||
},
|
||||
"dependencies": {
|
||||
"@nodelib/fs.scandir": "2.1.5",
|
||||
"fastq": "^1.6.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@nodelib/fs.macchiato": "1.0.4"
|
||||
},
|
||||
"gitHead": "1e5bad48565da2b06b8600e744324ea240bf49d8"
|
||||
}
|
||||
0
node_modules/@sindresorhus/is/dist/example.d.ts
generated
vendored
0
node_modules/@sindresorhus/is/dist/example.d.ts
generated
vendored
3
node_modules/@sindresorhus/is/dist/example.js
generated
vendored
3
node_modules/@sindresorhus/is/dist/example.js
generated
vendored
@@ -1,3 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
//# sourceMappingURL=example.js.map
|
||||
1
node_modules/@sindresorhus/is/dist/example.js.map
generated
vendored
1
node_modules/@sindresorhus/is/dist/example.js.map
generated
vendored
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"example.js","sourceRoot":"","sources":["../example.ts"],"names":[],"mappings":""}
|
||||
95
node_modules/@sindresorhus/is/dist/index.d.ts
generated
vendored
95
node_modules/@sindresorhus/is/dist/index.d.ts
generated
vendored
@@ -1,95 +0,0 @@
|
||||
/// <reference types="node" />
|
||||
export declare const enum TypeName {
|
||||
null = "null",
|
||||
boolean = "boolean",
|
||||
undefined = "undefined",
|
||||
string = "string",
|
||||
number = "number",
|
||||
symbol = "symbol",
|
||||
Function = "Function",
|
||||
Array = "Array",
|
||||
Buffer = "Buffer",
|
||||
Object = "Object",
|
||||
RegExp = "RegExp",
|
||||
Date = "Date",
|
||||
Error = "Error",
|
||||
Map = "Map",
|
||||
Set = "Set",
|
||||
WeakMap = "WeakMap",
|
||||
WeakSet = "WeakSet",
|
||||
Int8Array = "Int8Array",
|
||||
Uint8Array = "Uint8Array",
|
||||
Uint8ClampedArray = "Uint8ClampedArray",
|
||||
Int16Array = "Int16Array",
|
||||
Uint16Array = "Uint16Array",
|
||||
Int32Array = "Int32Array",
|
||||
Uint32Array = "Uint32Array",
|
||||
Float32Array = "Float32Array",
|
||||
Float64Array = "Float64Array",
|
||||
ArrayBuffer = "ArrayBuffer",
|
||||
SharedArrayBuffer = "SharedArrayBuffer",
|
||||
DataView = "DataView",
|
||||
Promise = "Promise",
|
||||
}
|
||||
declare function is(value: any): TypeName;
|
||||
declare namespace is {
|
||||
const undefined: (value: any) => boolean;
|
||||
const string: (value: any) => boolean;
|
||||
const number: (value: any) => boolean;
|
||||
const function_: (value: any) => boolean;
|
||||
const null_: (value: any) => boolean;
|
||||
const class_: (value: any) => any;
|
||||
const boolean: (value: any) => boolean;
|
||||
const symbol: (value: any) => boolean;
|
||||
const array: (arg: any) => arg is any[];
|
||||
const buffer: (obj: any) => obj is Buffer;
|
||||
const nullOrUndefined: (value: any) => boolean;
|
||||
const object: (value: any) => boolean;
|
||||
const iterable: (value: any) => boolean;
|
||||
const generator: (value: any) => boolean;
|
||||
const nativePromise: (value: any) => boolean;
|
||||
const promise: (value: any) => boolean;
|
||||
const generatorFunction: (value: any) => boolean;
|
||||
const asyncFunction: (value: any) => boolean;
|
||||
const boundFunction: (value: any) => boolean;
|
||||
const regExp: (value: any) => boolean;
|
||||
const date: (value: any) => boolean;
|
||||
const error: (value: any) => boolean;
|
||||
const map: (value: any) => boolean;
|
||||
const set: (value: any) => boolean;
|
||||
const weakMap: (value: any) => boolean;
|
||||
const weakSet: (value: any) => boolean;
|
||||
const int8Array: (value: any) => boolean;
|
||||
const uint8Array: (value: any) => boolean;
|
||||
const uint8ClampedArray: (value: any) => boolean;
|
||||
const int16Array: (value: any) => boolean;
|
||||
const uint16Array: (value: any) => boolean;
|
||||
const int32Array: (value: any) => boolean;
|
||||
const uint32Array: (value: any) => boolean;
|
||||
const float32Array: (value: any) => boolean;
|
||||
const float64Array: (value: any) => boolean;
|
||||
const arrayBuffer: (value: any) => boolean;
|
||||
const sharedArrayBuffer: (value: any) => boolean;
|
||||
const dataView: (value: any) => boolean;
|
||||
const directInstanceOf: (instance: any, klass: any) => boolean;
|
||||
const truthy: (value: any) => boolean;
|
||||
const falsy: (value: any) => boolean;
|
||||
const nan: (value: any) => boolean;
|
||||
const primitive: (value: any) => boolean;
|
||||
const integer: (value: any) => boolean;
|
||||
const safeInteger: (value: any) => boolean;
|
||||
const plainObject: (value: any) => boolean;
|
||||
const typedArray: (value: any) => boolean;
|
||||
const arrayLike: (value: any) => boolean;
|
||||
const inRange: (value: number, range: number | number[]) => boolean;
|
||||
const domElement: (value: any) => boolean;
|
||||
const nodeStream: (value: any) => boolean;
|
||||
const infinite: (value: any) => boolean;
|
||||
const even: (rem: number) => boolean;
|
||||
const odd: (rem: number) => boolean;
|
||||
const empty: (value: any) => boolean;
|
||||
const emptyOrWhitespace: (value: any) => boolean;
|
||||
function any(...predicate: any[]): any;
|
||||
function all(...predicate: any[]): any;
|
||||
}
|
||||
export default is;
|
||||
215
node_modules/@sindresorhus/is/dist/index.js
generated
vendored
215
node_modules/@sindresorhus/is/dist/index.js
generated
vendored
@@ -1,215 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const util = require("util");
|
||||
const toString = Object.prototype.toString;
|
||||
const isOfType = (type) => (value) => typeof value === type; // tslint:disable-line:strict-type-predicates
|
||||
const getObjectType = (value) => {
|
||||
const objectName = toString.call(value).slice(8, -1);
|
||||
if (objectName) {
|
||||
return objectName;
|
||||
}
|
||||
return null;
|
||||
};
|
||||
const isObjectOfType = (typeName) => (value) => {
|
||||
return getObjectType(value) === typeName;
|
||||
};
|
||||
function is(value) {
|
||||
if (value === null) {
|
||||
return "null" /* null */;
|
||||
}
|
||||
if (value === true || value === false) {
|
||||
return "boolean" /* boolean */;
|
||||
}
|
||||
const type = typeof value;
|
||||
if (type === 'undefined') {
|
||||
return "undefined" /* undefined */;
|
||||
}
|
||||
if (type === 'string') {
|
||||
return "string" /* string */;
|
||||
}
|
||||
if (type === 'number') {
|
||||
return "number" /* number */;
|
||||
}
|
||||
if (type === 'symbol') {
|
||||
return "symbol" /* symbol */;
|
||||
}
|
||||
if (is.function_(value)) {
|
||||
return "Function" /* Function */;
|
||||
}
|
||||
if (Array.isArray(value)) {
|
||||
return "Array" /* Array */;
|
||||
}
|
||||
if (Buffer.isBuffer(value)) {
|
||||
return "Buffer" /* Buffer */;
|
||||
}
|
||||
const tagType = getObjectType(value);
|
||||
if (tagType) {
|
||||
return tagType;
|
||||
}
|
||||
if (value instanceof String || value instanceof Boolean || value instanceof Number) {
|
||||
throw new TypeError('Please don\'t use object wrappers for primitive types');
|
||||
}
|
||||
return "Object" /* Object */;
|
||||
}
|
||||
(function (is) {
|
||||
const isObject = (value) => typeof value === 'object';
|
||||
// tslint:disable:variable-name
|
||||
is.undefined = isOfType('undefined');
|
||||
is.string = isOfType('string');
|
||||
is.number = isOfType('number');
|
||||
is.function_ = isOfType('function');
|
||||
is.null_ = (value) => value === null;
|
||||
is.class_ = (value) => is.function_(value) && value.toString().startsWith('class ');
|
||||
is.boolean = (value) => value === true || value === false;
|
||||
// tslint:enable:variable-name
|
||||
is.symbol = isOfType('symbol');
|
||||
is.array = Array.isArray;
|
||||
is.buffer = Buffer.isBuffer;
|
||||
is.nullOrUndefined = (value) => is.null_(value) || is.undefined(value);
|
||||
is.object = (value) => !is.nullOrUndefined(value) && (is.function_(value) || isObject(value));
|
||||
is.iterable = (value) => !is.nullOrUndefined(value) && is.function_(value[Symbol.iterator]);
|
||||
is.generator = (value) => is.iterable(value) && is.function_(value.next) && is.function_(value.throw);
|
||||
is.nativePromise = isObjectOfType("Promise" /* Promise */);
|
||||
const hasPromiseAPI = (value) => !is.null_(value) &&
|
||||
isObject(value) &&
|
||||
is.function_(value.then) &&
|
||||
is.function_(value.catch);
|
||||
is.promise = (value) => is.nativePromise(value) || hasPromiseAPI(value);
|
||||
// TODO: Change to use `isObjectOfType` once Node.js 6 or higher is targeted
|
||||
const isFunctionOfType = (type) => (value) => is.function_(value) && is.function_(value.constructor) && value.constructor.name === type;
|
||||
is.generatorFunction = isFunctionOfType('GeneratorFunction');
|
||||
is.asyncFunction = isFunctionOfType('AsyncFunction');
|
||||
is.boundFunction = (value) => is.function_(value) && !value.hasOwnProperty('prototype');
|
||||
is.regExp = isObjectOfType("RegExp" /* RegExp */);
|
||||
is.date = isObjectOfType("Date" /* Date */);
|
||||
is.error = isObjectOfType("Error" /* Error */);
|
||||
is.map = isObjectOfType("Map" /* Map */);
|
||||
is.set = isObjectOfType("Set" /* Set */);
|
||||
is.weakMap = isObjectOfType("WeakMap" /* WeakMap */);
|
||||
is.weakSet = isObjectOfType("WeakSet" /* WeakSet */);
|
||||
is.int8Array = isObjectOfType("Int8Array" /* Int8Array */);
|
||||
is.uint8Array = isObjectOfType("Uint8Array" /* Uint8Array */);
|
||||
is.uint8ClampedArray = isObjectOfType("Uint8ClampedArray" /* Uint8ClampedArray */);
|
||||
is.int16Array = isObjectOfType("Int16Array" /* Int16Array */);
|
||||
is.uint16Array = isObjectOfType("Uint16Array" /* Uint16Array */);
|
||||
is.int32Array = isObjectOfType("Int32Array" /* Int32Array */);
|
||||
is.uint32Array = isObjectOfType("Uint32Array" /* Uint32Array */);
|
||||
is.float32Array = isObjectOfType("Float32Array" /* Float32Array */);
|
||||
is.float64Array = isObjectOfType("Float64Array" /* Float64Array */);
|
||||
is.arrayBuffer = isObjectOfType("ArrayBuffer" /* ArrayBuffer */);
|
||||
is.sharedArrayBuffer = isObjectOfType("SharedArrayBuffer" /* SharedArrayBuffer */);
|
||||
is.dataView = isObjectOfType("DataView" /* DataView */);
|
||||
// TODO: Remove `object` checks when targeting ES2015 or higher
|
||||
// See `Notes`: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/getPrototypeOf
|
||||
is.directInstanceOf = (instance, klass) => is.object(instance) && is.object(klass) && Object.getPrototypeOf(instance) === klass.prototype;
|
||||
is.truthy = (value) => Boolean(value);
|
||||
is.falsy = (value) => !value;
|
||||
is.nan = (value) => Number.isNaN(value);
|
||||
const primitiveTypes = new Set([
|
||||
'undefined',
|
||||
'string',
|
||||
'number',
|
||||
'boolean',
|
||||
'symbol'
|
||||
]);
|
||||
is.primitive = (value) => is.null_(value) || primitiveTypes.has(typeof value);
|
||||
is.integer = (value) => Number.isInteger(value);
|
||||
is.safeInteger = (value) => Number.isSafeInteger(value);
|
||||
is.plainObject = (value) => {
|
||||
// From: https://github.com/sindresorhus/is-plain-obj/blob/master/index.js
|
||||
let prototype;
|
||||
return getObjectType(value) === "Object" /* Object */ &&
|
||||
(prototype = Object.getPrototypeOf(value), prototype === null || // tslint:disable-line:ban-comma-operator
|
||||
prototype === Object.getPrototypeOf({}));
|
||||
};
|
||||
const typedArrayTypes = new Set([
|
||||
"Int8Array" /* Int8Array */,
|
||||
"Uint8Array" /* Uint8Array */,
|
||||
"Uint8ClampedArray" /* Uint8ClampedArray */,
|
||||
"Int16Array" /* Int16Array */,
|
||||
"Uint16Array" /* Uint16Array */,
|
||||
"Int32Array" /* Int32Array */,
|
||||
"Uint32Array" /* Uint32Array */,
|
||||
"Float32Array" /* Float32Array */,
|
||||
"Float64Array" /* Float64Array */
|
||||
]);
|
||||
is.typedArray = (value) => {
|
||||
const objectType = getObjectType(value);
|
||||
if (objectType === null) {
|
||||
return false;
|
||||
}
|
||||
return typedArrayTypes.has(objectType);
|
||||
};
|
||||
const isValidLength = (value) => is.safeInteger(value) && value > -1;
|
||||
is.arrayLike = (value) => !is.nullOrUndefined(value) && !is.function_(value) && isValidLength(value.length);
|
||||
is.inRange = (value, range) => {
|
||||
if (is.number(range)) {
|
||||
return value >= Math.min(0, range) && value <= Math.max(range, 0);
|
||||
}
|
||||
if (is.array(range) && range.length === 2) {
|
||||
// TODO: Use spread operator here when targeting Node.js 6 or higher
|
||||
return value >= Math.min.apply(null, range) && value <= Math.max.apply(null, range);
|
||||
}
|
||||
throw new TypeError(`Invalid range: ${util.inspect(range)}`);
|
||||
};
|
||||
const NODE_TYPE_ELEMENT = 1;
|
||||
const DOM_PROPERTIES_TO_CHECK = [
|
||||
'innerHTML',
|
||||
'ownerDocument',
|
||||
'style',
|
||||
'attributes',
|
||||
'nodeValue'
|
||||
];
|
||||
is.domElement = (value) => is.object(value) && value.nodeType === NODE_TYPE_ELEMENT && is.string(value.nodeName) &&
|
||||
!is.plainObject(value) && DOM_PROPERTIES_TO_CHECK.every(property => property in value);
|
||||
is.nodeStream = (value) => !is.nullOrUndefined(value) && isObject(value) && is.function_(value.pipe);
|
||||
is.infinite = (value) => value === Infinity || value === -Infinity;
|
||||
const isAbsoluteMod2 = (value) => (rem) => is.integer(rem) && Math.abs(rem % 2) === value;
|
||||
is.even = isAbsoluteMod2(0);
|
||||
is.odd = isAbsoluteMod2(1);
|
||||
const isWhiteSpaceString = (value) => is.string(value) && /\S/.test(value) === false;
|
||||
const isEmptyStringOrArray = (value) => (is.string(value) || is.array(value)) && value.length === 0;
|
||||
const isEmptyObject = (value) => !is.map(value) && !is.set(value) && is.object(value) && Object.keys(value).length === 0;
|
||||
const isEmptyMapOrSet = (value) => (is.map(value) || is.set(value)) && value.size === 0;
|
||||
is.empty = (value) => is.falsy(value) || isEmptyStringOrArray(value) || isEmptyObject(value) || isEmptyMapOrSet(value);
|
||||
is.emptyOrWhitespace = (value) => is.empty(value) || isWhiteSpaceString(value);
|
||||
const predicateOnArray = (method, predicate, args) => {
|
||||
// `args` is the calling function's "arguments object".
|
||||
// We have to do it this way to keep node v4 support.
|
||||
// So here we convert it to an array and slice off the first item.
|
||||
const values = Array.prototype.slice.call(args, 1);
|
||||
if (is.function_(predicate) === false) {
|
||||
throw new TypeError(`Invalid predicate: ${util.inspect(predicate)}`);
|
||||
}
|
||||
if (values.length === 0) {
|
||||
throw new TypeError('Invalid number of values');
|
||||
}
|
||||
return method.call(values, predicate);
|
||||
};
|
||||
function any(predicate) {
|
||||
return predicateOnArray(Array.prototype.some, predicate, arguments);
|
||||
}
|
||||
is.any = any;
|
||||
function all(predicate) {
|
||||
return predicateOnArray(Array.prototype.every, predicate, arguments);
|
||||
}
|
||||
is.all = all;
|
||||
// tslint:enable:only-arrow-functions no-function-expression
|
||||
})(is || (is = {}));
|
||||
// Some few keywords are reserved, but we'll populate them for Node.js users
|
||||
// See https://github.com/Microsoft/TypeScript/issues/2536
|
||||
Object.defineProperties(is, {
|
||||
class: {
|
||||
value: is.class_
|
||||
},
|
||||
function: {
|
||||
value: is.function_
|
||||
},
|
||||
null: {
|
||||
value: is.null_
|
||||
}
|
||||
});
|
||||
exports.default = is;
|
||||
// For CommonJS default export support
|
||||
module.exports = is;
|
||||
module.exports.default = is;
|
||||
1
node_modules/@sindresorhus/is/dist/index.js.map
generated
vendored
1
node_modules/@sindresorhus/is/dist/index.js.map
generated
vendored
File diff suppressed because one or more lines are too long
59
node_modules/@sindresorhus/is/dist/source/index.d.ts
generated
vendored
59
node_modules/@sindresorhus/is/dist/source/index.d.ts
generated
vendored
@@ -1,59 +0,0 @@
|
||||
/// <reference types="node" />
|
||||
declare function is(value: any): string;
|
||||
declare namespace is {
|
||||
const undefined: (value: any) => boolean;
|
||||
const string: (value: any) => boolean;
|
||||
const number: (value: any) => boolean;
|
||||
const function_: (value: any) => boolean;
|
||||
const null_: (value: any) => boolean;
|
||||
const class_: (value: any) => any;
|
||||
const boolean: (value: any) => boolean;
|
||||
const symbol: (value: any) => boolean;
|
||||
const array: (arg: any) => arg is any[];
|
||||
const buffer: (obj: any) => obj is Buffer;
|
||||
const nullOrUndefined: (value: any) => boolean;
|
||||
const object: (value: any) => boolean;
|
||||
const iterable: (value: any) => boolean;
|
||||
const generator: (value: any) => boolean;
|
||||
const nativePromise: (value: any) => boolean;
|
||||
const promise: (value: any) => boolean;
|
||||
const generatorFunction: (value: any) => boolean;
|
||||
const asyncFunction: (value: any) => boolean;
|
||||
const regExp: (value: any) => boolean;
|
||||
const date: (value: any) => boolean;
|
||||
const error: (value: any) => boolean;
|
||||
const map: (value: any) => boolean;
|
||||
const set: (value: any) => boolean;
|
||||
const weakMap: (value: any) => boolean;
|
||||
const weakSet: (value: any) => boolean;
|
||||
const int8Array: (value: any) => boolean;
|
||||
const uint8Array: (value: any) => boolean;
|
||||
const uint8ClampedArray: (value: any) => boolean;
|
||||
const int16Array: (value: any) => boolean;
|
||||
const uint16Array: (value: any) => boolean;
|
||||
const int32Array: (value: any) => boolean;
|
||||
const uint32Array: (value: any) => boolean;
|
||||
const float32Array: (value: any) => boolean;
|
||||
const float64Array: (value: any) => boolean;
|
||||
const arrayBuffer: (value: any) => boolean;
|
||||
const sharedArrayBuffer: (value: any) => boolean;
|
||||
const truthy: (value: any) => boolean;
|
||||
const falsy: (value: any) => boolean;
|
||||
const nan: (value: any) => boolean;
|
||||
const primitive: (value: any) => boolean;
|
||||
const integer: (value: any) => boolean;
|
||||
const safeInteger: (value: any) => boolean;
|
||||
const plainObject: (value: any) => boolean;
|
||||
const typedArray: (value: any) => boolean;
|
||||
const arrayLike: (value: any) => boolean;
|
||||
const inRange: (value: number, range: number | number[]) => boolean;
|
||||
const domElement: (value: any) => boolean;
|
||||
const infinite: (value: any) => boolean;
|
||||
const even: (rem: number) => boolean;
|
||||
const odd: (rem: number) => boolean;
|
||||
const empty: (value: any) => boolean;
|
||||
const emptyOrWhitespace: (value: any) => boolean;
|
||||
function any(...predicate: any[]): any;
|
||||
function all(...predicate: any[]): any;
|
||||
}
|
||||
export default is;
|
||||
182
node_modules/@sindresorhus/is/dist/source/index.js
generated
vendored
182
node_modules/@sindresorhus/is/dist/source/index.js
generated
vendored
@@ -1,182 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const util = require("util");
|
||||
const toString = Object.prototype.toString;
|
||||
const getObjectType = (value) => toString.call(value).slice(8, -1);
|
||||
const isOfType = (type) => (value) => typeof value === type;
|
||||
const isObjectOfType = (type) => (value) => getObjectType(value) === type;
|
||||
function is(value) {
|
||||
if (value === null) {
|
||||
return 'null';
|
||||
}
|
||||
if (value === true || value === false) {
|
||||
return 'boolean';
|
||||
}
|
||||
const type = typeof value;
|
||||
if (type === 'undefined') {
|
||||
return 'undefined';
|
||||
}
|
||||
if (type === 'string') {
|
||||
return 'string';
|
||||
}
|
||||
if (type === 'number') {
|
||||
return 'number';
|
||||
}
|
||||
if (type === 'symbol') {
|
||||
return 'symbol';
|
||||
}
|
||||
if (is.function_(value)) {
|
||||
return 'Function';
|
||||
}
|
||||
if (Array.isArray(value)) {
|
||||
return 'Array';
|
||||
}
|
||||
if (Buffer.isBuffer(value)) {
|
||||
return 'Buffer';
|
||||
}
|
||||
const tagType = getObjectType(value);
|
||||
if (tagType) {
|
||||
return tagType;
|
||||
}
|
||||
if (value instanceof String || value instanceof Boolean || value instanceof Number) {
|
||||
throw new TypeError('Please don\'t use object wrappers for primitive types');
|
||||
}
|
||||
return 'Object';
|
||||
}
|
||||
(function (is) {
|
||||
const isObject = (value) => typeof value === 'object';
|
||||
is.undefined = isOfType('undefined');
|
||||
is.string = isOfType('string');
|
||||
is.number = isOfType('number');
|
||||
is.function_ = isOfType('function');
|
||||
is.null_ = (value) => value === null;
|
||||
is.class_ = (value) => is.function_(value) && value.toString().startsWith('class ');
|
||||
is.boolean = (value) => value === true || value === false;
|
||||
is.symbol = isOfType('symbol');
|
||||
is.array = Array.isArray;
|
||||
is.buffer = Buffer.isBuffer;
|
||||
is.nullOrUndefined = (value) => is.null_(value) || is.undefined(value);
|
||||
is.object = (value) => !is.nullOrUndefined(value) && (is.function_(value) || isObject(value));
|
||||
is.iterable = (value) => !is.nullOrUndefined(value) && is.function_(value[Symbol.iterator]);
|
||||
is.generator = (value) => is.iterable(value) && is.function_(value.next) && is.function_(value.throw);
|
||||
is.nativePromise = isObjectOfType('Promise');
|
||||
const hasPromiseAPI = (value) => !is.null_(value) &&
|
||||
isObject(value) &&
|
||||
is.function_(value.then) &&
|
||||
is.function_(value.catch);
|
||||
is.promise = (value) => is.nativePromise(value) || hasPromiseAPI(value);
|
||||
const isFunctionOfType = (type) => (value) => is.function_(value) && is.function_(value.constructor) && value.constructor.name === type;
|
||||
is.generatorFunction = isFunctionOfType('GeneratorFunction');
|
||||
is.asyncFunction = isFunctionOfType('AsyncFunction');
|
||||
is.regExp = isObjectOfType('RegExp');
|
||||
is.date = isObjectOfType('Date');
|
||||
is.error = isObjectOfType('Error');
|
||||
is.map = isObjectOfType('Map');
|
||||
is.set = isObjectOfType('Set');
|
||||
is.weakMap = isObjectOfType('WeakMap');
|
||||
is.weakSet = isObjectOfType('WeakSet');
|
||||
is.int8Array = isObjectOfType('Int8Array');
|
||||
is.uint8Array = isObjectOfType('Uint8Array');
|
||||
is.uint8ClampedArray = isObjectOfType('Uint8ClampedArray');
|
||||
is.int16Array = isObjectOfType('Int16Array');
|
||||
is.uint16Array = isObjectOfType('Uint16Array');
|
||||
is.int32Array = isObjectOfType('Int32Array');
|
||||
is.uint32Array = isObjectOfType('Uint32Array');
|
||||
is.float32Array = isObjectOfType('Float32Array');
|
||||
is.float64Array = isObjectOfType('Float64Array');
|
||||
is.arrayBuffer = isObjectOfType('ArrayBuffer');
|
||||
is.sharedArrayBuffer = isObjectOfType('SharedArrayBuffer');
|
||||
is.truthy = (value) => Boolean(value);
|
||||
is.falsy = (value) => !value;
|
||||
is.nan = (value) => Number.isNaN(value);
|
||||
const primitiveTypes = new Set([
|
||||
'undefined',
|
||||
'string',
|
||||
'number',
|
||||
'boolean',
|
||||
'symbol'
|
||||
]);
|
||||
is.primitive = (value) => is.null_(value) || primitiveTypes.has(typeof value);
|
||||
is.integer = (value) => Number.isInteger(value);
|
||||
is.safeInteger = (value) => Number.isSafeInteger(value);
|
||||
is.plainObject = (value) => {
|
||||
let prototype;
|
||||
return getObjectType(value) === 'Object' &&
|
||||
(prototype = Object.getPrototypeOf(value), prototype === null ||
|
||||
prototype === Object.getPrototypeOf({}));
|
||||
};
|
||||
const typedArrayTypes = new Set([
|
||||
'Int8Array',
|
||||
'Uint8Array',
|
||||
'Uint8ClampedArray',
|
||||
'Int16Array',
|
||||
'Uint16Array',
|
||||
'Int32Array',
|
||||
'Uint32Array',
|
||||
'Float32Array',
|
||||
'Float64Array'
|
||||
]);
|
||||
is.typedArray = (value) => typedArrayTypes.has(getObjectType(value));
|
||||
const isValidLength = (value) => is.safeInteger(value) && value > -1;
|
||||
is.arrayLike = (value) => !is.nullOrUndefined(value) && !is.function_(value) && isValidLength(value.length);
|
||||
is.inRange = (value, range) => {
|
||||
if (is.number(range)) {
|
||||
return value >= Math.min(0, range) && value <= Math.max(range, 0);
|
||||
}
|
||||
if (is.array(range) && range.length === 2) {
|
||||
return value >= Math.min.apply(null, range) && value <= Math.max.apply(null, range);
|
||||
}
|
||||
throw new TypeError(`Invalid range: ${util.inspect(range)}`);
|
||||
};
|
||||
const NODE_TYPE_ELEMENT = 1;
|
||||
const DOM_PROPERTIES_TO_CHECK = [
|
||||
'innerHTML',
|
||||
'ownerDocument',
|
||||
'style',
|
||||
'attributes',
|
||||
'nodeValue'
|
||||
];
|
||||
is.domElement = (value) => is.object(value) && value.nodeType === NODE_TYPE_ELEMENT && is.string(value.nodeName) &&
|
||||
!is.plainObject(value) && DOM_PROPERTIES_TO_CHECK.every(property => property in value);
|
||||
is.infinite = (value) => value === Infinity || value === -Infinity;
|
||||
const isAbsoluteMod2 = (value) => (rem) => is.integer(rem) && Math.abs(rem % 2) === value;
|
||||
is.even = isAbsoluteMod2(0);
|
||||
is.odd = isAbsoluteMod2(1);
|
||||
const isWhiteSpaceString = (value) => is.string(value) && /\S/.test(value) === false;
|
||||
const isEmptyStringOrArray = (value) => (is.string(value) || is.array(value)) && value.length === 0;
|
||||
const isEmptyObject = (value) => !is.map(value) && !is.set(value) && is.object(value) && Object.keys(value).length === 0;
|
||||
const isEmptyMapOrSet = (value) => (is.map(value) || is.set(value)) && value.size === 0;
|
||||
is.empty = (value) => is.falsy(value) || isEmptyStringOrArray(value) || isEmptyObject(value) || isEmptyMapOrSet(value);
|
||||
is.emptyOrWhitespace = (value) => is.empty(value) || isWhiteSpaceString(value);
|
||||
const predicateOnArray = (method, predicate, args) => {
|
||||
const values = Array.prototype.slice.call(args, 1);
|
||||
if (is.function_(predicate) === false) {
|
||||
throw new TypeError(`Invalid predicate: ${util.inspect(predicate)}`);
|
||||
}
|
||||
if (values.length === 0) {
|
||||
throw new TypeError('Invalid number of values');
|
||||
}
|
||||
return method.call(values, predicate);
|
||||
};
|
||||
function any(predicate) {
|
||||
return predicateOnArray(Array.prototype.some, predicate, arguments);
|
||||
}
|
||||
is.any = any;
|
||||
function all(predicate) {
|
||||
return predicateOnArray(Array.prototype.every, predicate, arguments);
|
||||
}
|
||||
is.all = all;
|
||||
})(is || (is = {}));
|
||||
Object.defineProperties(is, {
|
||||
class: {
|
||||
value: is.class_
|
||||
},
|
||||
function: {
|
||||
value: is.function_
|
||||
},
|
||||
null: {
|
||||
value: is.null_
|
||||
}
|
||||
});
|
||||
exports.default = is;
|
||||
//# sourceMappingURL=index.js.map
|
||||
1
node_modules/@sindresorhus/is/dist/source/index.js.map
generated
vendored
1
node_modules/@sindresorhus/is/dist/source/index.js.map
generated
vendored
File diff suppressed because one or more lines are too long
0
node_modules/@sindresorhus/is/dist/source/tests/test.d.ts
generated
vendored
0
node_modules/@sindresorhus/is/dist/source/tests/test.d.ts
generated
vendored
622
node_modules/@sindresorhus/is/dist/source/tests/test.js
generated
vendored
622
node_modules/@sindresorhus/is/dist/source/tests/test.js
generated
vendored
@@ -1,622 +0,0 @@
|
||||
"use strict";
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const util = require("util");
|
||||
const ava_1 = require("ava");
|
||||
const jsdom_1 = require("jsdom");
|
||||
const __1 = require("..");
|
||||
const isNode8orHigher = Number(process.versions.node.split('.')[0]) >= 8;
|
||||
class ErrorSubclassFixture extends Error {
|
||||
}
|
||||
const document = jsdom_1.jsdom();
|
||||
const createDomElement = (el) => document.createElement(el);
|
||||
const types = new Map([
|
||||
['undefined', {
|
||||
is: __1.default.undefined,
|
||||
fixtures: [
|
||||
undefined
|
||||
]
|
||||
}],
|
||||
['null', {
|
||||
is: __1.default.null_,
|
||||
fixtures: [
|
||||
null
|
||||
]
|
||||
}],
|
||||
['string', {
|
||||
is: __1.default.string,
|
||||
fixtures: [
|
||||
'🦄',
|
||||
'hello world',
|
||||
''
|
||||
]
|
||||
}],
|
||||
['number', {
|
||||
is: __1.default.number,
|
||||
fixtures: [
|
||||
6,
|
||||
1.4,
|
||||
0,
|
||||
-0,
|
||||
Infinity,
|
||||
-Infinity
|
||||
]
|
||||
}],
|
||||
['boolean', {
|
||||
is: __1.default.boolean,
|
||||
fixtures: [
|
||||
true, false
|
||||
]
|
||||
}],
|
||||
['symbol', {
|
||||
is: __1.default.symbol,
|
||||
fixtures: [
|
||||
Symbol('🦄')
|
||||
]
|
||||
}],
|
||||
['array', {
|
||||
is: __1.default.array,
|
||||
fixtures: [
|
||||
[1, 2],
|
||||
new Array(2)
|
||||
]
|
||||
}],
|
||||
['function', {
|
||||
is: __1.default.function_,
|
||||
fixtures: [
|
||||
function foo() { },
|
||||
function () { },
|
||||
() => { },
|
||||
function () {
|
||||
return __awaiter(this, void 0, void 0, function* () { });
|
||||
},
|
||||
function* () { }
|
||||
]
|
||||
}],
|
||||
['buffer', {
|
||||
is: __1.default.buffer,
|
||||
fixtures: [
|
||||
Buffer.from('🦄')
|
||||
]
|
||||
}],
|
||||
['object', {
|
||||
is: __1.default.object,
|
||||
fixtures: [
|
||||
{ x: 1 },
|
||||
Object.create({ x: 1 })
|
||||
]
|
||||
}],
|
||||
['regExp', {
|
||||
is: __1.default.regExp,
|
||||
fixtures: [
|
||||
/\w/,
|
||||
new RegExp('\\w')
|
||||
]
|
||||
}],
|
||||
['date', {
|
||||
is: __1.default.date,
|
||||
fixtures: [
|
||||
new Date()
|
||||
]
|
||||
}],
|
||||
['error', {
|
||||
is: __1.default.error,
|
||||
fixtures: [
|
||||
new Error('🦄'),
|
||||
new ErrorSubclassFixture()
|
||||
]
|
||||
}],
|
||||
['nativePromise', {
|
||||
is: __1.default.nativePromise,
|
||||
fixtures: [
|
||||
Promise.resolve(),
|
||||
]
|
||||
}],
|
||||
['promise', {
|
||||
is: __1.default.promise,
|
||||
fixtures: [
|
||||
{ then() { }, catch() { } }
|
||||
]
|
||||
}],
|
||||
['generator', {
|
||||
is: __1.default.generator,
|
||||
fixtures: [
|
||||
(function* () { yield 4; })()
|
||||
]
|
||||
}],
|
||||
['generatorFunction', {
|
||||
is: __1.default.generatorFunction,
|
||||
fixtures: [
|
||||
function* () { yield 4; }
|
||||
]
|
||||
}],
|
||||
['asyncFunction', {
|
||||
is: __1.default.asyncFunction,
|
||||
fixtures: [
|
||||
function () {
|
||||
return __awaiter(this, void 0, void 0, function* () { });
|
||||
},
|
||||
() => __awaiter(this, void 0, void 0, function* () { })
|
||||
]
|
||||
}],
|
||||
['map', {
|
||||
is: __1.default.map,
|
||||
fixtures: [
|
||||
new Map()
|
||||
]
|
||||
}],
|
||||
['set', {
|
||||
is: __1.default.set,
|
||||
fixtures: [
|
||||
new Set()
|
||||
]
|
||||
}],
|
||||
['weakSet', {
|
||||
is: __1.default.weakSet,
|
||||
fixtures: [
|
||||
new WeakSet()
|
||||
]
|
||||
}],
|
||||
['weakMap', {
|
||||
is: __1.default.weakMap,
|
||||
fixtures: [
|
||||
new WeakMap()
|
||||
]
|
||||
}],
|
||||
['int8Array', {
|
||||
is: __1.default.int8Array,
|
||||
fixtures: [
|
||||
new Int8Array(0)
|
||||
]
|
||||
}],
|
||||
['uint8Array', {
|
||||
is: __1.default.uint8Array,
|
||||
fixtures: [
|
||||
new Uint8Array(0)
|
||||
]
|
||||
}],
|
||||
['uint8ClampedArray', {
|
||||
is: __1.default.uint8ClampedArray,
|
||||
fixtures: [
|
||||
new Uint8ClampedArray(0)
|
||||
]
|
||||
}],
|
||||
['int16Array', {
|
||||
is: __1.default.int16Array,
|
||||
fixtures: [
|
||||
new Int16Array(0)
|
||||
]
|
||||
}],
|
||||
['uint16Array', {
|
||||
is: __1.default.uint16Array,
|
||||
fixtures: [
|
||||
new Uint16Array(0)
|
||||
]
|
||||
}],
|
||||
['int32Array', {
|
||||
is: __1.default.int32Array,
|
||||
fixtures: [
|
||||
new Int32Array(0)
|
||||
]
|
||||
}],
|
||||
['uint32Array', {
|
||||
is: __1.default.uint32Array,
|
||||
fixtures: [
|
||||
new Uint32Array(0)
|
||||
]
|
||||
}],
|
||||
['float32Array', {
|
||||
is: __1.default.float32Array,
|
||||
fixtures: [
|
||||
new Float32Array(0)
|
||||
]
|
||||
}],
|
||||
['float64Array', {
|
||||
is: __1.default.float64Array,
|
||||
fixtures: [
|
||||
new Float64Array(0)
|
||||
]
|
||||
}],
|
||||
['arrayBuffer', {
|
||||
is: __1.default.arrayBuffer,
|
||||
fixtures: [
|
||||
new ArrayBuffer(10)
|
||||
]
|
||||
}],
|
||||
['nan', {
|
||||
is: __1.default.nan,
|
||||
fixtures: [
|
||||
NaN,
|
||||
Number.NaN
|
||||
]
|
||||
}],
|
||||
['nullOrUndefined', {
|
||||
is: __1.default.nullOrUndefined,
|
||||
fixtures: [
|
||||
null,
|
||||
undefined
|
||||
]
|
||||
}],
|
||||
['plainObject', {
|
||||
is: __1.default.plainObject,
|
||||
fixtures: [
|
||||
{ x: 1 },
|
||||
Object.create(null),
|
||||
new Object()
|
||||
]
|
||||
}],
|
||||
['integer', {
|
||||
is: __1.default.integer,
|
||||
fixtures: [
|
||||
6
|
||||
]
|
||||
}],
|
||||
['safeInteger', {
|
||||
is: __1.default.safeInteger,
|
||||
fixtures: [
|
||||
Math.pow(2, 53) - 1,
|
||||
-Math.pow(2, 53) + 1
|
||||
]
|
||||
}],
|
||||
['domElement', {
|
||||
is: __1.default.domElement,
|
||||
fixtures: [
|
||||
'div',
|
||||
'input',
|
||||
'span',
|
||||
'img',
|
||||
'canvas',
|
||||
'script'
|
||||
].map(createDomElement)
|
||||
}
|
||||
], ['non-domElements', {
|
||||
is: value => !__1.default.domElement(value),
|
||||
fixtures: [
|
||||
document.createTextNode('data'),
|
||||
document.createProcessingInstruction('xml-stylesheet', 'href="mycss.css" type="text/css"'),
|
||||
document.createComment('This is a comment'),
|
||||
document,
|
||||
document.implementation.createDocumentType('svg:svg', '-//W3C//DTD SVG 1.1//EN', 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'),
|
||||
document.createDocumentFragment()
|
||||
]
|
||||
}],
|
||||
['infinite', {
|
||||
is: __1.default.infinite,
|
||||
fixtures: [
|
||||
Infinity,
|
||||
-Infinity
|
||||
]
|
||||
}]
|
||||
]);
|
||||
const testType = (t, type, exclude) => {
|
||||
const testData = types.get(type);
|
||||
if (testData === undefined) {
|
||||
t.fail(`is.${type} not defined`);
|
||||
return;
|
||||
}
|
||||
const { is } = testData;
|
||||
for (const [key, { fixtures }] of types) {
|
||||
if (exclude && exclude.indexOf(key) !== -1) {
|
||||
continue;
|
||||
}
|
||||
const assert = key === type ? t.true.bind(t) : t.false.bind(t);
|
||||
for (const fixture of fixtures) {
|
||||
assert(is(fixture), `Value: ${util.inspect(fixture)}`);
|
||||
}
|
||||
}
|
||||
};
|
||||
ava_1.default('is', t => {
|
||||
t.is(__1.default(null), 'null');
|
||||
t.is(__1.default(undefined), 'undefined');
|
||||
});
|
||||
ava_1.default('is.undefined', t => {
|
||||
testType(t, 'undefined', ['nullOrUndefined']);
|
||||
});
|
||||
ava_1.default('is.null', t => {
|
||||
testType(t, 'null', ['nullOrUndefined']);
|
||||
});
|
||||
ava_1.default('is.string', t => {
|
||||
testType(t, 'string');
|
||||
});
|
||||
ava_1.default('is.number', t => {
|
||||
testType(t, 'number', ['nan', 'integer', 'safeInteger', 'infinite']);
|
||||
});
|
||||
ava_1.default('is.boolean', t => {
|
||||
testType(t, 'boolean');
|
||||
});
|
||||
ava_1.default('is.symbol', t => {
|
||||
testType(t, 'symbol');
|
||||
});
|
||||
ava_1.default('is.array', t => {
|
||||
testType(t, 'array');
|
||||
});
|
||||
ava_1.default('is.function', t => {
|
||||
testType(t, 'function', ['generatorFunction', 'asyncFunction']);
|
||||
});
|
||||
ava_1.default('is.buffer', t => {
|
||||
testType(t, 'buffer');
|
||||
});
|
||||
ava_1.default('is.object', t => {
|
||||
const testData = types.get('object');
|
||||
if (testData === undefined) {
|
||||
t.fail('is.object not defined');
|
||||
return;
|
||||
}
|
||||
for (const el of testData.fixtures) {
|
||||
t.true(__1.default.object(el));
|
||||
}
|
||||
});
|
||||
ava_1.default('is.regExp', t => {
|
||||
testType(t, 'regExp');
|
||||
});
|
||||
ava_1.default('is.date', t => {
|
||||
testType(t, 'date');
|
||||
});
|
||||
ava_1.default('is.error', t => {
|
||||
testType(t, 'error');
|
||||
});
|
||||
if (isNode8orHigher) {
|
||||
ava_1.default('is.nativePromise', t => {
|
||||
testType(t, 'nativePromise');
|
||||
});
|
||||
ava_1.default('is.promise', t => {
|
||||
testType(t, 'promise', ['nativePromise']);
|
||||
});
|
||||
}
|
||||
ava_1.default('is.generator', t => {
|
||||
testType(t, 'generator');
|
||||
});
|
||||
ava_1.default('is.generatorFunction', t => {
|
||||
testType(t, 'generatorFunction', ['function']);
|
||||
});
|
||||
ava_1.default('is.map', t => {
|
||||
testType(t, 'map');
|
||||
});
|
||||
ava_1.default('is.set', t => {
|
||||
testType(t, 'set');
|
||||
});
|
||||
ava_1.default('is.weakMap', t => {
|
||||
testType(t, 'weakMap');
|
||||
});
|
||||
ava_1.default('is.weakSet', t => {
|
||||
testType(t, 'weakSet');
|
||||
});
|
||||
ava_1.default('is.int8Array', t => {
|
||||
testType(t, 'int8Array');
|
||||
});
|
||||
ava_1.default('is.uint8Array', t => {
|
||||
testType(t, 'uint8Array', ['buffer']);
|
||||
});
|
||||
ava_1.default('is.uint8ClampedArray', t => {
|
||||
testType(t, 'uint8ClampedArray');
|
||||
});
|
||||
ava_1.default('is.int16Array', t => {
|
||||
testType(t, 'int16Array');
|
||||
});
|
||||
ava_1.default('is.uint16Array', t => {
|
||||
testType(t, 'uint16Array');
|
||||
});
|
||||
ava_1.default('is.int32Array', t => {
|
||||
testType(t, 'int32Array');
|
||||
});
|
||||
ava_1.default('is.uint32Array', t => {
|
||||
testType(t, 'uint32Array');
|
||||
});
|
||||
ava_1.default('is.float32Array', t => {
|
||||
testType(t, 'float32Array');
|
||||
});
|
||||
ava_1.default('is.float64Array', t => {
|
||||
testType(t, 'float64Array');
|
||||
});
|
||||
ava_1.default('is.arrayBuffer', t => {
|
||||
testType(t, 'arrayBuffer');
|
||||
});
|
||||
ava_1.default('is.dataView', t => {
|
||||
testType(t, 'arrayBuffer');
|
||||
});
|
||||
ava_1.default('is.truthy', t => {
|
||||
t.true(__1.default.truthy('unicorn'));
|
||||
t.true(__1.default.truthy('🦄'));
|
||||
t.true(__1.default.truthy(new Set()));
|
||||
t.true(__1.default.truthy(Symbol('🦄')));
|
||||
t.true(__1.default.truthy(true));
|
||||
});
|
||||
ava_1.default('is.falsy', t => {
|
||||
t.true(__1.default.falsy(false));
|
||||
t.true(__1.default.falsy(0));
|
||||
t.true(__1.default.falsy(''));
|
||||
t.true(__1.default.falsy(null));
|
||||
t.true(__1.default.falsy(undefined));
|
||||
t.true(__1.default.falsy(NaN));
|
||||
});
|
||||
ava_1.default('is.nan', t => {
|
||||
testType(t, 'nan');
|
||||
});
|
||||
ava_1.default('is.nullOrUndefined', t => {
|
||||
testType(t, 'nullOrUndefined', ['undefined', 'null']);
|
||||
});
|
||||
ava_1.default('is.primitive', t => {
|
||||
const primitives = [
|
||||
undefined,
|
||||
null,
|
||||
'🦄',
|
||||
6,
|
||||
Infinity,
|
||||
-Infinity,
|
||||
true,
|
||||
false,
|
||||
Symbol('🦄')
|
||||
];
|
||||
for (const el of primitives) {
|
||||
t.true(__1.default.primitive(el));
|
||||
}
|
||||
});
|
||||
ava_1.default('is.integer', t => {
|
||||
testType(t, 'integer', ['number', 'safeInteger']);
|
||||
t.false(__1.default.integer(1.4));
|
||||
});
|
||||
ava_1.default('is.safeInteger', t => {
|
||||
testType(t, 'safeInteger', ['number', 'integer']);
|
||||
t.false(__1.default.safeInteger(Math.pow(2, 53)));
|
||||
t.false(__1.default.safeInteger(-Math.pow(2, 53)));
|
||||
});
|
||||
ava_1.default('is.plainObject', t => {
|
||||
testType(t, 'plainObject', ['object', 'promise']);
|
||||
});
|
||||
ava_1.default('is.iterable', t => {
|
||||
t.true(__1.default.iterable(''));
|
||||
t.true(__1.default.iterable([]));
|
||||
t.true(__1.default.iterable(new Map()));
|
||||
t.false(__1.default.iterable(null));
|
||||
t.false(__1.default.iterable(undefined));
|
||||
t.false(__1.default.iterable(0));
|
||||
t.false(__1.default.iterable(NaN));
|
||||
t.false(__1.default.iterable(Infinity));
|
||||
t.false(__1.default.iterable({}));
|
||||
});
|
||||
ava_1.default('is.class', t => {
|
||||
class Foo {
|
||||
}
|
||||
const classDeclarations = [
|
||||
Foo,
|
||||
class Bar extends Foo {
|
||||
}
|
||||
];
|
||||
for (const x of classDeclarations) {
|
||||
t.true(__1.default.class_(x));
|
||||
}
|
||||
});
|
||||
ava_1.default('is.typedArray', t => {
|
||||
const typedArrays = [
|
||||
new Int8Array(0),
|
||||
new Uint8Array(0),
|
||||
new Uint8ClampedArray(0),
|
||||
new Uint16Array(0),
|
||||
new Int32Array(0),
|
||||
new Uint32Array(0),
|
||||
new Float32Array(0),
|
||||
new Float64Array(0)
|
||||
];
|
||||
for (const el of typedArrays) {
|
||||
t.true(__1.default.typedArray(el));
|
||||
}
|
||||
t.false(__1.default.typedArray(new ArrayBuffer(1)));
|
||||
t.false(__1.default.typedArray([]));
|
||||
t.false(__1.default.typedArray({}));
|
||||
});
|
||||
ava_1.default('is.arrayLike', t => {
|
||||
(() => {
|
||||
t.true(__1.default.arrayLike(arguments));
|
||||
})();
|
||||
t.true(__1.default.arrayLike([]));
|
||||
t.true(__1.default.arrayLike('unicorn'));
|
||||
t.false(__1.default.arrayLike({}));
|
||||
t.false(__1.default.arrayLike(() => { }));
|
||||
t.false(__1.default.arrayLike(new Map()));
|
||||
});
|
||||
ava_1.default('is.inRange', t => {
|
||||
const x = 3;
|
||||
t.true(__1.default.inRange(x, [0, 5]));
|
||||
t.true(__1.default.inRange(x, [5, 0]));
|
||||
t.true(__1.default.inRange(x, [-5, 5]));
|
||||
t.true(__1.default.inRange(x, [5, -5]));
|
||||
t.false(__1.default.inRange(x, [4, 8]));
|
||||
t.true(__1.default.inRange(-7, [-5, -10]));
|
||||
t.true(__1.default.inRange(-5, [-5, -10]));
|
||||
t.true(__1.default.inRange(-10, [-5, -10]));
|
||||
t.true(__1.default.inRange(x, 10));
|
||||
t.true(__1.default.inRange(0, 0));
|
||||
t.true(__1.default.inRange(-2, -3));
|
||||
t.false(__1.default.inRange(x, 2));
|
||||
t.false(__1.default.inRange(-3, -2));
|
||||
t.throws(() => {
|
||||
__1.default.inRange(0, []);
|
||||
});
|
||||
t.throws(() => {
|
||||
__1.default.inRange(0, [5]);
|
||||
});
|
||||
t.throws(() => {
|
||||
__1.default.inRange(0, [1, 2, 3]);
|
||||
});
|
||||
});
|
||||
ava_1.default('is.domElement', t => {
|
||||
testType(t, 'domElement');
|
||||
t.false(__1.default.domElement({ nodeType: 1, nodeName: 'div' }));
|
||||
});
|
||||
ava_1.default('is.infinite', t => {
|
||||
testType(t, 'infinite', ['number']);
|
||||
});
|
||||
ava_1.default('is.even', t => {
|
||||
for (const el of [-6, 2, 4]) {
|
||||
t.true(__1.default.even(el));
|
||||
}
|
||||
for (const el of [-3, 1, 5]) {
|
||||
t.false(__1.default.even(el));
|
||||
}
|
||||
});
|
||||
ava_1.default('is.odd', t => {
|
||||
for (const el of [-5, 7, 13]) {
|
||||
t.true(__1.default.odd(el));
|
||||
}
|
||||
for (const el of [-8, 8, 10]) {
|
||||
t.false(__1.default.odd(el));
|
||||
}
|
||||
});
|
||||
ava_1.default('is.empty', t => {
|
||||
t.true(__1.default.empty(null));
|
||||
t.true(__1.default.empty(undefined));
|
||||
t.true(__1.default.empty(false));
|
||||
t.false(__1.default.empty(true));
|
||||
t.true(__1.default.empty(''));
|
||||
t.false(__1.default.empty('🦄'));
|
||||
t.true(__1.default.empty([]));
|
||||
t.false(__1.default.empty(['🦄']));
|
||||
t.true(__1.default.empty({}));
|
||||
t.false(__1.default.empty({ unicorn: '🦄' }));
|
||||
const tempMap = new Map();
|
||||
t.true(__1.default.empty(tempMap));
|
||||
tempMap.set('unicorn', '🦄');
|
||||
t.false(__1.default.empty(tempMap));
|
||||
const tempSet = new Set();
|
||||
t.true(__1.default.empty(tempSet));
|
||||
tempSet.add(1);
|
||||
t.false(__1.default.empty(tempSet));
|
||||
});
|
||||
ava_1.default('is.emptyOrWhitespace', t => {
|
||||
t.true(__1.default.emptyOrWhitespace(''));
|
||||
t.true(__1.default.emptyOrWhitespace(' '));
|
||||
t.false(__1.default.emptyOrWhitespace('🦄'));
|
||||
t.false(__1.default.emptyOrWhitespace('unicorn'));
|
||||
});
|
||||
ava_1.default('is.any', t => {
|
||||
t.true(__1.default.any(__1.default.string, {}, true, '🦄'));
|
||||
t.true(__1.default.any(__1.default.object, false, {}, 'unicorns'));
|
||||
t.false(__1.default.any(__1.default.boolean, '🦄', [], 3));
|
||||
t.false(__1.default.any(__1.default.integer, true, 'lol', {}));
|
||||
t.throws(() => {
|
||||
__1.default.any(null, true);
|
||||
});
|
||||
t.throws(() => {
|
||||
__1.default.any(__1.default.string);
|
||||
});
|
||||
});
|
||||
ava_1.default('is.all', t => {
|
||||
t.true(__1.default.all(__1.default.object, {}, new Set(), new Map()));
|
||||
t.true(__1.default.all(__1.default.boolean, true, false));
|
||||
t.false(__1.default.all(__1.default.string, '🦄', []));
|
||||
t.false(__1.default.all(__1.default.set, new Map(), {}));
|
||||
t.throws(() => {
|
||||
__1.default.all(null, true);
|
||||
});
|
||||
t.throws(() => {
|
||||
__1.default.all(__1.default.string);
|
||||
});
|
||||
});
|
||||
//# sourceMappingURL=test.js.map
|
||||
1
node_modules/@sindresorhus/is/dist/source/tests/test.js.map
generated
vendored
1
node_modules/@sindresorhus/is/dist/source/tests/test.js.map
generated
vendored
File diff suppressed because one or more lines are too long
9
node_modules/@sindresorhus/is/license
generated
vendored
9
node_modules/@sindresorhus/is/license
generated
vendored
@@ -1,9 +0,0 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
||||
|
||||
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.
|
||||
95
node_modules/@sindresorhus/is/package.json
generated
vendored
95
node_modules/@sindresorhus/is/package.json
generated
vendored
@@ -1,95 +0,0 @@
|
||||
{
|
||||
"_from": "@sindresorhus/is@^0.7.0",
|
||||
"_id": "@sindresorhus/is@0.7.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-ONhaKPIufzzrlNbqtWFFd+jlnemX6lJAgq9ZeiZtS7I1PIf/la7CW4m83rTXRnVnsMbW2k56pGYu7AUFJD9Pow==",
|
||||
"_location": "/@sindresorhus/is",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "@sindresorhus/is@^0.7.0",
|
||||
"name": "@sindresorhus/is",
|
||||
"escapedName": "@sindresorhus%2fis",
|
||||
"scope": "@sindresorhus",
|
||||
"rawSpec": "^0.7.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^0.7.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/bin-wrapper/got"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-0.7.0.tgz",
|
||||
"_shasum": "9a06f4f137ee84d7df0460c1fdb1135ffa6c50fd",
|
||||
"_spec": "@sindresorhus/is@^0.7.0",
|
||||
"_where": "/var/www/html/jason/WeihnachtenMelly/node_modules/bin-wrapper/node_modules/got",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/sindresorhus/is/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"deprecated": false,
|
||||
"description": "Type check values: `is.string('🦄') //=> true`",
|
||||
"devDependencies": {
|
||||
"@types/jsdom": "^2.0.31",
|
||||
"@types/node": "^8.0.47",
|
||||
"@types/tempy": "^0.1.0",
|
||||
"ava": "*",
|
||||
"del-cli": "^1.1.0",
|
||||
"jsdom": "^9.12.0",
|
||||
"tempy": "^0.2.1",
|
||||
"tslint": "^5.8.0",
|
||||
"tslint-xo": "^0.3.0",
|
||||
"typescript": "^2.6.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
},
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
"homepage": "https://github.com/sindresorhus/is#readme",
|
||||
"keywords": [
|
||||
"type",
|
||||
"types",
|
||||
"is",
|
||||
"check",
|
||||
"checking",
|
||||
"validate",
|
||||
"validation",
|
||||
"utility",
|
||||
"util",
|
||||
"typeof",
|
||||
"instanceof",
|
||||
"object",
|
||||
"assert",
|
||||
"assertion",
|
||||
"test",
|
||||
"kind",
|
||||
"primitive",
|
||||
"verify",
|
||||
"compare"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "dist/index.js",
|
||||
"name": "@sindresorhus/is",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/sindresorhus/is.git"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "tsc",
|
||||
"lint": "tslint --format stylish --project .",
|
||||
"prepublish": "npm run build && del dist/tests",
|
||||
"test": "npm run lint && npm run build && ava dist/tests"
|
||||
},
|
||||
"types": "dist/index.d.ts",
|
||||
"version": "0.7.0"
|
||||
}
|
||||
323
node_modules/@sindresorhus/is/readme.md
generated
vendored
323
node_modules/@sindresorhus/is/readme.md
generated
vendored
@@ -1,323 +0,0 @@
|
||||
# is [](https://travis-ci.org/sindresorhus/is)
|
||||
|
||||
> Type check values: `is.string('🦄') //=> true`
|
||||
|
||||
<img src="header.gif" width="182" align="right">
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install @sindresorhus/is
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const is = require('@sindresorhus/is');
|
||||
|
||||
is('🦄');
|
||||
//=> 'string'
|
||||
|
||||
is(new Map());
|
||||
//=> 'Map'
|
||||
|
||||
is.number(6);
|
||||
//=> true
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
### is(value)
|
||||
|
||||
Returns the type of `value`.
|
||||
|
||||
Primitives are lowercase and object types are camelcase.
|
||||
|
||||
Example:
|
||||
|
||||
- `'undefined'`
|
||||
- `'null'`
|
||||
- `'string'`
|
||||
- `'symbol'`
|
||||
- `'Array'`
|
||||
- `'Function'`
|
||||
- `'Object'`
|
||||
|
||||
Note: It will throw if you try to feed it object-wrapped primitives, as that's a bad practice. For example `new String('foo')`.
|
||||
|
||||
### is.{method}
|
||||
|
||||
All the below methods accept a value and returns a boolean for whether the value is of the desired type.
|
||||
|
||||
#### Primitives
|
||||
|
||||
##### .undefined(value)
|
||||
##### .null(value)
|
||||
##### .string(value)
|
||||
##### .number(value)
|
||||
##### .boolean(value)
|
||||
##### .symbol(value)
|
||||
|
||||
#### Built-in types
|
||||
|
||||
##### .array(value)
|
||||
##### .function(value)
|
||||
##### .buffer(value)
|
||||
##### .object(value)
|
||||
|
||||
Keep in mind that [functions are objects too](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions).
|
||||
|
||||
##### .regExp(value)
|
||||
##### .date(value)
|
||||
##### .error(value)
|
||||
##### .nativePromise(value)
|
||||
##### .promise(value)
|
||||
|
||||
Returns `true` for any object with a `.then()` and `.catch()` method. Prefer this one over `.nativePromise()` as you usually want to allow userland promise implementations too.
|
||||
|
||||
##### .generator(value)
|
||||
|
||||
Returns `true` for any object that implements its own `.next()` and `.throw()` methods and has a function definition for `Symbol.iterator`.
|
||||
|
||||
##### .generatorFunction(value)
|
||||
|
||||
##### .asyncFunction(value)
|
||||
|
||||
Returns `true` for any `async` function that can be called with the `await` operator.
|
||||
|
||||
```js
|
||||
is.asyncFunction(async () => {});
|
||||
// => true
|
||||
|
||||
is.asyncFunction(() => {});
|
||||
// => false
|
||||
```
|
||||
|
||||
##### .boundFunction(value)
|
||||
|
||||
Returns `true` for any `bound` function.
|
||||
|
||||
```js
|
||||
is.boundFunction(() => {});
|
||||
// => true
|
||||
|
||||
is.boundFunction(function () {}.bind(null));
|
||||
// => true
|
||||
|
||||
is.boundFunction(function () {});
|
||||
// => false
|
||||
```
|
||||
|
||||
##### .map(value)
|
||||
##### .set(value)
|
||||
##### .weakMap(value)
|
||||
##### .weakSet(value)
|
||||
|
||||
#### Typed arrays
|
||||
|
||||
##### .int8Array(value)
|
||||
##### .uint8Array(value)
|
||||
##### .uint8ClampedArray(value)
|
||||
##### .int16Array(value)
|
||||
##### .uint16Array(value)
|
||||
##### .int32Array(value)
|
||||
##### .uint32Array(value)
|
||||
##### .float32Array(value)
|
||||
##### .float64Array(value)
|
||||
|
||||
#### Structured data
|
||||
|
||||
##### .arrayBuffer(value)
|
||||
##### .sharedArrayBuffer(value)
|
||||
##### .dataView(value)
|
||||
|
||||
#### Miscellaneous
|
||||
|
||||
##### .directInstanceOf(value, class)
|
||||
|
||||
Returns `true` if `value` is a direct instance of `class`.
|
||||
|
||||
```js
|
||||
is.directInstanceOf(new Error(), Error);
|
||||
//=> true
|
||||
|
||||
class UnicornError extends Error {};
|
||||
|
||||
is.directInstanceOf(new UnicornError(), Error);
|
||||
//=> false
|
||||
```
|
||||
|
||||
##### .truthy(value)
|
||||
|
||||
Returns `true` for all values that evaluate to true in a boolean context:
|
||||
|
||||
```js
|
||||
is.truthy('🦄');
|
||||
//=> true
|
||||
|
||||
is.truthy(undefined);
|
||||
//=> false
|
||||
```
|
||||
|
||||
##### .falsy(value)
|
||||
|
||||
Returns `true` if `value` is one of: `false`, `0`, `''`, `null`, `undefined`, `NaN`.
|
||||
|
||||
##### .nan(value)
|
||||
##### .nullOrUndefined(value)
|
||||
##### .primitive(value)
|
||||
|
||||
JavaScript primitives are as follows: `null`, `undefined`, `string`, `number`, `boolean`, `symbol`.
|
||||
|
||||
##### .integer(value)
|
||||
|
||||
##### .safeInteger(value)
|
||||
|
||||
Returns `true` if `value` is a [safe integer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isSafeInteger).
|
||||
|
||||
##### .plainObject(value)
|
||||
|
||||
An object is plain if it's created by either `{}`, `new Object()`, or `Object.create(null)`.
|
||||
|
||||
##### .iterable(value)
|
||||
##### .class(value)
|
||||
|
||||
Returns `true` for instances created by a ES2015 class.
|
||||
|
||||
##### .typedArray(value)
|
||||
|
||||
##### .arrayLike(value)
|
||||
|
||||
A `value` is array-like if it is not a function and has a `value.length` that is a safe integer greater than or equal to 0.
|
||||
|
||||
```js
|
||||
is.arrayLike(document.forms);
|
||||
//=> true
|
||||
|
||||
function () {
|
||||
is.arrayLike(arguments);
|
||||
//=> true
|
||||
}
|
||||
```
|
||||
|
||||
##### .inRange(value, range)
|
||||
|
||||
Check if `value` (number) is in the given `range`. The range is an array of two values, lower bound and upper bound, in no specific order.
|
||||
|
||||
```js
|
||||
is.inRange(3, [0, 5]);
|
||||
is.inRange(3, [5, 0]);
|
||||
is.inRange(0, [-2, 2]);
|
||||
```
|
||||
|
||||
##### .inRange(value, upperBound)
|
||||
|
||||
Check if `value` (number) is in the range of `0` to `upperBound`.
|
||||
|
||||
```js
|
||||
is.inRange(3, 10);
|
||||
```
|
||||
|
||||
##### .domElement(value)
|
||||
|
||||
Returns `true` if `value` is a DOM Element.
|
||||
|
||||
##### .nodeStream(value)
|
||||
|
||||
Returns `true` if `value` is a Node.js [stream](https://nodejs.org/api/stream.html).
|
||||
|
||||
```js
|
||||
const fs = require('fs');
|
||||
is.nodeStream(fs.createReadStream('unicorn.png'));
|
||||
//=> true
|
||||
```
|
||||
|
||||
##### .infinite(value)
|
||||
|
||||
Check if `value` is `Infinity` or `-Infinity`.
|
||||
|
||||
##### .even(value)
|
||||
|
||||
Returns `true` if `value` is an even integer.
|
||||
|
||||
##### .odd(value)
|
||||
|
||||
Returns `true` if `value` is an odd integer.
|
||||
|
||||
##### .empty(value)
|
||||
|
||||
Returns `true` if `value` is falsy or an empty string, array, object, map, or set.
|
||||
|
||||
##### .emptyOrWhitespace(value)
|
||||
|
||||
Returns `true` if `is.empty(value)` or a string that is all whitespace.
|
||||
|
||||
|
||||
##### .any(predicate, ...values)
|
||||
|
||||
Returns `true` if **any** of the input `values` returns true in the `predicate`:
|
||||
|
||||
```js
|
||||
is.any(is.string, {}, true, '🦄');
|
||||
//=> true
|
||||
|
||||
is.any(is.boolean, 'unicorns', [], new Map());
|
||||
//=> false
|
||||
```
|
||||
|
||||
##### .all(predicate, ...values)
|
||||
|
||||
Returns `true` if **all** of the input `values` returns true in the `predicate`:
|
||||
|
||||
```js
|
||||
is.all(is.object, {}, new Map(), new Set());
|
||||
//=> true
|
||||
|
||||
is.all(is.string, '🦄', [], 'unicorns');
|
||||
//=> false
|
||||
```
|
||||
|
||||
## FAQ
|
||||
|
||||
### Why yet another type checking module?
|
||||
|
||||
There are hundreds of type checking modules on npm, unfortunately, I couldn't find any that fit my needs:
|
||||
|
||||
- Includes both type methods and ability to get the type
|
||||
- Types of primitives returned as lowercase and object types as camelcase
|
||||
- Covers all built-ins
|
||||
- Unsurprising behavior
|
||||
- Well-maintained
|
||||
- Comprehensive test suite
|
||||
|
||||
For the ones I found, pick 3 of these.
|
||||
|
||||
The most common mistakes I noticed in these modules was using `instanceof` for type checking, forgetting that functions are objects, and omitting `symbol` as a primitive.
|
||||
|
||||
|
||||
## Related
|
||||
|
||||
- [is-stream](https://github.com/sindresorhus/is-stream) - Check if something is a Node.js stream
|
||||
- [is-observable](https://github.com/sindresorhus/is-observable) - Check if a value is an Observable
|
||||
- [file-type](https://github.com/sindresorhus/file-type) - Detect the file type of a Buffer/Uint8Array
|
||||
- [is-ip](https://github.com/sindresorhus/is-ip) - Check if a string is an IP address
|
||||
- [is-array-sorted](https://github.com/sindresorhus/is-array-sorted) - Check if an Array is sorted
|
||||
- [is-error-constructor](https://github.com/sindresorhus/is-error-constructor) - Check if a value is an error constructor
|
||||
- [is-empty-iterable](https://github.com/sindresorhus/is-empty-iterable) - Check if an Iterable is empty
|
||||
- [is-blob](https://github.com/sindresorhus/is-blob) - Check if a value is a Blob - File-like object of immutable, raw data
|
||||
- [has-emoji](https://github.com/sindresorhus/has-emoji) - Check whether a string has any emoji
|
||||
|
||||
|
||||
## Created by
|
||||
|
||||
- [Sindre Sorhus](https://github.com/sindresorhus)
|
||||
- [Giora Guttsait](https://github.com/gioragutt)
|
||||
- [Brandon Smith](https://github.com/brandon93s)
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user