Converts internasionalization to i18n (where 18 stands for the number of letters between the first i and the last n in the word internationalization) and Wombat to W4t!
Install:
yarn add n10y
npm i n10y
Import:
import n10y from 'n10y'
const n10y = require('n10y')
Use:
console.log(n10y('wombat'))
Do you have another crazy idea? Open a PR! Everything working is accepted!
First (@pi0):
const i18fy = s => s[0] + (s.length - 2) + s[s.length - 1]
Shift/Pop (@pi0):
const i18fy = s => s.split('').shift() + (s.length - 2) + s.split('').pop()
MIT
Inspired by a tweet from @alvarotrigo. Also thanks to Harald Atteneder for package name suggestion.
We use cookies
We use cookies to analyze traffic and improve your experience. You can accept or reject analytics cookies.