1.0.4 • Published 1 year ago

transliteration-sorting v1.0.4

Weekly downloads
6
License
MIT
Repository
github
Last release
1 year ago

transliteration-sorting

Transliteration and sorting list by set field.

Installation

npm i transliteration-sorting --save

Usage

const { transliterationSorting } = require('../index')

const users = [
  { id: 1, name: 'Anton' },
  { id: 2, name: 'Ян' },
  { id: 3, name: 'Phil' },
  { id: 4, name: 'Андрей' },
]

const result = transliterationSorting(users, 'name', 'ru_en')

/*
  result = [
    { id: 4, name: 'Андрей', translit: 'Andrey' },
    { id: 1, name: 'Anton', translit: 'Anton' },
    { id: 3, name: 'Phil', translit: 'Phil' },
    { id: 2, name: 'Ян', translit: 'Yan' },
  ]
*/
1.0.4

1 year 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