node-opcua-numeric-range
Advanced tools
Comparing version 2.89.0 to 2.90.0
@@ -21,3 +21,3 @@ /// <reference types="node" /> | ||
} | ||
type NumericalRangeValueType = null | number | string | number[] | number[][]; | ||
declare type NumericalRangeValueType = null | number | string | number[] | number[][]; | ||
export interface NumericalRangeSingleValue { | ||
@@ -43,3 +43,3 @@ type: NumericRangeType.SingleValue; | ||
} | ||
export type NumericalRange0 = NumericalRangeSingleValue | NumericalRangeArrayRange | NumericalRangeMatrixRange | NumericalRangeEmpty | NumericalRangeInvalid; | ||
export declare type NumericalRange0 = NumericalRangeSingleValue | NumericalRangeArrayRange | NumericalRangeMatrixRange | NumericalRangeEmpty | NumericalRangeInvalid; | ||
export interface NumericalRange1 { | ||
@@ -46,0 +46,0 @@ type: NumericRangeType; |
@@ -225,25 +225,2 @@ "use strict"; | ||
class NumericRange { | ||
static overlap(nr1, nr2) { | ||
nr1 = nr1 || NumericRange.empty; | ||
nr2 = nr2 || NumericRange.empty; | ||
if (NumericRangeType.Empty === nr1.type || NumericRangeType.Empty === nr2.type) { | ||
return true; | ||
} | ||
if (NumericRangeType.SingleValue === nr1.type && NumericRangeType.SingleValue === nr2.type) { | ||
return nr1.value === nr2.value; | ||
} | ||
if (NumericRangeType.ArrayRange === nr1.type && NumericRangeType.ArrayRange === nr2.type) { | ||
// +-----+ +------+ +---+ +------+ | ||
// +----+ +---+ +--------+ +---+ | ||
const l1 = nr1.value[0]; | ||
const h1 = nr1.value[1]; | ||
const l2 = nr2.value[0]; | ||
const h2 = nr2.value[1]; | ||
return _overlap(l1, h1, l2, h2); | ||
} | ||
// istanbul ignore next | ||
(0, node_opcua_assert_1.assert)(false, "NumericalRange#overlap : case not implemented yet "); // TODO | ||
// istanbul ignore next | ||
return false; | ||
} | ||
constructor(value, secondValue) { | ||
@@ -277,2 +254,25 @@ this.type = NumericRangeType.InvalidRange; | ||
} | ||
static overlap(nr1, nr2) { | ||
nr1 = nr1 || NumericRange.empty; | ||
nr2 = nr2 || NumericRange.empty; | ||
if (NumericRangeType.Empty === nr1.type || NumericRangeType.Empty === nr2.type) { | ||
return true; | ||
} | ||
if (NumericRangeType.SingleValue === nr1.type && NumericRangeType.SingleValue === nr2.type) { | ||
return nr1.value === nr2.value; | ||
} | ||
if (NumericRangeType.ArrayRange === nr1.type && NumericRangeType.ArrayRange === nr2.type) { | ||
// +-----+ +------+ +---+ +------+ | ||
// +----+ +---+ +--------+ +---+ | ||
const l1 = nr1.value[0]; | ||
const h1 = nr1.value[1]; | ||
const l2 = nr2.value[0]; | ||
const h2 = nr2.value[1]; | ||
return _overlap(l1, h1, l2, h2); | ||
} | ||
// istanbul ignore next | ||
(0, node_opcua_assert_1.assert)(false, "NumericalRange#overlap : case not implemented yet "); // TODO | ||
// istanbul ignore next | ||
return false; | ||
} | ||
isValid() { | ||
@@ -279,0 +279,0 @@ if (this.type === NumericRangeType.ArrayRange) { |
{ | ||
"name": "node-opcua-numeric-range", | ||
"version": "2.89.0", | ||
"version": "2.90.0", | ||
"description": "pure nodejs OPCUA SDK - module -numeric-range", | ||
@@ -18,9 +18,9 @@ "main": "./dist/index.js", | ||
"node-opcua-assert": "2.88.0", | ||
"node-opcua-basic-types": "2.89.0", | ||
"node-opcua-basic-types": "2.90.0", | ||
"node-opcua-binary-stream": "2.89.0", | ||
"node-opcua-factory": "2.89.0", | ||
"node-opcua-factory": "2.90.0", | ||
"node-opcua-status-code": "2.89.0" | ||
}, | ||
"devDependencies": { | ||
"node-opcua-packet-analyzer": "2.89.0", | ||
"node-opcua-packet-analyzer": "2.90.0", | ||
"node-opcua-test-helpers": "2.88.0", | ||
@@ -42,3 +42,3 @@ "should": "^13.2.3" | ||
"homepage": "http://node-opcua.github.io/", | ||
"gitHead": "93d5502a1b71afbb5e5fa56846615c412b63cc1b" | ||
"gitHead": "d55f9150c3ffa5b86fbe1a0baba69a2543c3090a" | ||
} |
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
81368
+ Addednode-opcua-basic-types@2.90.0(transitive)
+ Addednode-opcua-date-time@2.90.0(transitive)
+ Addednode-opcua-debug@2.90.0(transitive)
+ Addednode-opcua-factory@2.90.0(transitive)
+ Addednode-opcua-nodeid@2.90.0(transitive)
- Removednode-opcua-basic-types@2.89.0(transitive)
- Removednode-opcua-date-time@2.89.0(transitive)
- Removednode-opcua-debug@2.88.0(transitive)
- Removednode-opcua-factory@2.89.0(transitive)
- Removednode-opcua-nodeid@2.88.0(transitive)
Updatednode-opcua-factory@2.90.0