1.1.1 β€’ Published 2 years ago

smody-library v1.1.1

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

πŸš€ smody util library

  • μ†Œκ°œ

    • 슀λͺ¨λ”” ν”„λ‘œμ νŠΈμ—μ„œ μ‚¬μš©λ˜λŠ” λ²”μš© νƒ€μž… λͺ¨λ“ˆμž…λ‹ˆλ‹€.
    • MappedKeyToUnion, PickType 메타 νƒ€μž…μ„ μ œκ³΅ν•©λ‹ˆλ‹€.
  • μ„€μΉ˜

npm install smody-library --save-dev
  • μ‹€ν–‰

MappedKeyToUnion

import { MappedKeyToUnion } from 'smody-library';

const COLOR = {
  LIGHT_PURPLE: '#F5F3FF',
  PURPLE: '#7B61FF',
  DARK_PURPLE: '#7054FE',
} as const;

type AvailablePickedColor = MappedKeyToUnion<typeof COLOR>;
// => type AvailablePickedColor = "#F5F3FF" | "#7B61FF" | "#7054FE";

PickType

import { PickType } from 'smody-library';

type Person = {
  name: string;
  age: number;
}

type PickedName = PickType<Person, 'name'>
// => PickedName type is string

type PickedAge = PickType<Person, 'age'>
// => PickedAge type is number
1.1.1

2 years ago

1.1.0

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago