@wave-server/wave_response_code
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

Wave Error Reponse Codes and Messages in Locale

types & interfaces

type Locales = 'ko' | 'en';
type IResponse = {
    [code : number]: string;
}

methods

// Returns error message by locale and code
function getMessage(locale: Locales, code: number): string

// Returns whole json by locale
function getJSONByLocale(locale: Locales): IResponse

build & test

npm run build
/// compares every json lengths, same keys, nullable values

examples

import {getMessage, getJSONByLocale} from '@wave-server/wave_response_code';

const message = getMessage('ko', 1000);
console.log(message) // 친구를 찾을 수 없습니다

const json = getJSONByLocale('ko');
console.log(json) // {"1000": "친구를 찾을 수 없습니다", "2000": "친구를 추가할 수 없습니다"}

Readme

Keywords

none

Package Sidebar

Install

npm i @wave-server/wave_response_code

Weekly Downloads

1

Version

1.0.2

License

ISC

Unpacked Size

4.96 kB

Total Files

8

Last publish

Collaborators

  • ryanlee92wave
  • wave_eugene
  • realnumber