aboutsummaryrefslogtreecommitdiff
path: root/node_modules/@kwsites/file-exists/dist
diff options
context:
space:
mode:
authorScoots Dash <contact@minteck.org>2022-04-23 14:12:30 +0000
committerScoots Dash <contact@minteck.org>2022-04-23 14:12:30 +0000
commita927497b43cbe1438f3d7478932f3f7d03ea347c (patch)
tree0a3c88978b4294fb30afad58daa86c46fbedc2f6 /node_modules/@kwsites/file-exists/dist
parentba5fa694351774f2684c1aefdc215da5c6f39ba6 (diff)
parentf0db5bbbcd623812a391862d217519afafe197c6 (diff)
downloadtwilight-a927497b43cbe1438f3d7478932f3f7d03ea347c.tar.gz
twilight-a927497b43cbe1438f3d7478932f3f7d03ea347c.tar.bz2
twilight-a927497b43cbe1438f3d7478932f3f7d03ea347c.zip
Merge branch 'deprecation' into 'trunk'HEADtrunk
Disable the Twilight Package Manager See merge request minteck/twilight!1
Diffstat (limited to 'node_modules/@kwsites/file-exists/dist')
-rw-r--r--node_modules/@kwsites/file-exists/dist/index.d.ts1
-rw-r--r--node_modules/@kwsites/file-exists/dist/index.js7
-rw-r--r--node_modules/@kwsites/file-exists/dist/index.js.map1
-rw-r--r--node_modules/@kwsites/file-exists/dist/src/index.d.ts19
-rw-r--r--node_modules/@kwsites/file-exists/dist/src/index.js55
-rw-r--r--node_modules/@kwsites/file-exists/dist/src/index.js.map1
-rw-r--r--node_modules/@kwsites/file-exists/dist/test/__mocks__/fs.d.ts7
-rw-r--r--node_modules/@kwsites/file-exists/dist/test/__mocks__/fs.js26
-rw-r--r--node_modules/@kwsites/file-exists/dist/test/__mocks__/fs.js.map1
-rw-r--r--node_modules/@kwsites/file-exists/dist/test/exists.spec.d.ts1
-rw-r--r--node_modules/@kwsites/file-exists/dist/test/exists.spec.js77
-rw-r--r--node_modules/@kwsites/file-exists/dist/test/exists.spec.js.map1
12 files changed, 0 insertions, 197 deletions
diff --git a/node_modules/@kwsites/file-exists/dist/index.d.ts b/node_modules/@kwsites/file-exists/dist/index.d.ts
deleted file mode 100644
index 8420b10..0000000
--- a/node_modules/@kwsites/file-exists/dist/index.d.ts
+++ /dev/null
@@ -1 +0,0 @@
-export * from './src';
diff --git a/node_modules/@kwsites/file-exists/dist/index.js b/node_modules/@kwsites/file-exists/dist/index.js
deleted file mode 100644
index 87332ba..0000000
--- a/node_modules/@kwsites/file-exists/dist/index.js
+++ /dev/null
@@ -1,7 +0,0 @@
-"use strict";
-function __export(m) {
- for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
-}
-Object.defineProperty(exports, "__esModule", { value: true });
-__export(require("./src"));
-//# sourceMappingURL=index.js.map \ No newline at end of file
diff --git a/node_modules/@kwsites/file-exists/dist/index.js.map b/node_modules/@kwsites/file-exists/dist/index.js.map
deleted file mode 100644
index 3b75ca4..0000000
--- a/node_modules/@kwsites/file-exists/dist/index.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;;;AACA,2BAAsB"} \ No newline at end of file
diff --git a/node_modules/@kwsites/file-exists/dist/src/index.d.ts b/node_modules/@kwsites/file-exists/dist/src/index.d.ts
deleted file mode 100644
index 3d234cd..0000000
--- a/node_modules/@kwsites/file-exists/dist/src/index.d.ts
+++ /dev/null
@@ -1,19 +0,0 @@
-/**
- * Synchronous validation of a path existing either as a file or as a directory.
- *
- * @param {string} path The path to check
- * @param {number} type One or both of the exported numeric constants
- */
-export declare function exists(path: string, type?: number): boolean;
-/**
- * Constant representing a file
- */
-export declare const FILE = 1;
-/**
- * Constant representing a folder
- */
-export declare const FOLDER = 2;
-/**
- * Constant representing either a file or a folder
- */
-export declare const READABLE: number;
diff --git a/node_modules/@kwsites/file-exists/dist/src/index.js b/node_modules/@kwsites/file-exists/dist/src/index.js
deleted file mode 100644
index 8a41c70..0000000
--- a/node_modules/@kwsites/file-exists/dist/src/index.js
+++ /dev/null
@@ -1,55 +0,0 @@
-"use strict";
-var __importDefault = (this && this.__importDefault) || function (mod) {
- return (mod && mod.__esModule) ? mod : { "default": mod };
-};
-Object.defineProperty(exports, "__esModule", { value: true });
-const fs_1 = require("fs");
-const debug_1 = __importDefault(require("debug"));
-const log = debug_1.default('@kwsites/file-exists');
-function check(path, isFile, isDirectory) {
- log(`checking %s`, path);
- try {
- const stat = fs_1.statSync(path);
- if (stat.isFile() && isFile) {
- log(`[OK] path represents a file`);
- return true;
- }
- if (stat.isDirectory() && isDirectory) {
- log(`[OK] path represents a directory`);
- return true;
- }
- log(`[FAIL] path represents something other than a file or directory`);
- return false;
- }
- catch (e) {
- if (e.code === 'ENOENT') {
- log(`[FAIL] path is not accessible: %o`, e);
- return false;
- }
- log(`[FATAL] %o`, e);
- throw e;
- }
-}
-/**
- * Synchronous validation of a path existing either as a file or as a directory.
- *
- * @param {string} path The path to check
- * @param {number} type One or both of the exported numeric constants
- */
-function exists(path, type = exports.READABLE) {
- return check(path, (type & exports.FILE) > 0, (type & exports.FOLDER) > 0);
-}
-exports.exists = exists;
-/**
- * Constant representing a file
- */
-exports.FILE = 1;
-/**
- * Constant representing a folder
- */
-exports.FOLDER = 2;
-/**
- * Constant representing either a file or a folder
- */
-exports.READABLE = exports.FILE + exports.FOLDER;
-//# sourceMappingURL=index.js.map \ No newline at end of file
diff --git a/node_modules/@kwsites/file-exists/dist/src/index.js.map b/node_modules/@kwsites/file-exists/dist/src/index.js.map
deleted file mode 100644
index 68f2b8a..0000000
--- a/node_modules/@kwsites/file-exists/dist/src/index.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;AAAA,2BAA8B;AAC9B,kDAA0B;AAE1B,MAAM,GAAG,GAAG,eAAK,CAAC,sBAAsB,CAAC,CAAC;AAE1C,SAAS,KAAK,CAAC,IAAY,EAAE,MAAe,EAAE,WAAoB;IAC/D,GAAG,CAAC,aAAa,EAAE,IAAI,CAAC,CAAC;IAEzB,IAAI;QACD,MAAM,IAAI,GAAG,aAAQ,CAAC,IAAI,CAAC,CAAC;QAE5B,IAAI,IAAI,CAAC,MAAM,EAAE,IAAI,MAAM,EAAE;YAC1B,GAAG,CAAC,6BAA6B,CAAC,CAAC;YACnC,OAAO,IAAI,CAAC;SACd;QAED,IAAI,IAAI,CAAC,WAAW,EAAE,IAAI,WAAW,EAAE;YACpC,GAAG,CAAC,kCAAkC,CAAC,CAAC;YACxC,OAAO,IAAI,CAAC;SACd;QAED,GAAG,CAAC,iEAAiE,CAAC,CAAC;QACvE,OAAO,KAAK,CAAC;KACf;IAAC,OAAO,CAAC,EAAE;QACT,IAAI,CAAC,CAAC,IAAI,KAAK,QAAQ,EAAE;YACtB,GAAG,CAAC,mCAAmC,EAAE,CAAC,CAAC,CAAC;YAC5C,OAAO,KAAK,CAAC;SACf;QAED,GAAG,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC;QACrB,MAAM,CAAC,CAAC;KACV;AACJ,CAAC;AAED;;;;;GAKG;AACH,SAAgB,MAAM,CAAC,IAAY,EAAE,OAAe,gBAAQ;IACzD,OAAO,KAAK,CAAC,IAAI,EAAE,CAAC,IAAI,GAAG,YAAI,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,GAAG,cAAM,CAAC,GAAG,CAAC,CAAC,CAAC;AAC9D,CAAC;AAFD,wBAEC;AAED;;GAEG;AACU,QAAA,IAAI,GAAG,CAAC,CAAC;AAEtB;;GAEG;AACU,QAAA,MAAM,GAAG,CAAC,CAAC;AAExB;;GAEG;AACU,QAAA,QAAQ,GAAG,YAAI,GAAG,cAAM,CAAC"} \ No newline at end of file
diff --git a/node_modules/@kwsites/file-exists/dist/test/__mocks__/fs.d.ts b/node_modules/@kwsites/file-exists/dist/test/__mocks__/fs.d.ts
deleted file mode 100644
index ab80d33..0000000
--- a/node_modules/@kwsites/file-exists/dist/test/__mocks__/fs.d.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-export declare function statSync(...args: any[]): any;
-export declare function addStatSyncMock(fn: any): void;
-export declare function assertMocksUsed(): void;
-declare const mockFs: {
- statSync: typeof statSync;
-};
-export default mockFs;
diff --git a/node_modules/@kwsites/file-exists/dist/test/__mocks__/fs.js b/node_modules/@kwsites/file-exists/dist/test/__mocks__/fs.js
deleted file mode 100644
index cd46c71..0000000
--- a/node_modules/@kwsites/file-exists/dist/test/__mocks__/fs.js
+++ /dev/null
@@ -1,26 +0,0 @@
-"use strict";
-Object.defineProperty(exports, "__esModule", { value: true });
-let statSyncMocks = [];
-function statSync(...args) {
- const mock = statSyncMocks.shift();
- if (typeof mock !== 'function') {
- throw new Error(`fs.statSync called without configuring a mock`);
- }
- return mock(...args);
-}
-exports.statSync = statSync;
-function addStatSyncMock(fn) {
- statSyncMocks.push(fn);
-}
-exports.addStatSyncMock = addStatSyncMock;
-function assertMocksUsed() {
- if (statSyncMocks.length) {
- throw new Error(`fs.afterEach: statSync has ${statSyncMocks.length} unused mocks`);
- }
-}
-exports.assertMocksUsed = assertMocksUsed;
-const mockFs = {
- statSync,
-};
-exports.default = mockFs;
-//# sourceMappingURL=fs.js.map \ No newline at end of file
diff --git a/node_modules/@kwsites/file-exists/dist/test/__mocks__/fs.js.map b/node_modules/@kwsites/file-exists/dist/test/__mocks__/fs.js.map
deleted file mode 100644
index e2a3d16..0000000
--- a/node_modules/@kwsites/file-exists/dist/test/__mocks__/fs.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"fs.js","sourceRoot":"","sources":["../../../test/__mocks__/fs.ts"],"names":[],"mappings":";;AACA,IAAI,aAAa,GAAU,EAAE,CAAC;AAE9B,SAAgB,QAAQ,CAAC,GAAG,IAAW;IACpC,MAAO,IAAI,GAAG,aAAa,CAAC,KAAK,EAAE,CAAC;IACpC,IAAI,OAAO,IAAI,KAAK,UAAU,EAAE;QAC7B,MAAM,IAAI,KAAK,CAAC,+CAA+C,CAAC,CAAC;KACnE;IAED,OAAO,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC;AACxB,CAAC;AAPD,4BAOC;AAED,SAAgB,eAAe,CAAC,EAAO;IACpC,aAAa,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC1B,CAAC;AAFD,0CAEC;AAED,SAAgB,eAAe;IAC5B,IAAI,aAAa,CAAC,MAAM,EAAE;QACvB,MAAM,IAAI,KAAK,CAAC,8BAA8B,aAAa,CAAC,MAAM,eAAe,CAAC,CAAC;KACrF;AACJ,CAAC;AAJD,0CAIC;AAED,MAAM,MAAM,GAAG;IACZ,QAAQ;CACV,CAAA;AAED,kBAAe,MAAM,CAAC"} \ No newline at end of file
diff --git a/node_modules/@kwsites/file-exists/dist/test/exists.spec.d.ts b/node_modules/@kwsites/file-exists/dist/test/exists.spec.d.ts
deleted file mode 100644
index cb0ff5c..0000000
--- a/node_modules/@kwsites/file-exists/dist/test/exists.spec.d.ts
+++ /dev/null
@@ -1 +0,0 @@
-export {};
diff --git a/node_modules/@kwsites/file-exists/dist/test/exists.spec.js b/node_modules/@kwsites/file-exists/dist/test/exists.spec.js
deleted file mode 100644
index a36b549..0000000
--- a/node_modules/@kwsites/file-exists/dist/test/exists.spec.js
+++ /dev/null
@@ -1,77 +0,0 @@
-"use strict";
-Object.defineProperty(exports, "__esModule", { value: true });
-jest.mock('fs');
-//@ts-ignore
-const fs_1 = require("fs");
-const src_1 = require("../src");
-describe(`exists`, () => {
- let statSync;
- let statSyncMock;
- let path;
- beforeEach(() => {
- path = `./path/${Math.random()}`;
- fs_1.addStatSyncMock(statSyncMock = jest.fn(() => statSync()));
- });
- afterEach(() => {
- fs_1.assertMocksUsed();
- statSync = statSyncMock = undefined;
- });
- describe('known errors', () => {
- beforeEach(() => givenStatSyncThrows({ code: 'ENOENT' }));
- it('with type', () => {
- expect(src_1.exists(path, src_1.READABLE)).toBe(false);
- });
- it('with type omitted', () => {
- expect(src_1.exists(path)).toBe(false);
- });
- });
- describe('unknown errors', () => {
- let err;
- beforeEach(() => err = givenStatSyncThrows(new Error('something')));
- it('with type', () => {
- expect(() => src_1.exists(path, src_1.READABLE)).toThrow(err);
- });
- it('with type omitted', () => {
- expect(() => src_1.exists(path)).toThrow(err);
- });
- });
- describe('path is a file', () => {
- beforeEach(() => givenStatSyncIsA('file'));
- existsReturns(true, false, true);
- });
- describe('path is a folder', () => {
- beforeEach(() => givenStatSyncIsA('folder'));
- existsReturns(false, true, true);
- });
- describe('path is unknown', () => {
- beforeEach(() => givenStatSyncIsA('unknown'));
- existsReturns(false, false, false);
- });
- function existsReturns(file, folder, readable) {
- it('when searching for a file', () => {
- expect(src_1.exists(path, src_1.FILE)).toBe(file);
- });
- it('when searching for a folder', () => {
- expect(src_1.exists(path, src_1.FOLDER)).toBe(folder);
- });
- it('when searching for either', () => {
- expect(src_1.exists(path, src_1.READABLE)).toBe(readable);
- });
- it('when searching without a type', () => {
- expect(src_1.exists(path)).toBe(readable);
- });
- }
- function givenStatSyncThrows(err) {
- statSync = () => { throw err; };
- return err;
- }
- function givenStatSyncIsA(type) {
- const mockStat = {
- isFile() { return type === 'file'; },
- isDirectory() { return type === 'folder'; },
- };
- statSync = () => mockStat;
- return mockStat;
- }
-});
-//# sourceMappingURL=exists.spec.js.map \ No newline at end of file
diff --git a/node_modules/@kwsites/file-exists/dist/test/exists.spec.js.map b/node_modules/@kwsites/file-exists/dist/test/exists.spec.js.map
deleted file mode 100644
index 669176a..0000000
--- a/node_modules/@kwsites/file-exists/dist/test/exists.spec.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"exists.spec.js","sourceRoot":"","sources":["../../test/exists.spec.ts"],"names":[],"mappings":";;AACA,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAEhB,YAAY;AACZ,2BAAsD;AACtD,gCAAwD;AAExD,QAAQ,CAAC,QAAQ,EAAE,GAAG,EAAE;IAErB,IAAI,QAAa,CAAC;IAClB,IAAI,YAAiB,CAAC;IACtB,IAAI,IAAY,CAAC;IAEjB,UAAU,CAAC,GAAG,EAAE;QACb,IAAI,GAAG,UAAU,IAAI,CAAC,MAAM,EA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