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

botbuilder-stdlib

Package Overview
Dependencies
Maintainers
1
Versions
414
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

botbuilder-stdlib - npm Package Compare versions

Comparing version 4.12.0-dev-20210112.d086640ffcc0 to 4.12.0-dev-20210113.252531097085

7

_ts3.4/lib/assertExt.d.ts

@@ -13,9 +13,2 @@ import { Newable } from './types';

export declare function assertCondition(condition: unknown, message: string, ctor?: NewableError): void;
/**
* Executes `block` and ensures it throws an exception with `message`
*
* @param {(...args: any[]) => any} block a function that should throw
* @param {string} message expected error message
*/
export declare function throwsMessage(block: (...args: unknown[]) => unknown, message: string): void;
//# sourceMappingURL=assertExt.d.ts.map

@@ -11,9 +11,2 @@ import { Newable } from './types';

export declare function assertCondition(condition: unknown, message: string, ctor?: NewableError): asserts condition;
/**
* Executes `block` and ensures it throws an exception with `message`
*
* @param {(...args: any[]) => any} block a function that should throw
* @param {string} message expected error message
*/
export declare function throwsMessage(block: (...args: unknown[]) => unknown, message: string): void;
//# sourceMappingURL=assertExt.d.ts.map

25

lib/assertExt.js
"use strict";
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.throwsMessage = exports.assertCondition = void 0;
const assert_1 = __importDefault(require("assert"));
const types_1 = require("./types");
exports.assertCondition = void 0;
/**

@@ -24,20 +19,2 @@ * Asserts `condition` to the Typescript compiler

exports.assertCondition = assertCondition;
/**
* Executes `block` and ensures it throws an exception with `message`
*
* @param {(...args: any[]) => any} block a function that should throw
* @param {string} message expected error message
*/
function throwsMessage(block, message) {
try {
block();
}
catch (err) {
assertCondition(types_1.tests.isError(err), 'expected block to throw an Error');
assert_1.default.strictEqual(err.message, message);
return;
}
throw new Error('promise did not throw');
}
exports.throwsMessage = throwsMessage;
//# sourceMappingURL=assertExt.js.map

2

package.json

@@ -5,3 +5,3 @@ {

"description": "BotBuilder shared libraries, internal only",
"version": "4.12.0-dev-20210112.d086640ffcc0",
"version": "4.12.0-dev-20210113.252531097085",
"internal": true,

@@ -8,0 +8,0 @@ "license": "MIT",

// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import assert from 'assert';
import { Newable, tests } from './types';
import { Newable } from './types';

@@ -22,19 +21,1 @@ // Represents an error constructor

}
/**
* Executes `block` and ensures it throws an exception with `message`
*
* @param {(...args: any[]) => any} block a function that should throw
* @param {string} message expected error message
*/
export function throwsMessage(block: (...args: unknown[]) => unknown, message: string): void {
try {
block();
} catch (err) {
assertCondition(tests.isError(err), 'expected block to throw an Error');
assert.strictEqual(err.message, message);
return;
}
throw new Error('promise did not throw');
}

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