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

node-opcua-basic-types

Package Overview
Dependencies
Maintainers
1
Versions
170
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-opcua-basic-types - npm Package Compare versions

Comparing version 2.13.0 to 2.16.0

3

dist/array.js

@@ -8,3 +8,2 @@ "use strict";

const node_opcua_assert_1 = require("node-opcua-assert");
const _ = require("underscore");
/**

@@ -21,3 +20,3 @@ * @method encodeArray

}
node_opcua_assert_1.assert(_.isArray(arr));
node_opcua_assert_1.assert(Array.isArray(arr));
stream.writeUInt32(arr.length);

@@ -24,0 +23,0 @@ for (const value of arr) {

/// <reference types="node" />
/***
* @module node-opcua-basic-types
*/
import { BinaryStream, OutputBinaryStream } from "node-opcua-binary-stream";

@@ -3,0 +6,0 @@ export declare function isValidByteString(value: any): boolean;

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.coerceByteString = exports.decodeByteString = exports.encodeByteString = exports.randomByteString = exports.isValidByteString = void 0;
/***
* @module node-opcua-basic-types
*/
const _ = require("underscore");
const node_opcua_buffer_utils_1 = require("node-opcua-buffer-utils");

@@ -32,3 +28,3 @@ const utils_1 = require("./utils");

function coerceByteString(value) {
if (_.isArray(value)) {
if (Array.isArray(value)) {
return Buffer.from(value);

@@ -35,0 +31,0 @@ }

@@ -145,3 +145,3 @@ "use strict";

function encodeUInt64(value, stream) {
if (_.isNumber(value)) {
if (typeof value === "number") {
const arr = coerceUInt64(value);

@@ -177,7 +177,7 @@ stream.writeUInt32(arr[1]);

if (value instanceof Array) {
node_opcua_assert_1.assert(_.isNumber(value[0]));
node_opcua_assert_1.assert(_.isNumber(value[1]));
node_opcua_assert_1.assert(typeof value[0] === "number");
node_opcua_assert_1.assert(typeof value[1] === "number");
return value;
}
if (typeof (value) === "string") {
if (typeof value === "string") {
v = value.split(",");

@@ -264,5 +264,5 @@ high = parseInt(v[0], 10);

}
if (value.length === 2 && (typeof value[0] === "number") && (typeof value[1] === "number")) {
if (value.length === 2 && typeof value[0] === "number" && typeof value[1] === "number") {
// Int64 as a [high,low]
return value[1] + value[0] * 0xFFFFFFFF;
return value[1] + value[0] * 0xffffffff;
}

@@ -269,0 +269,0 @@ return parseInt(value, 10);

{
"name": "node-opcua-basic-types",
"version": "2.13.0",
"version": "2.16.0",
"description": "pure nodejs OPCUA SDK - module -basic-types",

@@ -14,11 +14,11 @@ "main": "./dist/index.js",

"dependencies": {
"node-opcua-assert": "2.10.0",
"node-opcua-binary-stream": "2.11.0",
"node-opcua-buffer-utils": "2.10.0",
"node-opcua-date-time": "2.11.0",
"node-opcua-enum": "2.10.0",
"node-opcua-guid": "2.10.0",
"node-opcua-nodeid": "2.11.0",
"node-opcua-status-code": "2.11.0",
"node-opcua-utils": "2.13.0",
"node-opcua-assert": "2.16.0",
"node-opcua-binary-stream": "2.16.0",
"node-opcua-buffer-utils": "2.16.0",
"node-opcua-date-time": "2.16.0",
"node-opcua-enum": "2.16.0",
"node-opcua-guid": "2.16.0",
"node-opcua-nodeid": "2.16.0",
"node-opcua-status-code": "2.16.0",
"node-opcua-utils": "2.16.0",
"underscore": "^1.10.2"

@@ -29,3 +29,3 @@ },

"@types/underscore": "^1.10.20",
"node-opcua-debug": "2.10.0",
"node-opcua-debug": "2.16.0",
"should": "^13.2.3"

@@ -48,3 +48,3 @@ },

"homepage": "http://node-opcua.github.io/",
"gitHead": "3c8a33e1e9d7923c9434607ad22d51d6d8d58918"
"gitHead": "9fa7d50952a7c39ff6790888a2bd6f32fe46836d"
}

@@ -5,4 +5,3 @@ /***

import { assert } from "node-opcua-assert";
import { BinaryStream, BinaryStreamSizeCalculator, OutputBinaryStream } from "node-opcua-binary-stream" ;
import * as _ from "underscore";
import { BinaryStream, BinaryStreamSizeCalculator, OutputBinaryStream } from "node-opcua-binary-stream";

@@ -18,3 +17,4 @@ /**

stream: OutputBinaryStream,
encodeElementFunc: (value: any, stream: OutputBinaryStream) => void): void {
encodeElementFunc: (value: any, stream: OutputBinaryStream) => void
): void {
if (arr === null) {

@@ -24,3 +24,3 @@ stream.writeUInt32(0xffffffff);

}
assert(_.isArray(arr));
assert(Array.isArray(arr));
stream.writeUInt32(arr.length);

@@ -27,0 +27,0 @@ for (const value of arr) {

/***
* @module node-opcua-basic-types
*/
import * as _ from "underscore";
import { BinaryStream, OutputBinaryStream } from "node-opcua-binary-stream";

@@ -35,3 +33,3 @@ import { createFastUninitializedBuffer } from "node-opcua-buffer-utils";

export function coerceByteString(value: any): ByteString {
if (_.isArray(value)) {
if (Array.isArray(value)) {
return Buffer.from(value);

@@ -38,0 +36,0 @@ }

@@ -5,5 +5,5 @@ /***

import { assert } from "node-opcua-assert";
import { BinaryStream, OutputBinaryStream } from "node-opcua-binary-stream" ;
import { BinaryStream, OutputBinaryStream } from "node-opcua-binary-stream";
import * as _ from "underscore";
import { getRandomInt } from "./utils" ;
import { getRandomInt } from "./utils";

@@ -161,3 +161,3 @@ export function isValidUInt16(value: any): boolean {

export function encodeUInt64(value: UInt64 | number, stream: OutputBinaryStream) {
if (_.isNumber(value)) {
if (typeof value === "number") {
const arr = coerceUInt64(value);

@@ -192,7 +192,7 @@ stream.writeUInt32(arr[1]);

if (value instanceof Array) {
assert(_.isNumber(value[0]));
assert(_.isNumber(value[1]));
assert(typeof value[0] === "number");
assert(typeof value[1] === "number");
return value;
}
if (typeof(value) === "string") {
if (typeof value === "string") {
v = value.split(",");

@@ -281,7 +281,7 @@ high = parseInt(v[0], 10);

}
if (value.length === 2 && (typeof value[0] === "number") && (typeof value[1] === "number")) {
if (value.length === 2 && typeof value[0] === "number" && typeof value[1] === "number") {
// Int64 as a [high,low]
return value[1] + value[0] * 0xFFFFFFFF;
return value[1] + value[0] * 0xffffffff;
}
return parseInt(value, 10);
}

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

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