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.0.0-alpha.11 to 2.0.0-alpha.12

8

dist/array.d.ts

@@ -1,9 +0,9 @@

import { BinaryStream } from "node-opcua-binary-stream";
import { BinaryStream, OutputBinaryStream } from "node-opcua-binary-stream";
/**
* @method encodeArray
* @param arr {Array} the array to encode.
* @param stream {BinaryStream} the stream.
* @param arr the array to encode.
* @param stream the stream.
* @param encodeElementFunc The function to encode a single array element.
*/
export declare function encodeArray(arr: any[] | null, stream: BinaryStream, encodeElementFunc: (value: any, stream: BinaryStream) => void): void;
export declare function encodeArray(arr: any[] | null, stream: OutputBinaryStream, encodeElementFunc: (value: any, stream: OutputBinaryStream) => void): void;
/**

@@ -10,0 +10,0 @@ * decode an array from a BinaryStream

@@ -10,4 +10,4 @@ "use strict";

* @method encodeArray
* @param arr {Array} the array to encode.
* @param stream {BinaryStream} the stream.
* @param arr the array to encode.
* @param stream the stream.
* @param encodeElementFunc The function to encode a single array element.

@@ -14,0 +14,0 @@ */

@@ -1,5 +0,5 @@

import { BinaryStream } from "node-opcua-binary-stream";
import { BinaryStream, OutputBinaryStream } from "node-opcua-binary-stream";
export declare function isValidBoolean(value: any): boolean;
export declare function randomBoolean(): boolean;
export declare function encodeBoolean(value: boolean, stream: BinaryStream): void;
export declare function encodeBoolean(value: boolean, stream: OutputBinaryStream): void;
export declare function decodeBoolean(stream: BinaryStream): boolean;

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

/// <reference types="node" />
import { BinaryStream } from "node-opcua-binary-stream";
import { BinaryStream, OutputBinaryStream } from "node-opcua-binary-stream";
export declare function isValidByteString(value: any): boolean;
export declare type ByteString = Buffer;
export declare function randomByteString(value: any, len: number): ByteString;
export declare function encodeByteString(byteString: ByteString, stream: BinaryStream): void;
export declare function encodeByteString(byteString: ByteString, stream: OutputBinaryStream): void;
export declare function decodeByteString(stream: BinaryStream): ByteString;
export declare function coerceByteString(value: any): ByteString;

@@ -1,2 +0,2 @@

import { BinaryStream } from "node-opcua-binary-stream";
import { BinaryStream, OutputBinaryStream } from "node-opcua-binary-stream";
export declare function isValidFloat(value: any): boolean;

@@ -6,3 +6,3 @@ export declare function roundToFloat2(float: number): number;

export declare function randomFloat(): Float;
export declare function encodeFloat(value: Float, stream: BinaryStream): void;
export declare function encodeFloat(value: Float, stream: OutputBinaryStream): void;
export declare function decodeFloat(stream: BinaryStream): Float;

@@ -12,5 +12,5 @@ export declare function isValidDouble(value: any): boolean;

export declare function randomDouble(): Double;
export declare function encodeDouble(value: Double, stream: BinaryStream): void;
export declare function encodeDouble(value: Double, stream: OutputBinaryStream): void;
export declare function decodeDouble(stream: BinaryStream): number;
export declare function coerceFloat(value: any): Float;
export declare function coerceDouble(value: any): Double;
/***
* @module node-opcua-basic-types
*/
import { BinaryStream } from "node-opcua-binary-stream";
import { BinaryStream, OutputBinaryStream } from "node-opcua-binary-stream";
export { isValidGuid, emptyGuid } from "node-opcua-guid";
export declare type Guid = string;
export declare function randomGuid(): Guid;
export declare function encodeGuid(guid: Guid, stream: BinaryStream): void;
export declare function encodeGuid(guid: Guid, stream: OutputBinaryStream): void;
export declare function decodeGuid(stream: BinaryStream): Guid;

@@ -1,2 +0,2 @@

import { BinaryStream } from "node-opcua-binary-stream";
import { BinaryStream, OutputBinaryStream } from "node-opcua-binary-stream";
export declare function isValidUInt16(value: any): boolean;

@@ -14,19 +14,19 @@ export declare type UInt8 = number;

