Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

node-opcua-numeric-range

Package Overview
Dependencies
Maintainers
1
Versions
187
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-opcua-numeric-range - npm Package Compare versions

Comparing version 2.85.0 to 2.86.0

4

dist/numeric_range.d.ts

@@ -21,3 +21,3 @@ /// <reference types="node" />

}
declare type NumericalRangeValueType = null | number | string | number[] | number[][];
type NumericalRangeValueType = null | number | string | number[] | number[][];
export interface NumericalRangeSingleValue {

@@ -43,3 +43,3 @@ type: NumericRangeType.SingleValue;

}
export declare type NumericalRange0 = NumericalRangeSingleValue | NumericalRangeArrayRange | NumericalRangeMatrixRange | NumericalRangeEmpty | NumericalRangeInvalid;
export type NumericalRange0 = NumericalRangeSingleValue | NumericalRangeArrayRange | NumericalRangeMatrixRange | NumericalRangeEmpty | NumericalRangeInvalid;
export interface NumericalRange1 {

@@ -46,0 +46,0 @@ type: NumericRangeType;

@@ -225,2 +225,25 @@ "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) {

@@ -254,25 +277,2 @@ 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() {

@@ -477,2 +477,5 @@ if (this.type === NumericRangeType.ArrayRange) {

}
else if (arr instanceof Buffer) {
res = arr.subarray(start, end);
}
else {

@@ -479,0 +482,0 @@ (0, node_opcua_assert_1.assert)(typeof arr.slice === "function");

{
"name": "node-opcua-numeric-range",
"version": "2.85.0",
"version": "2.86.0",
"description": "pure nodejs OPCUA SDK - module -numeric-range",

@@ -18,9 +18,9 @@ "main": "./dist/index.js",

"node-opcua-assert": "2.77.0",
"node-opcua-basic-types": "2.85.0",
"node-opcua-binary-stream": "2.85.0",
"node-opcua-factory": "2.85.0",
"node-opcua-status-code": "2.85.0"
"node-opcua-basic-types": "2.86.0",
"node-opcua-binary-stream": "2.86.0",
"node-opcua-factory": "2.86.0",
"node-opcua-status-code": "2.86.0"
},
"devDependencies": {
"node-opcua-packet-analyzer": "2.85.0",
"node-opcua-packet-analyzer": "2.86.0",
"node-opcua-test-helpers": "2.77.0",

@@ -42,3 +42,3 @@ "should": "^13.2.3"

"homepage": "http://node-opcua.github.io/",
"gitHead": "68498fcf7b20ea9f7bd66e8529c546221daf5d52"
"gitHead": "36afc46fe2c91aa5664a8c5418f4db5a354670c3"
}

@@ -586,2 +586,4 @@ /**

res = (arr as any).subarray(start, end);
} else if (arr instanceof Buffer) {
res = arr.subarray(start, end);
} else {

@@ -588,0 +590,0 @@ assert(typeof (arr as any).slice === "function");

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc