to-sentence-case-with-dot

1.1.14 • Public • Published

to-sentence-case-with-dot

MIT License Build Status

NPM status

A JavaScript library which, for each sentence, transforms the first letter to upper case and other letters to lower case.

It appends a dot at the end if not added before.

It recognizes dot ., question mark ? and exclamation mark ! as characters ending a sentence.

After the character ending a given sentence, there must be a space.

install

npm install --save to-sentence-case-with-dot or yarn add to-sentence-case-with-dot

usage

const toSentenceCaseWithDot = require('to-sentence-case-with-dot').default;

const input = 'loREm IPsum DOLOR sit ameT. consectetur! Adipiscing elit? sed DO eiusmod tempor incididunt';
const result = toSentenceCaseWithDot(input);
expect(result).to.equal('Lorem ipsum dolor sit amet. Consectetur! Adipiscing elit? Sed do eiusmod tempor incididunt.');

In order to see more details, see tests.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.1.14
    4
    • latest

Version History

Package Sidebar

Install

npm i to-sentence-case-with-dot

Weekly Downloads

23

Version

1.1.14

License

MIT

Unpacked Size

3.84 kB

Total Files

4

Last publish

Collaborators

  • oprogramador