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

19 lines (13 loc) 463 B
var toString = require('../lang/toString'); /** * Convert line-breaks from DOS/MAC to a single standard (UNIX by default) */ function normalizeLineBreaks(str, lineEnd) { str = toString(str); lineEnd = lineEnd || '\n'; return str .replace(/\r\n/g, lineEnd) // DOS .replace(/\r/g, lineEnd) // Mac .replace(/\n/g, lineEnd); // Unix } module.exports = normalizeLineBreaks;