From 65e704f5f597f3eb59bde934d39a49bf95443c0b Mon Sep 17 00:00:00 2001 From: Ryan Van Etten Date: Wed, 19 Mar 2014 22:21:40 -0400 Subject: [PATCH] 0.2.0 release --- README.md | 16 ++++++++++------ eol.js | 12 +++++++----- eol.min.js | 6 +++--- package.json | 28 +++++++++++++++++++++++++--- 4 files changed, 45 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 7e4bef3..f2254c2 100644 --- a/README.md +++ b/README.md @@ -3,17 +3,21 @@ ## API +### `eol.auto(text)` +- Normalize line endings in text for the current operating system +- @return string with line endings normalized to `\r\n` or `\n` + ### `eol.crlf(text)` -- Normalize text to CRLF (Windows, DOS) line endings -- @return string +- Normalize line endings in text to CRLF (Windows, DOS) +- @return string with line endings normalized to `\r\n` ### `eol.lf(text)` -- Normalize text to LF (Unix, OS X) line endings -- @return string +- Normalize line endings in text to LF (Unix, OS X) +- @return string with line endings normalized to `\n` ### `eol.cr(text)` -- Normalize text to CR (Mac OS) line endings -- @return string +- Normalize line endings in text to CR (Mac OS) +- @return string with line endings normalized to `\r` ## License diff --git a/eol.js b/eol.js index 0327fa6..a155372 100644 --- a/eol.js +++ b/eol.js @@ -1,10 +1,9 @@ /*! - * eol 0.1.0+201403121730 + * eol 0.2.0+201403200220 * https://github.com/ryanve/eol - * MIT License (c) 2014 Ryan Van Etten + * MIT License, 2014 Ryan Van Etten */ - -(function(root, name, make) { +!function(root, name, make) { if (typeof module != 'undefined' && module.exports) module.exports = make(); else root[name] = make(); }(this, 'eol', function() { @@ -17,5 +16,8 @@ api['lf'] = converts('\n'); api['cr'] = converts('\r'); api['crlf'] = converts('\r\n'); + api['auto'] = converts( + typeof process != 'undefined' && 'win32' === process.platform ? '\r\n' : '\n' + ); return api; -})); \ No newline at end of file +}); \ No newline at end of file diff --git a/eol.min.js b/eol.min.js index 760769a..6b72323 100644 --- a/eol.min.js +++ b/eol.min.js @@ -1,6 +1,6 @@ /*! - * eol 0.1.0+201403121730 + * eol 0.2.0+201403200220 * https://github.com/ryanve/eol - * MIT License (c) 2014 Ryan Van Etten + * MIT License, 2014 Ryan Van Etten */ -!function(a,b,c){"undefined"!=typeof module&&module.exports?module.exports=c():a[b]=c()}(this,"eol",function(){function a(a){return function(b){return b.replace(c,a)}}var b={},c=/\r\n|\r|\n/g;return b.lf=a("\n"),b.cr=a("\r"),b.crlf=a("\r\n"),b}); \ No newline at end of file +!function(a,b,c){"undefined"!=typeof module&&module.exports?module.exports=c():a[b]=c()}(this,"eol",function(){function a(a){return function(b){return b.replace(c,a)}}var b={},c=/\r\n|\r|\n/g;return b.lf=a("\n"),b.cr=a("\r"),b.crlf=a("\r\n"),b.auto=a("undefined"!=typeof process&&"win32"===process.platform?"\r\n":"\n"),b}); \ No newline at end of file diff --git a/package.json b/package.json index 67bb4c9..2230172 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "eol", "description": "Newline character converter", - "version": "0.1.0", + "version": "0.2.0", "homepage": "https://github.com/ryanve/eol", "license": "MIT", "author": "Ryan Van Etten", @@ -13,10 +13,32 @@ }, "devDependencies": { "aok": "~1.8.1", - "universal": "~0.0.2", - "grunt": "~0.4.2", + "universal": "~0.0.5", + "grunt": "~0.4.4", "grunt-contrib-uglify": "~0.3.0", "grunt-contrib-concat": "~0.3.0", "grunt-contrib-jshint": "~0.8.0" + }, + "jshintConfig": { + "boss": true, + "browser": true, + "debug": true, + "devel": true, + "eqnull": true, + "evil": true, + "expr": true, + "globals": { + "define": true, + "ender": true + }, + "jquery": true, + "latedef": "nofunc", + "laxcomma": true, + "maxerr": 10, + "node": true, + "sub": true, + "supernew": true, + "undef": true, + "unused": true } } \ No newline at end of file