@eclipse-glsp/protocol
Advanced tools
Comparing version 2.2.0-next.360 to 2.2.0-next.362
@@ -64,2 +64,4 @@ /******************************************************************************** | ||
export declare function typeGuard<T, G>(one: TypeGuard<T>, other: TypeGuard<G>): TypeGuard<T & G>; | ||
/** Utility function to combine two type guards with an OR */ | ||
export declare function typeGuardOr<T, G>(one: TypeGuard<T>, other: TypeGuard<G>): TypeGuard<T | G>; | ||
/** | ||
@@ -66,0 +68,0 @@ * Utility function that create a typeguard function for a given class constructor. |
@@ -18,3 +18,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.hasArrayProp = exports.hasFunctionProp = exports.hasObjectProp = exports.hasNumberProp = exports.hasBooleanProp = exports.hasStringProp = exports.call = exports.toTypeGuard = exports.typeGuard = exports.AnyObject = void 0; | ||
exports.hasArrayProp = exports.hasFunctionProp = exports.hasObjectProp = exports.hasNumberProp = exports.hasBooleanProp = exports.hasStringProp = exports.call = exports.toTypeGuard = exports.typeGuardOr = exports.typeGuard = exports.AnyObject = void 0; | ||
var AnyObject; | ||
@@ -38,2 +38,7 @@ (function (AnyObject) { | ||
exports.typeGuard = typeGuard; | ||
/** Utility function to combine two type guards with an OR */ | ||
function typeGuardOr(one, other) { | ||
return (element) => one(element) || other(element); | ||
} | ||
exports.typeGuardOr = typeGuardOr; | ||
/** | ||
@@ -40,0 +45,0 @@ * Utility function that create a typeguard function for a given class constructor. |
{ | ||
"name": "@eclipse-glsp/protocol", | ||
"version": "2.2.0-next.360+0c1c838", | ||
"version": "2.2.0-next.362+92f042a", | ||
"description": "The protocol definition for client-server communication in GLSP", | ||
@@ -61,3 +61,3 @@ "keywords": [ | ||
}, | ||
"gitHead": "0c1c838eb8a0ffb9a647a7f617bdf9602086d0af" | ||
"gitHead": "92f042a7a16464c40192bf74639cae7e293aa018" | ||
} |
@@ -77,2 +77,7 @@ /******************************************************************************** | ||
/** Utility function to combine two type guards with an OR */ | ||
export function typeGuardOr<T, G>(one: TypeGuard<T>, other: TypeGuard<G>): TypeGuard<T | G> { | ||
return (element: any): element is T | G => one(element) || other(element); | ||
} | ||
/** | ||
@@ -79,0 +84,0 @@ * Utility function that create a typeguard function for a given class constructor. |
Sorry, the diff of this file is not supported yet
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
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
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
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
1116881
19385