export declare function randomUInt16(): UInt16;
export declare function encodeUInt16(value: UInt16, stream: BinaryStream): void;
export declare function encodeUInt16(value: UInt16, stream: OutputBinaryStream): void;
export declare function decodeUInt16(stream: BinaryStream): UInt16;
export declare function isValidInt16(value: any): boolean;
export declare function randomInt16(): Int16;
export declare function encodeInt16(value: Int16, stream: BinaryStream): void;
export declare function encodeInt16(value: Int16, stream: OutputBinaryStream): void;
export declare function decodeInt16(stream: BinaryStream): Int16;
export declare function isValidInt32(value: any): boolean;
export declare function randomInt32(): Int32;
export declare function encodeInt32(value: Int32, stream: BinaryStream): void;
export declare function encodeInt32(value: Int32, stream: OutputBinaryStream): void;
export declare function decodeInt32(stream: BinaryStream): Int32;
export declare function isValidUInt32(value: any): boolean;
export declare function randomUInt32(): UInt32;
export declare function encodeUInt32(value: UInt32, stream: BinaryStream): void;
export declare function encodeUInt32(value: UInt32, stream: OutputBinaryStream): void;
export declare function decodeUInt32(stream: BinaryStream): UInt32;
export declare function isValidInt8(value: any): boolean;
export declare function randomInt8(): Int8;
export declare function encodeInt8(value: Int8, stream: BinaryStream): void;
export declare function encodeInt8(value: Int8, stream: OutputBinaryStream): void;
export declare function decodeInt8(stream: BinaryStream): Int8;

@@ -39,3 +39,3 @@ export declare const isValidSByte: typeof isValidInt8;

export declare function randomUInt8(): UInt8;
export declare function encodeUInt8(value: UInt8, stream: BinaryStream): void;
export declare function encodeUInt8(value: UInt8, stream: OutputBinaryStream): void;
export declare function decodeUInt8(stream: BinaryStream): UInt8;

@@ -48,3 +48,3 @@ export declare const isValidByte: typeof isValidUInt8;

export declare function randomUInt64(): UInt64;
export declare function encodeUInt64(value: UInt64 | number, stream: BinaryStream): void;
export declare function encodeUInt64(value: UInt64 | number, stream: OutputBinaryStream): void;
export declare function decodeUInt64(stream: BinaryStream): UInt64;

@@ -51,0 +51,0 @@ export declare function constructInt64(high: UInt32, low: UInt32): number[];

/***
* @module node-opcua-basic-types
*/
import { BinaryStream } from "node-opcua-binary-stream";
import { BinaryStream, OutputBinaryStream } from "node-opcua-binary-stream";
import { UAString } from "./string";
export declare function validateLocaleId(value: any): boolean;
export declare type LocaleId = UAString;
export declare function encodeLocaleId(localeId: LocaleId, stream: BinaryStream): void;
export declare function encodeLocaleId(localeId: LocaleId, stream: OutputBinaryStream): void;
export declare function decodeLocaleId(stream: BinaryStream): LocaleId;

@@ -1,9 +0,9 @@

import { BinaryStream } from "node-opcua-binary-stream";
import { BinaryStream, OutputBinaryStream } from "node-opcua-binary-stream";
import { ExpandedNodeId, NodeId } from "node-opcua-nodeid";
export declare function isValidNodeId(nodeId: any): boolean;
export declare function randomNodeId(): NodeId;
export declare function encodeNodeId(nodeId: NodeId, stream: BinaryStream): void;
export declare function encodeExpandedNodeId(expandedNodeId: ExpandedNodeId, stream: BinaryStream): void;
export declare function encodeNodeId(nodeId: NodeId, stream: OutputBinaryStream): void;
export declare function encodeExpandedNodeId(expandedNodeId: ExpandedNodeId, stream: OutputBinaryStream): void;
export declare function decodeNodeId(stream: BinaryStream): NodeId;
export declare function decodeExpandedNodeId(stream: BinaryStream): ExpandedNodeId;
export { coerceNodeId, coerceExpandedNodeId } from "node-opcua-nodeid";
/***
* @module node-opcua-basic-types
*/
import { BinaryStream } from "node-opcua-binary-stream";
import { BinaryStream, OutputBinaryStream } from "node-opcua-binary-stream";
export declare function isValidString(value: any): boolean;
export declare function randomString(): string;
export declare function decodeString(stream: BinaryStream): string | null;
export declare function encodeString(value: null | string, stream: BinaryStream): void;
export declare function encodeString(value: null | string, stream: OutputBinaryStream): void;
export declare type CharArray = string;

