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 (14 loc) 463 B
define(['../lang/toString'], function (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 } return normalizeLineBreaks; });