ts-generic-property
TypeScript icon, indicating that this package has built-in type declarations

1.0.5 • Public • Published

ts-generic-property

npm build publish Libraries.io dependency status for latest release Bundlephobia npm

Creates object with generic property

Getting started

$ npm i ts-generic-property

Overview

export const genericProperty = <Name extends string, Value>(
  name: Name,
  value: Value
) =>
  ({
    [name]: value,
  } as { readonly [key in Name]: Value })

Readme

Keywords

none

Package Sidebar

Install

npm i ts-generic-property

Weekly Downloads

14

Version

1.0.5

License

MIT

Unpacked Size

4.63 kB

Total Files

10

Last publish

Collaborators

  • iyegoroff