@@ -10,0 +10,0 @@ export declare type UAString = string | null;

{
"name": "node-opcua-basic-types",
"version": "2.0.0-alpha.11",
"version": "2.0.0-alpha.12",
"description": "pure nodejs OPCUA SDK - module -basic-types",

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

"node-opcua-assert": "^2.0.0-alpha.10",
"node-opcua-binary-stream": "^2.0.0-alpha.10",
"node-opcua-binary-stream": "^2.0.0-alpha.12",
"node-opcua-buffer-utils": "^2.0.0-alpha.10",
"node-opcua-date-time": "^2.0.0-alpha.10",
"node-opcua-date-time": "^2.0.0-alpha.12",
"node-opcua-enum": "^2.0.0-alpha.10",
"node-opcua-guid": "^2.0.0-alpha.10",
"node-opcua-nodeid": "^2.0.0-alpha.11",
"node-opcua-status-code": "^2.0.0-alpha.10",
"node-opcua-utils": "^2.0.0-alpha.10",
"node-opcua-status-code": "^2.0.0-alpha.12",
"node-opcua-utils": "^2.0.0-alpha.12",
"underscore": "^1.9.1"
},
"devDependencies": {
"@types/node": "^10.12.18",
"@types/node": "^10.12.23",
"@types/underscore": "^1.8.9",

@@ -47,3 +47,3 @@ "node-opcua-debug": "^2.0.0-alpha.10",

"homepage": "http://node-opcua.github.io/",
"gitHead": "bf7ea24732637e662af9b5b63941388e89fd3427"
"gitHead": "61699a99c75c631388f2e8d8e33eb209649c5eac"
}

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

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

@@ -11,4 +11,4 @@

* @method encodeArray
* @param arr {Array} the array to encode.
* @param stream {BinaryStream} the stream.
* @param arr the array to encode.
* @param stream the stream.
* @param encodeElementFunc The function to encode a single array element.

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

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

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

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

import assert from "node-opcua-assert";
import { BinaryStream } from "node-opcua-binary-stream" ;
import { BinaryStream, OutputBinaryStream } from "node-opcua-binary-stream" ;

