@sapphire/pieces
Advanced tools
Comparing version 3.0.0-next.7dc4b70.0 to 3.0.0
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const tslib_1 = require("tslib"); | ||
tslib_1.__exportStar(require("./lib/errors/LoaderError"), exports); | ||
tslib_1.__exportStar(require("./lib/errors/MissingExportsError"), exports); | ||
tslib_1.__exportStar(require("./lib/internal/RootScan"), exports); | ||
tslib_1.__exportStar(require("./lib/shared/Container"), exports); | ||
tslib_1.__exportStar(require("./lib/strategies/ILoaderStrategy"), exports); | ||
tslib_1.__exportStar(require("./lib/strategies/LoaderStrategy"), exports); | ||
tslib_1.__exportStar(require("./lib/structures/AliasPiece"), exports); | ||
tslib_1.__exportStar(require("./lib/structures/AliasStore"), exports); | ||
tslib_1.__exportStar(require("./lib/structures/Piece"), exports); | ||
tslib_1.__exportStar(require("./lib/structures/PieceLocation"), exports); | ||
tslib_1.__exportStar(require("./lib/structures/Store"), exports); | ||
tslib_1.__exportStar(require("./lib/structures/StoreRegistry"), exports); | ||
(0, tslib_1.__exportStar)(require("./lib/errors/LoaderError"), exports); | ||
(0, tslib_1.__exportStar)(require("./lib/errors/MissingExportsError"), exports); | ||
(0, tslib_1.__exportStar)(require("./lib/internal/RootScan"), exports); | ||
(0, tslib_1.__exportStar)(require("./lib/shared/Container"), exports); | ||
(0, tslib_1.__exportStar)(require("./lib/strategies/ILoaderStrategy"), exports); | ||
(0, tslib_1.__exportStar)(require("./lib/strategies/LoaderStrategy"), exports); | ||
(0, tslib_1.__exportStar)(require("./lib/structures/AliasPiece"), exports); | ||
(0, tslib_1.__exportStar)(require("./lib/structures/AliasStore"), exports); | ||
(0, tslib_1.__exportStar)(require("./lib/structures/Piece"), exports); | ||
(0, tslib_1.__exportStar)(require("./lib/structures/PieceLocation"), exports); | ||
(0, tslib_1.__exportStar)(require("./lib/structures/Store"), exports); | ||
(0, tslib_1.__exportStar)(require("./lib/structures/StoreRegistry"), exports); | ||
//# sourceMappingURL=index.js.map |
@@ -12,4 +12,4 @@ "use strict"; | ||
try { | ||
const file = JSON.parse(fs_1.readFileSync(path_1.join(cwd, 'package.json'), 'utf8')); | ||
data = { root: path_1.dirname(path_1.join(cwd, file.main)), type: file.type === 'module' ? 'ESM' : 'CommonJS' }; | ||
const file = JSON.parse((0, fs_1.readFileSync)((0, path_1.join)(cwd, 'package.json'), 'utf8')); | ||
data = { root: (0, path_1.dirname)((0, path_1.join)(cwd, file.main)), type: file.type === 'module' ? 'ESM' : 'CommonJS' }; | ||
} | ||
@@ -16,0 +16,0 @@ catch { |
@@ -21,3 +21,3 @@ "use strict"; | ||
writable: true, | ||
value: RootScan_1.getRootData().type === 'ESM' | ||
value: (0, RootScan_1.getRootData)().type === 'ESM' | ||
}); | ||
@@ -38,3 +38,3 @@ Object.defineProperty(this, "supportedExtensions", { | ||
*/ | ||
if (Reflect.has(process, Symbol.for('ts-node.register.instance')) || !utilities_1.isNullish(process.env.TS_NODE_DEV)) { | ||
if (Reflect.has(process, Symbol.for('ts-node.register.instance')) || !(0, utilities_1.isNullish)(process.env.TS_NODE_DEV)) { | ||
this.supportedExtensions.push('.ts'); | ||
@@ -45,7 +45,7 @@ } | ||
// Retrieve the file extension. | ||
const extension = path_1.extname(path); | ||
const extension = (0, path_1.extname)(path); | ||
if (!this.supportedExtensions.includes(extension)) | ||
return null; | ||
// Retrieve the name of the file, return null if empty. | ||
const name = path_1.basename(path, extension); | ||
const name = (0, path_1.basename)(path, extension); | ||
if (name === '') | ||
@@ -59,5 +59,5 @@ return null; | ||
if (mjs) { | ||
const url = url_1.pathToFileURL(file.path); | ||
const url = (0, url_1.pathToFileURL)(file.path); | ||
url.searchParams.append('d', Date.now().toString()); | ||
return internal_1.mjsImport(url); | ||
return (0, internal_1.mjsImport)(url); | ||
} | ||
@@ -73,3 +73,3 @@ // eslint-disable-next-line @typescript-eslint/no-var-requires | ||
// Support `module.exports`: | ||
if (Shared_1.isClass(result) && Shared_1.classExtends(result, store.Constructor)) { | ||
if ((0, Shared_1.isClass)(result) && (0, Shared_1.classExtends)(result, store.Constructor)) { | ||
yield result; | ||
@@ -80,3 +80,3 @@ yielded = true; | ||
for (const value of Object.values(result)) { | ||
if (Shared_1.isClass(value) && Shared_1.classExtends(value, store.Constructor)) { | ||
if ((0, Shared_1.isClass)(value) && (0, Shared_1.classExtends)(value, store.Constructor)) { | ||
yield value; | ||
@@ -83,0 +83,0 @@ yielded = true; |
@@ -5,3 +5,3 @@ "use strict"; | ||
const tslib_1 = require("tslib"); | ||
const collection_1 = tslib_1.__importDefault(require("@discordjs/collection")); | ||
const collection_1 = (0, tslib_1.__importDefault)(require("@discordjs/collection")); | ||
const Store_1 = require("./Store"); | ||
@@ -8,0 +8,0 @@ /** |
@@ -49,3 +49,3 @@ "use strict"; | ||
get relative() { | ||
return path_1.relative(this.root, this.full); | ||
return (0, path_1.relative)(this.root, this.full); | ||
} | ||
@@ -82,3 +82,3 @@ /** | ||
get name() { | ||
return path_1.basename(this.full); | ||
return (0, path_1.basename)(this.full); | ||
} | ||
@@ -85,0 +85,0 @@ /** |
@@ -5,3 +5,3 @@ "use strict"; | ||
const tslib_1 = require("tslib"); | ||
const collection_1 = tslib_1.__importDefault(require("@discordjs/collection")); | ||
const collection_1 = (0, tslib_1.__importDefault)(require("@discordjs/collection")); | ||
const fs_1 = require("fs"); | ||
@@ -80,3 +80,3 @@ const path_1 = require("path"); | ||
async load(root, path) { | ||
const full = path_1.join(root, path); | ||
const full = (0, path_1.join)(root, path); | ||
const data = this.strategy.filter(full); | ||
@@ -245,5 +245,5 @@ if (data === null) { | ||
if (item.isFile()) | ||
yield path_1.join(dir.path, item.name); | ||
yield (0, path_1.join)(dir.path, item.name); | ||
else if (item.isDirectory()) | ||
yield* this.walk(path_1.join(dir.path, item.name)); | ||
yield* this.walk((0, path_1.join)(dir.path, item.name)); | ||
} | ||
@@ -250,0 +250,0 @@ } |
@@ -5,3 +5,3 @@ "use strict"; | ||
const tslib_1 = require("tslib"); | ||
const collection_1 = tslib_1.__importDefault(require("@discordjs/collection")); | ||
const collection_1 = (0, tslib_1.__importDefault)(require("@discordjs/collection")); | ||
const path_1 = require("path"); | ||
@@ -65,5 +65,5 @@ const RootScan_1 = require("../internal/RootScan"); | ||
*/ | ||
registerPath(rootDirectory = RootScan_1.getRootData().root) { | ||
registerPath(rootDirectory = (0, RootScan_1.getRootData)().root) { | ||
for (const store of this.values()) { | ||
store.registerPath(path_1.join(rootDirectory, store.name)); | ||
store.registerPath((0, path_1.join)(rootDirectory, store.name)); | ||
} | ||
@@ -70,0 +70,0 @@ } |
{ | ||
"name": "@sapphire/pieces", | ||
"version": "3.0.0-next.7dc4b70.0", | ||
"version": "3.0.0", | ||
"description": "Sapphire's piece loader.", | ||
@@ -41,3 +41,3 @@ "main": "dist/index.js", | ||
"@sapphire/ts-config": "^3.0.0", | ||
"@types/node": "^16.7.5", | ||
"@types/node": "^16.7.10", | ||
"cz-conventional-changelog": "^3.3.0", | ||
@@ -49,5 +49,5 @@ "husky": "^7.0.2", | ||
"standard-version": "^9.3.1", | ||
"typedoc": "^0.21.8", | ||
"typedoc": "^0.21.9", | ||
"typedoc-plugin-nojekyll": "^1.0.1", | ||
"typescript": "^4.3.5" | ||
"typescript": "^4.4.2" | ||
}, | ||
@@ -54,0 +54,0 @@ "repository": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
78581
0
1