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) 433 B
var toString = require('../lang/toString'); var slugify = require('./slugify'); var unCamelCase = require('./unCamelCase'); /** * Replaces spaces with underscores, split camelCase text, remove non-word chars, remove accents and convert to lower case. */ function underscore(str){ str = toString(str); str = unCamelCase(str); return slugify(str, "_"); } module.exports = underscore;