@sapphire/framework
Advanced tools
Comparing version 2.0.0-next.dfd1f748.0 to 2.0.0-next.fdc4aa40.0
@@ -1,2 +0,2 @@ | ||
/* Version: 2.0.0-next.dfd1f748.0 - June 27, 2021 13:19:23 */ | ||
/* Version: 2.0.0-next.fdc4aa40.0 - July 5, 2021 22:05:36 */ | ||
'use strict'; | ||
@@ -47,2 +47,2 @@ | ||
tslib_1.__exportStar(require("./lib/utils/preconditions/PreconditionContainerSingle"), exports); | ||
exports.version = '2.0.0-next.dfd1f748.0'; | ||
exports.version = '2.0.0-next.fdc4aa40.0'; |
@@ -65,3 +65,3 @@ "use strict"; | ||
constructor(options = {}) { | ||
var _a, _b, _c, _d, _e, _f; | ||
var _a, _b, _c, _d, _e, _f, _g; | ||
super(options); | ||
@@ -80,5 +80,8 @@ /** | ||
pieces_1.container.logger = this.logger; | ||
if ((_e = options.enableLoaderTraceLoggings) !== null && _e !== void 0 ? _e : pieces_1.container.logger.has(10 /* Trace */)) { | ||
pieces_1.Store.logger = pieces_1.container.logger.trace.bind(pieces_1.container.logger); | ||
} | ||
this.stores = new StoreRegistry_1.StoreRegistry(); | ||
pieces_1.container.stores = this.stores; | ||
this.fetchPrefix = (_e = options.fetchPrefix) !== null && _e !== void 0 ? _e : (() => { var _a; return (_a = this.options.defaultPrefix) !== null && _a !== void 0 ? _a : null; }); | ||
this.fetchPrefix = (_f = options.fetchPrefix) !== null && _f !== void 0 ? _f : (() => { var _a; return (_a = this.options.defaultPrefix) !== null && _a !== void 0 ? _a : null; }); | ||
for (const plugin of SapphireClient.plugins.values("preInitialization" /* PreInitialization */)) { | ||
@@ -88,3 +91,3 @@ plugin.hook.call(this, options); | ||
} | ||
this.id = (_f = options.id) !== null && _f !== void 0 ? _f : null; | ||
this.id = (_g = options.id) !== null && _g !== void 0 ? _g : null; | ||
this.stores | ||
@@ -91,0 +94,0 @@ .register(new ArgumentStore_1.ArgumentStore().registerPath(path_1.join(__dirname, '..', 'arguments'))) // |
@@ -28,3 +28,3 @@ "use strict"; | ||
this.detailedDescription = (_b = options.detailedDescription) !== null && _b !== void 0 ? _b : ''; | ||
this.strategy = new FlagUnorderedStrategy_1.FlagUnorderedStrategy(options.strategyOptions); | ||
this.strategy = new FlagUnorderedStrategy_1.FlagUnorderedStrategy(options); | ||
this.lexer.setQuotes((_c = options.quotes) !== null && _c !== void 0 ? _c : [ | ||
@@ -31,0 +31,0 @@ ['"', '"'], |
@@ -9,2 +9,5 @@ "use strict"; | ||
} | ||
has(level) { | ||
return level >= this.level; | ||
} | ||
trace(...values) { | ||
@@ -29,3 +32,3 @@ this.write(10 /* Trace */, ...values); | ||
write(level, ...values) { | ||
if (level < this.level) | ||
if (!this.has(level)) | ||
return; | ||
@@ -32,0 +35,0 @@ const method = Logger.levels.get(level); |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.FlagUnorderedStrategy = void 0; | ||
const never = () => null; | ||
const always = () => true; | ||
class FlagUnorderedStrategy { | ||
constructor({ flags = [], options = [], prefixes = ['--', '-', '—'], separators = ['=', ':'] } = {}) { | ||
this.flags = flags; | ||
this.options = options; | ||
constructor({ flags, options, prefixes = ['--', '-', '—'], separators = ['=', ':'] } = {}) { | ||
this.flags = flags || []; | ||
this.options = options || []; | ||
this.prefixes = prefixes; | ||
this.separators = separators; | ||
if (this.flags === true) | ||
this.allowedFlag = always; | ||
else if (this.flags.length === 0) | ||
this.matchFlag = never; | ||
if (this.options === true) { | ||
this.allowedOption = always; | ||
} | ||
else if (this.options.length === 0) { | ||
this.matchOption = never; | ||
this.matchCompactOption = never; | ||
} | ||
} | ||
@@ -20,3 +33,3 @@ matchFlag(s) { | ||
// The flag must be an allowed one. | ||
if (this.flags.includes(s)) | ||
if (this.allowedFlag(s)) | ||
return s; | ||
@@ -35,3 +48,3 @@ // If it did not match a flag, return null. | ||
s = s.slice(0, -separator.length); | ||
if (this.options.includes(s)) | ||
if (this.allowedOption(s)) | ||
return s; | ||
@@ -52,3 +65,3 @@ return null; | ||
const k = s.slice(0, i); | ||
if (!this.options.includes(k)) | ||
if (!this.allowedOption(k)) | ||
return null; | ||
@@ -58,4 +71,10 @@ const v = s.slice(i + sep.length); | ||
} | ||
allowedFlag(s) { | ||
return this.flags.includes(s); | ||
} | ||
allowedOption(s) { | ||
return this.options.includes(s); | ||
} | ||
} | ||
exports.FlagUnorderedStrategy = FlagUnorderedStrategy; | ||
//# sourceMappingURL=FlagUnorderedStrategy.js.map |
{ | ||
"name": "@sapphire/framework", | ||
"version": "2.0.0-next.dfd1f748.0", | ||
"version": "2.0.0-next.fdc4aa40.0", | ||
"description": "Discord bot framework built on top of @sapphire/lib for advanced and amazing bots.", | ||
@@ -17,9 +17,4 @@ "main": "dist/index.js", | ||
"update": "yarn upgrade-interactive --latest", | ||
"build": "run-s build:tsc", | ||
"build:cleanup": "node scripts/clean-dist.mjs", | ||
"build:tsc": "tsc -b src", | ||
"build:rollup-bundle": "rollup -c scripts/rollup.bundle.ts", | ||
"build:rollup-types": "rollup -c scripts/rollup.types.ts", | ||
"build:clean-extraneous-types": "node scripts/clean-extraneous-types.mjs", | ||
"clean": "yarn build:cleanup", | ||
"clean": "node scripts/clean-dist.mjs", | ||
"build": "tsc -b src && rollup -c scripts/rollup.bundle.ts", | ||
"watch": "tsc -b src -w", | ||
@@ -29,11 +24,11 @@ "sversion": "standard-version", | ||
"cz": "git-cz", | ||
"prepublishOnly": "run-s build:**", | ||
"prepublishOnly": "rollup-type-bundler -e url events", | ||
"prepare": "husky install .github/husky" | ||
}, | ||
"dependencies": { | ||
"@sapphire/discord-utilities": "^2.1.4", | ||
"@sapphire/discord.js-utilities": "^1.5.10", | ||
"@sapphire/discord-utilities": "^2.1.5", | ||
"@sapphire/discord.js-utilities": "^1.6.0", | ||
"@sapphire/pieces": "~2.0.0", | ||
"@sapphire/ratelimits": "^1.2.3", | ||
"@sapphire/utilities": "^1.6.0", | ||
"@sapphire/ratelimits": "^1.2.5", | ||
"@sapphire/utilities": "^1.6.1", | ||
"lexure": "^0.17.0", | ||
@@ -45,18 +40,17 @@ "tslib": "^2.3.0" | ||
"@commitlint/config-conventional": "^12.1.4", | ||
"@sapphire/eslint-config": "^3.2.0", | ||
"@sapphire/prettier-config": "^1.1.4", | ||
"@sapphire/ts-config": "^2.3.0", | ||
"@favware/rollup-type-bundler": "^1.0.2", | ||
"@sapphire/eslint-config": "^3.2.1", | ||
"@sapphire/prettier-config": "^1.1.6", | ||
"@sapphire/ts-config": "^2.3.1", | ||
"@types/jest": "^26.0.23", | ||
"@types/node": "^15.12.4", | ||
"@types/ws": "^7.4.5", | ||
"@types/node": "^16.0.0", | ||
"@types/ws": "^7.4.6", | ||
"cz-conventional-changelog": "^3.3.0", | ||
"discord.js": "^12.5.3", | ||
"husky": "^6.0.0", | ||
"jest": "^27.0.4", | ||
"jest-circus": "^27.0.4", | ||
"husky": "^7.0.0", | ||
"jest": "^27.0.6", | ||
"jest-circus": "^27.0.6", | ||
"lint-staged": "^11.0.0", | ||
"npm-run-all": "^4.1.5", | ||
"pretty-quick": "^3.1.1", | ||
"rollup": "^2.52.3", | ||
"rollup-plugin-dts": "^3.0.2", | ||
"rollup": "^2.52.7", | ||
"rollup-plugin-version-injector": "^1.3.3", | ||
@@ -66,5 +60,5 @@ "standard-version": "^9.3.0", | ||
"ts-node": "^10.0.0", | ||
"typedoc": "^0.21.0", | ||
"typedoc": "^0.21.2", | ||
"typedoc-plugin-nojekyll": "^1.0.1", | ||
"typescript": "^4.3.4" | ||
"typescript": "^4.3.5" | ||
}, | ||
@@ -71,0 +65,0 @@ "repository": { |
Sorry, the diff of this file is too big to display
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
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
276591
24
4933