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

ts-type-predicates

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ts-type-predicates - npm Package Compare versions

Comparing version 1.0.4 to 1.0.5

11

CHANGELOG.md

@@ -6,2 +6,13 @@ # Change Log

## [1.0.5](https://github.com/bluelovers/ws-ts-type/compare/ts-type-predicates@1.0.4...ts-type-predicates@1.0.5) (2021-07-27)
### ✨ Features
* add `ignoreExpression` ([47d3b6b](https://github.com/bluelovers/ws-ts-type/commit/47d3b6bda19a27c5c23cf7ea6f7674358bb8123c))
## [1.0.4](https://github.com/bluelovers/ws-ts-type/compare/ts-type-predicates@1.0.3...ts-type-predicates@1.0.4) (2021-07-22)

@@ -8,0 +19,0 @@

2

index.d.ts

@@ -7,4 +7,4 @@ /**

*/
export declare function typePredicates<T, P = any>(actual: T | P, expression?: boolean | ((actual: T | P) => any), message?: string): asserts actual is T;
export declare function typePredicates<T, P = any>(actual: T | P, expression?: boolean | ((actual: T | P) => any), message?: string, ignoreExpression?: boolean): asserts actual is T;
export declare function typeNarrowed<T, P = any>(actual: T | P, expression?: boolean | ((actual: T | P) => any), message?: string): actual is T;
export default typePredicates;

@@ -11,3 +11,3 @@ "use strict";

*/
function typePredicates(actual, expression = true, message) {
function typePredicates(actual, expression = true, message, ignoreExpression) {
expression !== null && expression !== void 0 ? expression : (expression = true);

@@ -17,3 +17,3 @@ if (typeof expression === 'function') {

}
if (expression !== true) {
if (expression !== true && ignoreExpression !== true) {
throw new assert_1.AssertionError({

@@ -20,0 +20,0 @@ message: message !== null && message !== void 0 ? message : `actual ${actual} not as expected`,

{
"name": "ts-type-predicates",
"version": "1.0.4",
"version": "1.0.5",
"description": "use asserts for make type predicates work",

@@ -31,3 +31,3 @@ "homepage": "https://github.com/bluelovers/ws-ts-type/tree/master/packages/ts-type-predicates#readme",

},
"gitHead": "ec7a763fd85c1e284d5276113109a7ee43f93b91"
"gitHead": "3db58925a73a0d5555d4f8dd95f41e93e7855f5b"
}

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