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
16 lines (13 loc) • 414 B
JavaScript
var toString = require('../lang/toString');
var WHITE_SPACES = require('./WHITE_SPACES');
var ltrim = require('./ltrim');
var rtrim = require('./rtrim');
/**
* Remove white-spaces from beginning and end of string.
*/
function trim(str, chars) {
str = toString(str);
chars = chars || WHITE_SPACES;
return ltrim(rtrim(str, chars), chars);
}
module.exports = trim;