Skip to main content
It is unknown whether this package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers
It is unknown whether this package works with Cloudflare Workers
It is unknown whether this package works with Node.js
It is unknown whether this package works with Deno
It is unknown whether this package works with Bun
It is unknown whether this package works with Browsers
JSR Score
47%
Published
2 months ago (0.1.0)
function hasProperty
hasProperty<
T extends object,
K extends string,
V,
>
(
value: T,
key: K,
predicate: (value: unknown) => value is V,
): value is T & [key in K]: V

Type Parameters

T extends object
K extends string

Parameters

value: T
key: K
predicate: (value: unknown) => value is V

Return Type

value is T & [key in K]: V

Add Package

deno add @positronstudio/ts-utils

Import symbol

import { hasProperty } from "@positronstudio/ts-utils";

Add Package

npx jsr add @positronstudio/ts-utils

Import symbol

import { hasProperty } from "@positronstudio/ts-utils";

Add Package

yarn dlx jsr add @positronstudio/ts-utils

Import symbol

import { hasProperty } from "@positronstudio/ts-utils";

Add Package

pnpm dlx jsr add @positronstudio/ts-utils

Import symbol

import { hasProperty } from "@positronstudio/ts-utils";

Add Package

bunx jsr add @positronstudio/ts-utils

Import symbol

import { hasProperty } from "@positronstudio/ts-utils";