botbuilder-stdlib
Advanced tools
Comparing version 4.13.0-dev-internal.date-20210312.sha-59d7f11 to 4.13.0-dev-internal.date-20210315.sha-08c0e54
@@ -328,2 +328,14 @@ import { NewableError } from './assertExt'; | ||
declare function makeTest<T>(assertion: Assertion<T>): Test<T>; | ||
/** | ||
* **UNSAFE** | ||
* Test if `val` is of type `object`. | ||
* This test does not actually verify that `val` is of type `T`. It is useful as the first | ||
* line in a nested assertion so that remaining assertion calls can leverage helpful intellisense. | ||
* This method is only exported under the `unsafe` keyword as a constant reminder of this fact. | ||
* | ||
* @template T the type to cast `val` to, should extend `Dictionary<unknown>`, i.e. be itself an object | ||
* @param {any} val value to test | ||
* @returns {boolean} true if `val` is of type `object` | ||
*/ | ||
declare function isObjectAs<T>(val: unknown): val is T; | ||
export declare const tests: { | ||
@@ -346,2 +358,5 @@ isAny: typeof isAny; | ||
toAssertion: typeof makeAssertion; | ||
unsafe: { | ||
isObjectAs: typeof isObjectAs; | ||
}; | ||
}; | ||
@@ -348,0 +363,0 @@ /** |
@@ -328,2 +328,14 @@ import { NewableError } from './assertExt'; | ||
declare function makeTest<T>(assertion: Assertion<T>): Test<T>; | ||
/** | ||
* **UNSAFE** | ||
* Test if `val` is of type `object`. | ||
* This test does not actually verify that `val` is of type `T`. It is useful as the first | ||
* line in a nested assertion so that remaining assertion calls can leverage helpful intellisense. | ||
* This method is only exported under the `unsafe` keyword as a constant reminder of this fact. | ||
* | ||
* @template T the type to cast `val` to, should extend `Dictionary<unknown>`, i.e. be itself an object | ||
* @param {any} val value to test | ||
* @returns {boolean} true if `val` is of type `object` | ||
*/ | ||
declare function isObjectAs<T>(val: unknown): val is T; | ||
export declare const tests: { | ||
@@ -346,2 +358,5 @@ isAny: typeof isAny; | ||
toAssertion: typeof makeAssertion; | ||
unsafe: { | ||
isObjectAs: typeof isObjectAs; | ||
}; | ||
}; | ||
@@ -348,0 +363,0 @@ /** |
@@ -464,2 +464,17 @@ "use strict"; | ||
} | ||
/** | ||
* **UNSAFE** | ||
* Test if `val` is of type `object`. | ||
* This test does not actually verify that `val` is of type `T`. It is useful as the first | ||
* line in a nested assertion so that remaining assertion calls can leverage helpful intellisense. | ||
* This method is only exported under the `unsafe` keyword as a constant reminder of this fact. | ||
* | ||
* @template T the type to cast `val` to, should extend `Dictionary<unknown>`, i.e. be itself an object | ||
* @param {any} val value to test | ||
* @returns {boolean} true if `val` is of type `object` | ||
*/ | ||
function isObjectAs(val) { | ||
castObjectAs(val, []); | ||
return isObject(val); | ||
} | ||
exports.tests = { | ||
@@ -482,2 +497,3 @@ isAny, | ||
toAssertion: makeAssertion, | ||
unsafe: { isObjectAs }, | ||
}; | ||
@@ -484,0 +500,0 @@ /** |
@@ -5,3 +5,3 @@ { | ||
"description": "BotBuilder shared libraries, internal only", | ||
"version": "4.13.0-dev-internal.date-20210312.sha-59d7f11", | ||
"version": "4.13.0-dev-internal.date-20210315.sha-08c0e54", | ||
"internal": true, | ||
@@ -8,0 +8,0 @@ "license": "MIT", |
@@ -529,2 +529,18 @@ // Copyright (c) Microsoft Corporation. | ||
/** | ||
* **UNSAFE** | ||
* Test if `val` is of type `object`. | ||
* This test does not actually verify that `val` is of type `T`. It is useful as the first | ||
* line in a nested assertion so that remaining assertion calls can leverage helpful intellisense. | ||
* This method is only exported under the `unsafe` keyword as a constant reminder of this fact. | ||
* | ||
* @template T the type to cast `val` to, should extend `Dictionary<unknown>`, i.e. be itself an object | ||
* @param {any} val value to test | ||
* @returns {boolean} true if `val` is of type `object` | ||
*/ | ||
function isObjectAs<T>(val: unknown): val is T { | ||
castObjectAs<T>(val, []); | ||
return isObject(val); | ||
} | ||
export const tests = { | ||
@@ -549,2 +565,4 @@ isAny, | ||
toAssertion: makeAssertion, | ||
unsafe: { isObjectAs }, | ||
}; | ||
@@ -551,0 +569,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
100610
2408