node-opcua-buffer-utils
Advanced tools
Comparing version 0.5.0 to 2.0.0-alpha.2
/// <reference types="node" /> | ||
/*** | ||
* @module node-opcua-buffer-utils | ||
*/ | ||
export declare const createFastUninitializedBuffer: Function; | ||
@@ -3,0 +6,0 @@ /** |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
/*** | ||
* @module node-opcua-buffer-utils | ||
*/ | ||
// | ||
@@ -11,3 +14,3 @@ // note: new Buffer(size)# is deprecated since: v6.0. and is replaced with Buffer.allocUnsafe | ||
// | ||
exports.createFastUninitializedBuffer = Buffer.allocUnsafe ? Buffer.allocUnsafe : function a(size) { | ||
exports.createFastUninitializedBuffer = Buffer.allocUnsafe ? Buffer.allocUnsafe : (size) => { | ||
return new Buffer(size); | ||
@@ -29,3 +32,3 @@ }; | ||
let i = 0; | ||
l.forEach(function (value) { | ||
l.forEach((value) => { | ||
b.writeUInt8(parseInt(value, 16), i); | ||
@@ -32,0 +35,0 @@ i += 1; |
{ | ||
"name": "node-opcua-buffer-utils", | ||
"version": "0.5.0", | ||
"version": "2.0.0-alpha.2", | ||
"description": "pure nodejs OPCUA SDK - module -buffer-utils", | ||
"main": "dist/buffer_utils.js", | ||
"types": "dist/buffer_utils.d.ts", | ||
"main": "./dist/buffer_utils.js", | ||
"types": "./dist/buffer_utils.d.ts", | ||
"scripts": { | ||
"build": "tsc", | ||
"test": "mocha test" | ||
"test": "mocha test", | ||
"clean": "node -e \"require('rimraf').sync('dist');\"", | ||
"lint": "tslint source/**/*.ts" | ||
}, | ||
@@ -14,6 +16,6 @@ "author": "Etienne Rossignon", | ||
"dependencies": { | ||
"node-opcua-assert": "^0.5.0" | ||
"node-opcua-assert": "^2.0.0-alpha.2" | ||
}, | ||
"devDependencies": { | ||
"node-opcua-benchmarker": "^0.5.0" | ||
"node-opcua-benchmarker": "^2.0.0-alpha.2" | ||
}, | ||
@@ -33,3 +35,3 @@ "repository": { | ||
"homepage": "http://node-opcua.github.io/", | ||
"gitHead": "7c2f2dcb6ebdc49e57da1a028406a307df502d4e" | ||
"gitHead": "7f57dd90e9d8bd1abcb8d330b3470999ac51e33f" | ||
} |
@@ -0,1 +1,4 @@ | ||
/*** | ||
* @module node-opcua-buffer-utils | ||
*/ | ||
// | ||
@@ -9,5 +12,6 @@ // note: new Buffer(size)# is deprecated since: v6.0. and is replaced with Buffer.allocUnsafe | ||
// | ||
export const createFastUninitializedBuffer : Function = Buffer.allocUnsafe ? Buffer.allocUnsafe : function a (size: number) { | ||
return new Buffer(size); | ||
}; | ||
export const createFastUninitializedBuffer: Function = | ||
Buffer.allocUnsafe ? Buffer.allocUnsafe : (size: number) => { | ||
return new Buffer(size); | ||
}; | ||
@@ -24,7 +28,7 @@ /** | ||
*/ | ||
export function makeBuffer(listOfBytes : string): Buffer { | ||
export function makeBuffer(listOfBytes: string): Buffer { | ||
const l = listOfBytes.split(" "); | ||
const b = exports.createFastUninitializedBuffer(l.length); | ||
let i = 0; | ||
l.forEach(function (value) { | ||
l.forEach((value) => { | ||
b.writeUInt8(parseInt(value, 16), i); | ||
@@ -31,0 +35,0 @@ i += 1; |
{ | ||
"extends" : "../tsconfig.json", | ||
"compilerOptions": { | ||
"skipLibCheck": true, | ||
"target": "es6", | ||
"module": "commonjs", | ||
"declaration": true, | ||
"outDir": "./dist", | ||
"sourceMap": true, | ||
"sourceRoot": "./source", | ||
"strict": true | ||
"rootDir": "source", | ||
"outDir": "dist" | ||
} | ||
} |
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
7827
150
+ Addedansi-styles@4.3.0(transitive)
+ Addedchalk@4.1.2(transitive)
+ Addedcolor-convert@2.0.1(transitive)
+ Addedcolor-name@1.1.4(transitive)
+ Addedhas-flag@4.0.0(transitive)
+ Addednode-opcua-assert@2.120.0(transitive)
+ Addedsupports-color@7.2.0(transitive)
- Removedansi-styles@3.2.1(transitive)
- Removedbetter-assert@1.0.2(transitive)
- Removedcallsite@1.0.0(transitive)
- Removedchalk@2.4.2(transitive)
- Removedcolor-convert@1.9.3(transitive)
- Removedcolor-name@1.1.3(transitive)
- Removedescape-string-regexp@1.0.5(transitive)
- Removedhas-flag@3.0.0(transitive)
- Removednode-opcua-assert@0.5.0(transitive)
- Removedsupports-color@5.5.0(transitive)