๐Ÿš€ Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more โ†’
Socket
Sign inDemoInstall
Socket

auto-hyphen-utils

Package Overview
Dependencies
Maintainers
0
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

auto-hyphen-utils

This module provides automatic formatting and hyphenation for structured inputs with a similar pattern.

1.0.2
latest
Source
npm
Version published
Maintainers
0
Created
Source

auto-hyphen-utils

NPM Version License Build Status Bundle Size Downloads

โœจ ์ž…๋ ฅ๊ฐ’์„ ์ž๋™์œผ๋กœ ํ•˜์ดํ”ˆ ์ฒ˜๋ฆฌํ•˜๋Š” JavaScript ์œ ํ‹ธ๋ฆฌํ‹ฐ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ
์ „ํ™”๋ฒˆํ˜ธ, ์ฃผ๋ฏผ๋“ฑ๋ก๋ฒˆํ˜ธ, ์‚ฌ์—…์ž๋“ฑ๋ก๋ฒˆํ˜ธ ๋“ฑ ๋‹ค์–‘ํ•œ ์ž…๋ ฅ๊ฐ’์„ ์ž๋™์œผ๋กœ ๋ณ€ํ™˜ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

โšก Lightweight & High Performance

๐Ÿš€ ๊ณ ์„ฑ๋Šฅ ๋ฐ ์ €์šฉ๋Ÿ‰์œผ๋กœ ์ตœ์ ํ™”๋œ ์œ ํ‹ธ๋ฆฌํ‹ฐ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ์ž…๋‹ˆ๋‹ค.

  • ๊ฐ€๋ณ๊ณ  ๋น ๋ฆ„: ํŒจํ‚ค์ง€ ํฌ๊ธฐ๊ฐ€ ์ž‘์•„ ์„ฑ๋Šฅ์— ์˜ํ–ฅ์„ ์ฃผ์ง€ ์•Š์Œ
  • Zero Dependencies: ์™ธ๋ถ€ ์˜์กด์„ฑ์ด ์—†์–ด ์œ ์ง€๋ณด์ˆ˜๊ฐ€ ์‰ฌ์›€
  • ์ •๊ทœ ํ‘œํ˜„์‹ ๊ธฐ๋ฐ˜ ์ตœ์ ํ™”: ๋น ๋ฅด๊ณ  ์•ˆ์ •์ ์ธ ํ•˜์ดํ”ˆ ๋ณ€ํ™˜ ๊ฐ€๋Šฅ

๐Ÿ‘‹๐Ÿป Installation

npm install auto-hyphen-utils
yarn add auto-hyphen-utils
pnpm add auto-hyphen-utils

๐ŸŽฏ Usage

๐Ÿ“– utils

- ํŠน์ • ํŒจํ„ด์„ ์ง€์ •ํ•ด ํ•˜์ดํ”ˆ์„ ๋„ฃ์–ด์ค˜์š”
autoHyphen.common(value: string, pattern: number[])
console.log(autoHyphen.common("1234567890")); // "1234567890"
console.log(autoHyphen.common("1234567890", [3, 6])); // "123-456-7890"

โธป

- ํ•œ๊ตญ ์ „ํ™”๋ฒˆํ˜ธ(ํœด๋Œ€ํฐ ๋ฐ ์œ ์„ ์ „ํ™”)์— ๋งž์ถฐ ํ•˜์ดํ”ˆ์„ ๋„ฃ์–ด์ค˜์š”
autoHyphen.phoneNumber(value: string)
console.log(autoHyphen.phoneNumber("01012345678")); // "010-1234-5678"
console.log(autoHyphen.phoneNumber("0212345678"));  // "02-1234-5678"

โธป
- ์‚ฌ์—…์ž๋“ฑ๋ก๋ฒˆํ˜ธ(TIN, Taxpayer Identification Number)์— ๋งž์ถฐ ํ•˜์ดํ”ˆ์„ ๋„ฃ์–ด์ค˜์š”
autoHyphen.tinNumber(value: string)
console.log(autoHyphen.tinNumber("1234567890")); // "123-45-67890"

๐Ÿ›  Integrating auto-hyphen-utils with React Hook Form


import { Controller, useForm } from 'react-hook-form';
import autoHyphen from 'auto-hyphen-utils';

const PhoneInput = () => {
  const { control } = useForm();

  return (
    <Controller
      name="phone"
      control={control}
      render={({ field }) => (
        <input
          {...field}
          placeholder="์ „ํ™”๋ฒˆํ˜ธ ์ž…๋ ฅ"
          value={autoHyphen.phoneNumber(field.value)}
          onChange={(e) => field.onChange(e.target.value)}
        />
      )}
    />
  );
};

Keywords

hyphen

FAQs

Package last updated on 18 Mar 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts