@autheur/operators
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

@autheur/operators

Utility function to manipulate french words

Installation

npm i @autheur/operators

API

pluralize

Pluralize regular words

import { pluralize } from '@autheur/operators';

pluralize('arbre'); // arbres
pluralize('gateau'); // gateaux
pluralize('vitrail'); // vitraux

feminize

Feminize regular adjectives

import { feminize } from '@autheur/operators';

feminize('inventif'); // inventive
feminize('intelligent'); // intelligente
feminize('jeune'); // jeune

isFirstCharAVowel

Return true if the input string start with a vowel

import { isFirstCharAVowel } from '@autheur/operators';

isFirstCharAVowel('arbre'); // true
isFirstCharAVowel('jeune'); // false
isFirstCharAVowel('hotel'); // false

isFirstCharAVowelOrAnH

Return true if the input string start with a vowel or a h

import { isFirstCharAVowelOrAnH } from '@autheur/operators';

isFirstCharAVowelOrAnH('arbre'); // true
isFirstCharAVowelOrAnH('jeune'); // false
isFirstCharAVowelOrAnH('hotel'); // true

capitalize

Return the input string with the first letter uppercased

import { capitalize } from '@autheur/operators';

capitalize('arbre'); // Arbre
capitalize('jeune'); // Jeune
capitalize('école'); // École

getRandomItemInArray

Return a random item from an array

import { getRandomItemInArray } from '@autheur/operators';

getRandomItemInArray(['foo', 'bar', 'baz']); // baz
getRandomItemInArray(['foo', 'bar', 'baz']); // foo

Other packages

This is a from a monorepo with the following packages:

Package Description
@autheur/dataset Dataset of sorted french words broke down by categories
@autheur/generator The generator itself with they logic
@autheur/operators Utilities to manipulate words (ex: pluralize, feminize, ...)

Credits

Coded with ❤️ by Corentin Thomasset.

License

This project is under the MIT license.

Package Sidebar

Install

npm i @autheur/operators

Weekly Downloads

0

Version

1.1.0

License

MIT

Unpacked Size

9.51 kB

Total Files

6

Last publish

Collaborators

  • corentinth