@@ -16,3 +16,3 @@ export function isValidBoolean(value: any): boolean {

export function encodeBoolean(value: boolean, stream: BinaryStream): void {
export function encodeBoolean(value: boolean, stream: OutputBinaryStream): void {
assert(isValidBoolean(value));

@@ -19,0 +19,0 @@ stream.writeUInt8(value ? 1 : 0);

@@ -6,3 +6,3 @@ /***

import { BinaryStream } from "node-opcua-binary-stream";
import { BinaryStream, OutputBinaryStream } from "node-opcua-binary-stream";
import { createFastUninitializedBuffer } from "node-opcua-buffer-utils";

@@ -27,3 +27,3 @@

export function encodeByteString(byteString: ByteString, stream: BinaryStream) {
export function encodeByteString(byteString: ByteString, stream: OutputBinaryStream) {
stream.writeByteStream(byteString);

@@ -30,0 +30,0 @@ }

@@ -6,3 +6,3 @@ /***

import { BinaryStream } from "node-opcua-binary-stream";
import { BinaryStream, OutputBinaryStream } from "node-opcua-binary-stream";

@@ -68,3 +68,3 @@ const minFloat = -3.4 * Math.pow(10, 38);

export function encodeFloat(value: Float, stream: BinaryStream): void {
export function encodeFloat(value: Float, stream: OutputBinaryStream): void {
stream.writeFloat(value);

@@ -90,3 +90,3 @@ }

export function encodeDouble(value: Double, stream: BinaryStream) {
export function encodeDouble(value: Double, stream: OutputBinaryStream) {
stream.writeDouble(value);

@@ -93,0 +93,0 @@ }

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

import { BinaryStream } from "node-opcua-binary-stream";
import { BinaryStream, OutputBinaryStream } from "node-opcua-binary-stream";
import { emptyGuid, isValidGuid } from "node-opcua-guid";

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

export function encodeGuid(guid: Guid, stream: BinaryStream): void {
export function encodeGuid(guid: Guid, stream: OutputBinaryStream): void {
if (!isValidGuid(guid)) {

@@ -32,0 +32,0 @@ throw new Error(" Invalid GUID : '" + JSON.stringify(guid) + "'");

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

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

@@ -36,3 +36,3 @@ import { getRandomInt } from "./utils" ;

export function encodeUInt16(value: UInt16, stream: BinaryStream): void {
export function encodeUInt16(value: UInt16, stream: OutputBinaryStream): void {
stream.writeUInt16(value);

@@ -56,3 +56,3 @@ }

export function encodeInt16(value: Int16, stream: BinaryStream): void {
export function encodeInt16(value: Int16, stream: OutputBinaryStream): void {
assert(_.isFinite(value));

@@ -77,3 +77,3 @@ stream.writeInt16(value);

export function encodeInt32(value: Int32, stream: BinaryStream): void {
export function encodeInt32(value: Int32, stream: OutputBinaryStream): void {
assert(_.isFinite(value));

@@ -98,3 +98,3 @@ stream.writeInteger(value);

export function encodeUInt32(value: UInt32, stream: BinaryStream) {
export function encodeUInt32(value: UInt32, stream: OutputBinaryStream) {
stream.writeUInt32(value);

@@ -118,3 +118,3 @@ }

export function encodeInt8(value: Int8, stream: BinaryStream): void {
export function encodeInt8(value: Int8, stream: OutputBinaryStream): void {
assert(isValidInt8(value));

@@ -144,3 +144,3 @@ stream.writeInt8(value);

export function encodeUInt8(value: UInt8, stream: BinaryStream): void {
export function encodeUInt8(value: UInt8, stream: OutputBinaryStream): void {
stream.writeUInt8(value);

@@ -166,3 +166,3 @@ }

export function encodeUInt64(value: UInt64 | number, stream: BinaryStream) {
export function encodeUInt64(value: UInt64 | number, stream: OutputBinaryStream) {
if (_.isNumber(value)) {

@@ -169,0 +169,0 @@ const arr = coerceUInt64(value);

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

@@ -15,3 +15,3 @@ import { decodeUAString, encodeUAString, UAString } from "./string";

export type LocaleId = UAString;
export function encodeLocaleId(localeId: LocaleId, stream: BinaryStream): void {
export function encodeLocaleId(localeId: LocaleId, stream: OutputBinaryStream): void {
return encodeUAString(localeId, stream);

@@ -18,0 +18,0 @@ }

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

import assert from "node-opcua-assert";
import { BinaryStream } from "node-opcua-binary-stream";
import { BinaryStream, OutputBinaryStream } from "node-opcua-binary-stream";
import { ExpandedNodeId, makeNodeId, NodeId, NodeIdType } from "node-opcua-nodeid";

@@ -91,3 +91,3 @@

function _encodeNodeId(encodingByte: number, nodeId: NodeId, stream: BinaryStream) {
function _encodeNodeId(encodingByte: number, nodeId: NodeId, stream: OutputBinaryStream) {

@@ -127,3 +127,3 @@ stream.writeUInt8(encodingByte); // encoding byte

export function encodeNodeId(nodeId: NodeId, stream: BinaryStream): void {
export function encodeNodeId(nodeId: NodeId, stream: OutputBinaryStream): void {
let encodingByte = nodeID_encodingByte(nodeId);

@@ -135,3 +135,3 @@ /*jslint bitwise: true */

export function encodeExpandedNodeId(expandedNodeId: ExpandedNodeId, stream: BinaryStream) {
export function encodeExpandedNodeId(expandedNodeId: ExpandedNodeId, stream: OutputBinaryStream) {
assert(expandedNodeId, "encodeExpandedNodeId: must provide a valid expandedNodeId");

@@ -138,0 +138,0 @@ const encodingByte = nodeID_encodingByte(expandedNodeId);

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

import { BinaryStream } from "node-opcua-binary-stream" ;
import { BinaryStream, OutputBinaryStream } from "node-opcua-binary-stream" ;

@@ -27,3 +27,3 @@ import { getRandomInt } from "./utils";

export function encodeString(value: null|string, stream: BinaryStream): void {
export function encodeString(value: null|string, stream: OutputBinaryStream): void {
stream.writeString(value);

@@ -30,0 +30,0 @@ }

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

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