@wendellhu/redi
Advanced tools
Comparing version 0.17.0 to 0.17.1
@@ -244,2 +244,12 @@ (function (global, factory) { | ||
})(); | ||
function mapQuantityToNumber(quantity) { | ||
switch (quantity) { | ||
case exports.Quantity.OPTIONAL: | ||
return '0 or 1'; | ||
case exports.Quantity.REQUIRED: | ||
return '1'; | ||
case exports.Quantity.MANY: | ||
return '0 or more'; | ||
} | ||
} | ||
var QuantityCheckError = /** @class */ (function (_super) { | ||
@@ -249,3 +259,3 @@ __extends$2(QuantityCheckError, _super); | ||
var _this = this; | ||
var msg = "Expect \"".concat(quantity, "\" dependency items for id \"").concat(prettyPrintIdentifier(id), "\" but get ").concat(actual, "."); | ||
var msg = "Expect ".concat(mapQuantityToNumber(quantity), " dependency item(s) for id \"").concat(prettyPrintIdentifier(id), "\" but get ").concat(actual, "."); | ||
if (actual === 0) { | ||
@@ -252,0 +262,0 @@ msg += ' Did you forget to register it?'; |
@@ -20,2 +20,12 @@ var __extends = (this && this.__extends) || (function () { | ||
import { Quantity } from './types'; | ||
function mapQuantityToNumber(quantity) { | ||
switch (quantity) { | ||
case Quantity.OPTIONAL: | ||
return '0 or 1'; | ||
case Quantity.REQUIRED: | ||
return '1'; | ||
case Quantity.MANY: | ||
return '0 or more'; | ||
} | ||
} | ||
var QuantityCheckError = /** @class */ (function (_super) { | ||
@@ -25,3 +35,3 @@ __extends(QuantityCheckError, _super); | ||
var _this = this; | ||
var msg = "Expect \"".concat(quantity, "\" dependency items for id \"").concat(prettyPrintIdentifier(id), "\" but get ").concat(actual, "."); | ||
var msg = "Expect ".concat(mapQuantityToNumber(quantity), " dependency item(s) for id \"").concat(prettyPrintIdentifier(id), "\" but get ").concat(actual, "."); | ||
if (actual === 0) { | ||
@@ -28,0 +38,0 @@ msg += ' Did you forget to register it?'; |
{ | ||
"schema": "https://raw.githubusercontent.com/wzhudev/squirrel/master/src/schema/package.schema.json", | ||
"name": "@wendellhu/redi", | ||
"version": "0.17.0", | ||
"version": "0.17.1", | ||
"description": "A dependency library for TypeScript and JavaScript, along with a binding for React.", | ||
@@ -6,0 +6,0 @@ "author": "Wenzhao Hu<wzhudev@gmail.com>", |
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
515324
5181