Socket
Socket
Sign inDemoInstall

node-opcua-assert

Package Overview
Dependencies
Maintainers
1
Versions
56
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-opcua-assert - npm Package Compare versions

Comparing version 0.5.0 to 2.0.0-alpha.2

15

dist/index.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/***
* @module node-opcua-assert
*/
const chalk_1 = require("chalk");
const displayAssert = process.env.DISPLAY_ASSERT ? true : false;
function assert(cond, message) {
if (!cond) {
const err = new Error(message);
console.log(chalk_1.default.whiteBright.bgRed("-----------------------------------------------------------"));
console.log(err);
console.log(chalk_1.default.whiteBright.bgRed("-----------------------------------------------------------"));
if (displayAssert) {
// tslint:disable:no-console
console.log(chalk_1.default.whiteBright.bgRed("-----------------------------------------------------------"));
console.log(chalk_1.default.whiteBright.bgRed(message));
console.log(err);
console.log(chalk_1.default.whiteBright.bgRed("-----------------------------------------------------------"));
}
throw err;

@@ -15,3 +23,2 @@ }

exports.default = assert;
exports.assert = assert;
//# sourceMappingURL=index.js.map
{
"name": "node-opcua-assert",
"version": "0.5.0",
"version": "2.0.0-alpha.2",
"description": "pure nodejs OPCUA SDK - module -assert",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"scripts": {
"build": "tsc",
"test": "echo nothing to do"
"test": "echo nothing to do",
"clean": "node -e \"require('rimraf').sync('dist');\"",
"lint": "tslint source/**/*.ts"
},
"dependencies": {
"better-assert": "^1.0.2",
"better-assert": "1.0.2",
"chalk": "^2.4.1"

@@ -30,3 +32,3 @@ },

"homepage": "http://node-opcua.github.io/",
"gitHead": "7c2f2dcb6ebdc49e57da1a028406a307df502d4e"
"gitHead": "7f57dd90e9d8bd1abcb8d330b3470999ac51e33f"
}

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

/***
* @module node-opcua-assert
*/
import chalk from "chalk";
const displayAssert = process.env.DISPLAY_ASSERT ? true : false;
export function assert(cond: boolean | object | null | undefined | Function, message?: string): void {
if (!cond) {
const err = new Error(message);
console.log(chalk.whiteBright.bgRed("-----------------------------------------------------------"));
console.log(err);
console.log(chalk.whiteBright.bgRed("-----------------------------------------------------------"));
if (displayAssert) {
// tslint:disable:no-console
console.log(chalk.whiteBright.bgRed("-----------------------------------------------------------"));
console.log(chalk.whiteBright.bgRed(message!));
console.log(err);
console.log(chalk.whiteBright.bgRed("-----------------------------------------------------------"));
}
throw err;

@@ -13,2 +22,1 @@ }

export default assert;
exports.assert = assert;
{
"extends": "../tsconfig.json",
"compilerOptions": {
"skipLibCheck": true,
"target": "es6",
"module": "commonjs",
"declaration": true,
"outDir": "./dist",
"sourceMap": true,
"sourceRoot": "./source",
"strict": true
}
}
"rootDir": "source",
"outDir": "dist"
},
"files": [
"./source/index.ts"
]
}

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