adaptive-expressions
Advanced tools
Comparing version 4.11.0-rc0 to 4.12.0-dev.20201028.820337b
@@ -23,3 +23,8 @@ /** | ||
constructor(value?: T[] | string | Expression); | ||
/** | ||
* Set an array value. | ||
* @param value Value to set. | ||
*/ | ||
setValue(value: T[] | string | Expression): void; | ||
} | ||
//# sourceMappingURL=arrayExpression.d.ts.map |
@@ -11,2 +11,3 @@ "use strict"; | ||
const expressionProperty_1 = require("./expressionProperty"); | ||
const expression_1 = require("../expression"); | ||
/** | ||
@@ -27,4 +28,18 @@ * Represents a property which is either a value of array of T or a string expression to bind to a | ||
} | ||
/** | ||
* Set an array value. | ||
* @param value Value to set. | ||
*/ | ||
setValue(value) { | ||
if (value !== undefined | ||
&& value !== null | ||
&& !Array.isArray(value) | ||
&& typeof value !== 'string' | ||
&& !(value instanceof expression_1.Expression)) { | ||
throw new Error("ArrayExpression accepts string, array or Expression as the value."); | ||
} | ||
super.setValue(value); | ||
} | ||
} | ||
exports.ArrayExpression = ArrayExpression; | ||
//# sourceMappingURL=arrayExpression.js.map |
@@ -21,3 +21,8 @@ /** | ||
constructor(value?: boolean | string | Expression); | ||
/** | ||
* Set a boolean value. | ||
* @param value Value to set. | ||
*/ | ||
setValue(value: boolean | string | Expression): void; | ||
} | ||
//# sourceMappingURL=boolExpression.d.ts.map |
@@ -11,2 +11,3 @@ "use strict"; | ||
const expressionProperty_1 = require("./expressionProperty"); | ||
const expression_1 = require("../expression"); | ||
/** | ||
@@ -25,4 +26,18 @@ * Represents a property which is either a boolean or a string expression which resolves to a boolean. | ||
} | ||
/** | ||
* Set a boolean value. | ||
* @param value Value to set. | ||
*/ | ||
setValue(value) { | ||
if (value !== undefined | ||
&& value !== null | ||
&& typeof value !== 'boolean' | ||
&& typeof value !== 'string' | ||
&& !(value instanceof expression_1.Expression)) { | ||
throw new Error("BoolExpression accepts string, boolean or Expression as the value."); | ||
} | ||
super.setValue(value); | ||
} | ||
} | ||
exports.BoolExpression = BoolExpression; | ||
//# sourceMappingURL=boolExpression.js.map |
@@ -30,3 +30,8 @@ /** | ||
}; | ||
/** | ||
* Set an integer value. | ||
* @param value Value to set. | ||
*/ | ||
setValue(value: number | string | Expression): void; | ||
} | ||
//# sourceMappingURL=intExpression.d.ts.map |
@@ -11,2 +11,3 @@ "use strict"; | ||
const expressionProperty_1 = require("./expressionProperty"); | ||
const expression_1 = require("../expression"); | ||
/** | ||
@@ -38,4 +39,18 @@ * Represents a property which is either a int or a string expression which resolves to a int. | ||
} | ||
/** | ||
* Set an integer value. | ||
* @param value Value to set. | ||
*/ | ||
setValue(value) { | ||
if (value !== undefined | ||
&& value !== null | ||
&& typeof value !== 'number' | ||
&& typeof value !== 'string' | ||
&& !(value instanceof expression_1.Expression)) { | ||
throw new Error("IntExpression accepts string, number or Expression as the value."); | ||
} | ||
super.setValue(value); | ||
} | ||
} | ||
exports.IntExpression = IntExpression; | ||
//# sourceMappingURL=intExpression.js.map |
@@ -21,3 +21,8 @@ /** | ||
constructor(value?: number | string | Expression); | ||
/** | ||
* Set a number value. | ||
* @param value Value to set. | ||
*/ | ||
setValue(value: number | string | Expression): void; | ||
} | ||
//# sourceMappingURL=numberExpression.d.ts.map |
@@ -11,2 +11,3 @@ "use strict"; | ||
const expressionProperty_1 = require("./expressionProperty"); | ||
const expression_1 = require("../expression"); | ||
/** | ||
@@ -25,4 +26,18 @@ * Represents a property which is either a float or a string expression which resolves to a float. | ||
} | ||
/** | ||
* Set a number value. | ||
* @param value Value to set. | ||
*/ | ||
setValue(value) { | ||
if (value !== undefined | ||
&& value !== null | ||
&& typeof value !== 'number' | ||
&& typeof value !== 'string' | ||
&& !(value instanceof expression_1.Expression)) { | ||
throw new Error("NumberExpression accepts string, number or Expression as the value."); | ||
} | ||
super.setValue(value); | ||
} | ||
} | ||
exports.NumberExpression = NumberExpression; | ||
//# sourceMappingURL=numberExpression.js.map |
@@ -44,3 +44,3 @@ "use strict"; | ||
} | ||
if (typeof value == 'string') { | ||
if (typeof value === 'string') { | ||
if (value.startsWith('=')) { | ||
@@ -58,2 +58,5 @@ this.expressionText = value; | ||
} | ||
if (value !== undefined && value !== null) { | ||
throw new Error("StringExpression accepts string or Expression as the value."); | ||
} | ||
} | ||
@@ -60,0 +63,0 @@ } |
@@ -5,3 +5,3 @@ { | ||
"description": "Common Expression Language", | ||
"version": "4.11.0-rc0", | ||
"version": "4.12.0-dev.20201028.820337b", | ||
"license": "MIT", | ||
@@ -21,2 +21,3 @@ "keywords": [ | ||
"main": "./lib/index.js", | ||
"browser": "./lib/browser.js", | ||
"typings": "./lib/index.d.ts", | ||
@@ -44,16 +45,21 @@ "dependencies": { | ||
"@types/node": "^10.17.27", | ||
"antlr4ts-cli": "0.5.0-alpha.3", | ||
"browserify": "16.5.2", | ||
"exorcist": "^1.0.1", | ||
"mocha": "^6.2.3", | ||
"nyc": "^15.1.0", | ||
"rimraf": "^3.0.2", | ||
"shx": "^0.3.2", | ||
"sinon": "^7.5.0", | ||
"sponge": "^0.1.0", | ||
"ts-node": "^4.1.0", | ||
"typescript": "3.5.3", | ||
"antlr4ts-cli": "0.5.0-alpha.3", | ||
"sinon": "^7.5.0" | ||
"typescript": "3.5.3" | ||
}, | ||
"scripts": { | ||
"build": "tsc", | ||
"browserify": "browserify -s AEL --debug lib/browser.js | exorcist lib/browser.js.map | sponge lib/browser.js", | ||
"postbuild": "rimraf lib/browser.* && shx cp lib/index.js lib/browser.js && npm run browserify", | ||
"clean": "rimraf q s lib", | ||
"build-docs": "typedoc --theme markdown --entryPoint adaptive-expressions --excludePrivate --includeDeclarations --ignoreCompilerErrors --module amd --out ..\\..\\doc\\adaptive-expressions .\\lib\\index.d.ts --hideGenerator --name \"Bot Builder SDK - Expression\" --readme none", | ||
"clean": "erase /q /s .\\lib", | ||
"postbuild": "browserify lib/index.js -s AEL -o lib/browser.js", | ||
"set-version": "npm version --allow-same-version 4.11.0-rc0", | ||
"set-version": "npm version --allow-same-version 4.12.0-dev.20201028.820337b", | ||
"test": "tsc && tsc ./tests/expressionProperty.test.ts && mocha tests/ --timeout 60000", | ||
@@ -60,0 +66,0 @@ "antlr-build-expression": "antlr4ts src/parser/ExpressionAntlrLexer.g4 -o src/parser/generated && antlr4ts src/parser/ExpressionAntlrParser.g4 -visitor -o src/parser/generated", |
@@ -26,2 +26,18 @@ /** | ||
} | ||
/** | ||
* Set an array value. | ||
* @param value Value to set. | ||
*/ | ||
public setValue(value: T[] | string | Expression): void { | ||
if (value !== undefined | ||
&& value !== null | ||
&& !Array.isArray(value) | ||
&& typeof value !== 'string' | ||
&& !(value instanceof Expression)) { | ||
throw new Error("ArrayExpression accepts string, array or Expression as the value."); | ||
} | ||
super.setValue(value); | ||
} | ||
} |
@@ -25,2 +25,18 @@ /** | ||
} | ||
/** | ||
* Set a boolean value. | ||
* @param value Value to set. | ||
*/ | ||
public setValue(value: boolean | string | Expression): void { | ||
if (value !== undefined | ||
&& value !== null | ||
&& typeof value !== 'boolean' | ||
&& typeof value !== 'string' | ||
&& !(value instanceof Expression)) { | ||
throw new Error("BoolExpression accepts string, boolean or Expression as the value."); | ||
} | ||
super.setValue(value); | ||
} | ||
} |
@@ -39,2 +39,18 @@ /** | ||
} | ||
/** | ||
* Set an integer value. | ||
* @param value Value to set. | ||
*/ | ||
public setValue(value: number | string | Expression): void { | ||
if (value !== undefined | ||
&& value !== null | ||
&& typeof value !== 'number' | ||
&& typeof value !== 'string' | ||
&& !(value instanceof Expression)) { | ||
throw new Error("IntExpression accepts string, number or Expression as the value."); | ||
} | ||
super.setValue(value); | ||
} | ||
} |
@@ -24,2 +24,18 @@ /** | ||
} | ||
/** | ||
* Set a number value. | ||
* @param value Value to set. | ||
*/ | ||
public setValue(value: number | string | Expression): void { | ||
if (value !== undefined | ||
&& value !== null | ||
&& typeof value !== 'number' | ||
&& typeof value !== 'string' | ||
&& !(value instanceof Expression)) { | ||
throw new Error("NumberExpression accepts string, number or Expression as the value."); | ||
} | ||
super.setValue(value); | ||
} | ||
} |
@@ -46,3 +46,3 @@ /** | ||
if (typeof value == 'string') { | ||
if (typeof value === 'string') { | ||
if (value.startsWith('=')) { | ||
@@ -60,3 +60,7 @@ this.expressionText = value; | ||
} | ||
if (value !== undefined && value !== null) { | ||
throw new Error("StringExpression accepts string or Expression as the value."); | ||
} | ||
} | ||
} |
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
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8152471
1106
110733
15