UNPKG

tastypie

Version:

Tastypie is a webservice API framework for Node.js based on Django's Tastypie Framework. It provides a convenient, yet powerful and highly customizable, abstraction for creating REST-style interfaces

14 lines (12 loc) 455 B
define(['../lang/toString', './lowerCase', './upperCase'], function(toString, lowerCase, upperCase){ /** * UPPERCASE first char of each sentence and lowercase other chars. */ function sentenceCase(str){ str = toString(str); // Replace first char of each sentence (new line or after '.\s+') to // UPPERCASE return lowerCase(str).replace(/(^\w)|\.\s+(\w)/gm, upperCase); } return sentenceCase; });