Socket
Socket
Sign inDemoInstall

@platform/util.value

Package Overview
Dependencies
10
Maintainers
1
Versions
145
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.8.23 to 0.9.0

15

lib/rx/rx.event.d.ts
import { Observable } from 'rxjs';
export declare function event<E extends {
declare type Event = {
type: string;
payload: unknown;
}>(ob$: Observable<unknown>, type: E['type']): Observable<E>;
export declare function payload<E extends {
type: string;
payload: unknown;
}>(ob$: Observable<unknown>, type: E['type']): Observable<E["payload"]>;
export declare function isEvent(input: any): boolean;
};
export declare function event<E extends Event>(ob$: Observable<unknown>, type: E['type']): Observable<E>;
export declare function payload<E extends Event>(ob$: Observable<unknown>, type: E['type']): Observable<E["payload"]>;
export declare function isEvent(input: any, type?: string | {
startsWith: string;
}): boolean;
export {};

@@ -13,8 +13,27 @@ "use strict";

exports.payload = payload;
function isEvent(input) {
return (input !== null &&
function isEvent(input, type) {
if (!(input !== null &&
typeof input === 'object' &&
typeof input.type === 'string' &&
typeof input.payload === 'object');
typeof input.payload === 'object')) {
return false;
}
if (type === null)
return false;
if (type !== undefined) {
var event_1 = input;
if (typeof type === 'object') {
if (typeof type.startsWith !== 'string')
return false;
return event_1.type.startsWith(type.startsWith);
}
else {
if (typeof type !== 'string')
return false;
if (event_1.type !== type)
return false;
}
}
return true;
}
exports.isEvent = isEvent;
{
"name": "@platform/util.value",
"version": "0.8.23",
"version": "0.9.0",
"description": "Helpers for working with, transforming, and formatting values.",

@@ -5,0 +5,0 @@ "main": "lib/index",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc