@teamsparta/utils
TypeScript icon, indicating that this package has built-in type declarations

1.2.2 • Public • Published

@teamsparta/utils

@teamsparta/utils는 React, NextJS, NestJS 등 JavaScript 환경에서 사용할 수 있으며 type - safe한 유틸리티성 함수들을 모아놓은 패키지입니다.

Getting Started

npm install @teamsparta/utils       # npm
yarn add @teamsparta/utils          # yarn
pnpm add @teamsparta/utils          # pnpm

Usage

  • clamp: 입력값을 최솟값과 최댓값 사이로 제한합니다.
import { clamp } from '@teamsparta/utils';

function setTime(date: Date, hour: number, minute: number, second: number) {
  return date.setHours(
    clamp(hour, 0, 23),
    clamp(minute, 0, 59),
    clamp(second, 0, 59),
  );
}

Readme

Keywords

none

Package Sidebar

Install

npm i @teamsparta/utils

Weekly Downloads

15

Version

1.2.2

License

MIT

Unpacked Size

6.88 kB

Total Files

7

Last publish

Collaborators

  • jung-eun
  • junan
  • jihee_park
  • dongheelee
  • sparta-sj
  • ganguklee
  • js.byeon
  • mj.jung
  • heo-wonyoung
  • eonthespartan
  • santoryu
  • seongtaek
  • jhyeon-kim
  • spartaheonil
  • hyunwooo
  • kimseunghwan
  • dh.lee
  • mk.kang
  • bknam-teamsparta