From 6e12260d0466dda0358e1e9da1549d6a4dfb303d Mon Sep 17 00:00:00 2001 From: Ryan Van Etten Date: Sat, 10 Sep 2016 15:55:57 -0700 Subject: [PATCH 01/24] space it out a bit --- src/index.js | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/src/index.js b/src/index.js index ea1fd6c..78f1a8e 100644 --- a/src/index.js +++ b/src/index.js @@ -1,18 +1,22 @@ !function(root, name, make) { - if (typeof module != 'undefined' && module.exports) module.exports = make(); - else root[name] = make(); + if (typeof module != 'undefined' && module.exports) module.exports = make() + else root[name] = make() }(this, 'eol', function() { + function converts(to) { return function(text) { - return text.replace(newline, to); - }; + return text.replace(newline, to) + } } - var api = {}, newline = /\r\n|\r|\n/g; - 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; + + var api = {} + var newline = /\r\n|\r|\n/g + var isWindows = typeof process != 'undefined' && 'win32' === process.platform + + api['lf'] = converts('\n') + api['cr'] = converts('\r') + api['crlf'] = converts('\r\n') + api['auto'] = converts(isWindows ? '\r\n' : '\n') + + return api }); \ No newline at end of file From 5fd4b95403061aef29764193a9f8a96e93e241d7 Mon Sep 17 00:00:00 2001 From: Ryan Van Etten Date: Sat, 10 Sep 2016 15:57:52 -0700 Subject: [PATCH 02/24] add .editorconfig --- .editorconfig | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..b3dfee7 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,7 @@ +root = true + +[*] +end_of_line = lf +insert_final_newline = true +indent_style = space +indent_size = 2 From 72343b39dc687b8375a1f97799f481157064fb63 Mon Sep 17 00:00:00 2001 From: Ryan Van Etten Date: Sat, 10 Sep 2016 16:18:56 -0700 Subject: [PATCH 03/24] permit asi --- package.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 2230172..b6ca4c0 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,7 @@ "grunt-contrib-jshint": "~0.8.0" }, "jshintConfig": { + "asi": true, "boss": true, "browser": true, "debug": true, @@ -29,7 +30,7 @@ "expr": true, "globals": { "define": true, - "ender": true + "ender": true }, "jquery": true, "latedef": "nofunc", @@ -41,4 +42,4 @@ "undef": true, "unused": true } -} \ No newline at end of file +} From 973e79fb96606042959c6e4f7996bd19b926010d Mon Sep 17 00:00:00 2001 From: Ryan Van Etten Date: Sat, 10 Sep 2016 16:22:19 -0700 Subject: [PATCH 04/24] dont provide minified anymore --- eol.js | 2 +- eol.min.js | 6 ------ package.json | 3 +-- 3 files changed, 2 insertions(+), 9 deletions(-) delete mode 100644 eol.min.js diff --git a/eol.js b/eol.js index a155372..c656fb8 100644 --- a/eol.js +++ b/eol.js @@ -20,4 +20,4 @@ typeof process != 'undefined' && 'win32' === process.platform ? '\r\n' : '\n' ); return api; -}); \ No newline at end of file +}); diff --git a/eol.min.js b/eol.min.js deleted file mode 100644 index 6b72323..0000000 --- a/eol.min.js +++ /dev/null @@ -1,6 +0,0 @@ -/*! - * eol 0.2.0+201403200220 - * https://github.com/ryanve/eol - * 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.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 b6ca4c0..6db2c55 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "eol", "description": "Newline character converter", - "version": "0.2.0", + "version": "0.3.0-0", "homepage": "https://github.com/ryanve/eol", "license": "MIT", "author": "Ryan Van Etten", @@ -15,7 +15,6 @@ "aok": "~1.8.1", "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" }, From 0de68c673bec837cb91bd3eea9e0c91a32f8661e Mon Sep 17 00:00:00 2001 From: Ryan Van Etten Date: Sat, 10 Sep 2016 16:24:32 -0700 Subject: [PATCH 05/24] reduce jshint options --- package.json | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/package.json b/package.json index 6db2c55..0e062ab 100644 --- a/package.json +++ b/package.json @@ -22,19 +22,11 @@ "asi": true, "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, + "maxerr": 5, "node": true, "sub": true, "supernew": true, From 66920074c3a7b234d86a95df42c9f6f1d162862d Mon Sep 17 00:00:00 2001 From: Ryan Van Etten Date: Sat, 10 Sep 2016 16:25:56 -0700 Subject: [PATCH 06/24] bump aok --- package.json | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 0e062ab..31521ec 100644 --- a/package.json +++ b/package.json @@ -5,18 +5,26 @@ "homepage": "https://github.com/ryanve/eol", "license": "MIT", "author": "Ryan Van Etten", - "keywords": ["eol", "newline", "convert", "converter", "conversion", "character", "ender"], + "keywords": [ + "eol", + "newline", + "convert", + "converter", + "conversion", + "character", + "ender" + ], "main": "./eol.js", "repository": { "type": "git", "url": "https://github.com/ryanve/eol.git" }, "devDependencies": { - "aok": "~1.8.1", - "universal": "~0.0.5", + "aok": "^1.9.0", "grunt": "~0.4.4", "grunt-contrib-concat": "~0.3.0", - "grunt-contrib-jshint": "~0.8.0" + "grunt-contrib-jshint": "~0.8.0", + "universal": "~0.0.5" }, "jshintConfig": { "asi": true, From 550aaef68026c90a50b005663894f23c1b96a94a Mon Sep 17 00:00:00 2001 From: Ryan Van Etten Date: Sat, 10 Sep 2016 16:26:42 -0700 Subject: [PATCH 07/24] remove excess ./ --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 31521ec..7840ab7 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "character", "ender" ], - "main": "./eol.js", + "main": "eol.js", "repository": { "type": "git", "url": "https://github.com/ryanve/eol.git" From 3189641d5fefd52ab1a0525b6e5f97db552f5945 Mon Sep 17 00:00:00 2001 From: Ryan Van Etten Date: Sat, 10 Sep 2016 16:27:36 -0700 Subject: [PATCH 08/24] add bugs url --- package.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/package.json b/package.json index 7840ab7..c9dfe38 100644 --- a/package.json +++ b/package.json @@ -19,6 +19,9 @@ "type": "git", "url": "https://github.com/ryanve/eol.git" }, + "bugs": { + "url": "https://github.com/ryanve/eol/issues" + }, "devDependencies": { "aok": "^1.9.0", "grunt": "~0.4.4", From 23fd33ea50e7e832d712940d65542efe93a1b265 Mon Sep 17 00:00:00 2001 From: Ryan Van Etten Date: Sat, 10 Sep 2016 17:05:32 -0700 Subject: [PATCH 09/24] flatten structure and use npm scripts --- GruntFile.js | 2 -- eol.js | 33 ++++++++++++++++----------------- package.json | 11 ++++++----- src/index.js | 22 ---------------------- test/index.js => test.js | 6 +++--- test/index.html | 28 ---------------------------- 6 files changed, 25 insertions(+), 77 deletions(-) delete mode 100644 GruntFile.js delete mode 100644 src/index.js rename test/index.js => test.js (93%) delete mode 100644 test/index.html diff --git a/GruntFile.js b/GruntFile.js deleted file mode 100644 index b0ebb04..0000000 --- a/GruntFile.js +++ /dev/null @@ -1,2 +0,0 @@ -//github.com/ryanve/universal#grunt -module.exports = require('./node_modules/universal/GruntFile'); \ No newline at end of file diff --git a/eol.js b/eol.js index c656fb8..2113f95 100644 --- a/eol.js +++ b/eol.js @@ -1,23 +1,22 @@ -/*! - * eol 0.2.0+201403200220 - * https://github.com/ryanve/eol - * MIT License, 2014 Ryan Van Etten - */ !function(root, name, make) { - if (typeof module != 'undefined' && module.exports) module.exports = make(); - else root[name] = make(); + if (typeof module != 'undefined' && module.exports) module.exports = make() + else root[name] = make() }(this, 'eol', function() { + + var api = {} + var isWindows = typeof process != 'undefined' && 'win32' === process.platform + var newline = /\r\n|\r|\n/g + function converts(to) { return function(text) { - return text.replace(newline, to); - }; + return text.replace(newline, to) + } } - var api = {}, newline = /\r\n|\r|\n/g; - 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; + + api['lf'] = converts('\n') + api['cr'] = converts('\r') + api['crlf'] = converts('\r\n') + api['auto'] = converts(isWindows ? '\r\n' : '\n') + + return api }); diff --git a/package.json b/package.json index c9dfe38..68b2520 100644 --- a/package.json +++ b/package.json @@ -15,6 +15,10 @@ "ender" ], "main": "eol.js", + "scripts": { + "lint": "jshint eol.js && jshint test.js", + "test": "npm run lint && node test.js" + }, "repository": { "type": "git", "url": "https://github.com/ryanve/eol.git" @@ -23,11 +27,8 @@ "url": "https://github.com/ryanve/eol/issues" }, "devDependencies": { - "aok": "^1.9.0", - "grunt": "~0.4.4", - "grunt-contrib-concat": "~0.3.0", - "grunt-contrib-jshint": "~0.8.0", - "universal": "~0.0.5" + "jshint": "^2.9.3", + "aok": "^1.9.0" }, "jshintConfig": { "asi": true, diff --git a/src/index.js b/src/index.js deleted file mode 100644 index 78f1a8e..0000000 --- a/src/index.js +++ /dev/null @@ -1,22 +0,0 @@ -!function(root, name, make) { - if (typeof module != 'undefined' && module.exports) module.exports = make() - else root[name] = make() -}(this, 'eol', function() { - - function converts(to) { - return function(text) { - return text.replace(newline, to) - } - } - - var api = {} - var newline = /\r\n|\r|\n/g - var isWindows = typeof process != 'undefined' && 'win32' === process.platform - - api['lf'] = converts('\n') - api['cr'] = converts('\r') - api['crlf'] = converts('\r\n') - api['auto'] = converts(isWindows ? '\r\n' : '\n') - - return api -}); \ No newline at end of file diff --git a/test/index.js b/test.js similarity index 93% rename from test/index.js rename to test.js index 0ec8da5..213a3c8 100644 --- a/test/index.js +++ b/test.js @@ -1,11 +1,11 @@ -(function(root) { +!function(root) { function contains(str, needle) { return !!~str.indexOf(needle); } var common = typeof module != 'undefined' && !!module.exports; var aok = common ? require('aok') : root.aok; - var eol = common ? require('../src') : root.eol; + var eol = common ? require('./') : root.eol; var platform = typeof process != 'undefined' && process.platform; var meths = ['lf', 'cr', 'crlf', 'auto']; var chars = ['\n', '\r', '\r\n', 'win32' === platform ? '\r\n' : '\n']; @@ -29,4 +29,4 @@ aok('auto agress', 2 === aok.pass(meths, function(method) { return eol.auto(sample) === eol[method](sample); })); -}(this)); \ No newline at end of file +}(this); \ No newline at end of file diff --git a/test/index.html b/test/index.html deleted file mode 100644 index 3e3b7ec..0000000 --- a/test/index.html +++ /dev/null @@ -1,28 +0,0 @@ - -Tests - - -

To run tests

-

Install devDependencies

-
$ npm install
-

Browser: open the console

-

CLI: run tests via grunt aok

-
$ grunt aok
-

To edit tests

-

Edit aok tests in index.js

- - - - \ No newline at end of file From 1d7fbb4daef20b52ee81636c0444b2d052f5ae38 Mon Sep 17 00:00:00 2001 From: Ryan Van Etten Date: Sat, 10 Sep 2016 17:12:35 -0700 Subject: [PATCH 10/24] use string-contains --- package.json | 3 ++- test.js | 11 ++++------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index 68b2520..19c1657 100644 --- a/package.json +++ b/package.json @@ -27,8 +27,9 @@ "url": "https://github.com/ryanve/eol/issues" }, "devDependencies": { + "aok": "^1.9.0", "jshint": "^2.9.3", - "aok": "^1.9.0" + "string-contains": "^0.1.0" }, "jshintConfig": { "asi": true, diff --git a/test.js b/test.js index 213a3c8..af28bb2 100644 --- a/test.js +++ b/test.js @@ -1,16 +1,13 @@ !function(root) { - function contains(str, needle) { - return !!~str.indexOf(needle); - } - var common = typeof module != 'undefined' && !!module.exports; var aok = common ? require('aok') : root.aok; var eol = common ? require('./') : root.eol; + var contains = require('string-contains'); var platform = typeof process != 'undefined' && process.platform; var meths = ['lf', 'cr', 'crlf', 'auto']; var chars = ['\n', '\r', '\r\n', 'win32' === platform ? '\r\n' : '\n']; var sample = ' ' + chars.join() + 'text' + chars.join(); - + aok.fail(meths, function(method, i) { if (!contains('ab', 'a')) return void aok.warn('contains() does not return expected result.'); if (!contains(sample, chars[i])) return void aok.warn('Sample lacks the needed characters.'); @@ -25,8 +22,8 @@ })); return eol.auto(sample) === normalized; }); - + aok('auto agress', 2 === aok.pass(meths, function(method) { return eol.auto(sample) === eol[method](sample); })); -}(this); \ No newline at end of file +}(this); From 74f3e85730585ead12dde8005058baca880b2ac6 Mon Sep 17 00:00:00 2001 From: Ryan Van Etten Date: Sat, 10 Sep 2016 19:08:06 -0700 Subject: [PATCH 11/24] retain test.html --- package.json | 3 +-- test.html | 13 +++++++++++++ test.js | 5 ++++- 3 files changed, 18 insertions(+), 3 deletions(-) create mode 100644 test.html diff --git a/package.json b/package.json index 19c1657..e2fb81d 100644 --- a/package.json +++ b/package.json @@ -28,8 +28,7 @@ }, "devDependencies": { "aok": "^1.9.0", - "jshint": "^2.9.3", - "string-contains": "^0.1.0" + "jshint": "^2.9.3" }, "jshintConfig": { "asi": true, diff --git a/test.html b/test.html new file mode 100644 index 0000000..dea231e --- /dev/null +++ b/test.html @@ -0,0 +1,13 @@ + +Tests + + +

Tests

+

Open the console to view test results + + + + diff --git a/test.js b/test.js index af28bb2..591f957 100644 --- a/test.js +++ b/test.js @@ -1,8 +1,11 @@ !function(root) { + function contains(str, needle) { + return !!~str.indexOf(needle); + } + var common = typeof module != 'undefined' && !!module.exports; var aok = common ? require('aok') : root.aok; var eol = common ? require('./') : root.eol; - var contains = require('string-contains'); var platform = typeof process != 'undefined' && process.platform; var meths = ['lf', 'cr', 'crlf', 'auto']; var chars = ['\n', '\r', '\r\n', 'win32' === platform ? '\r\n' : '\n']; From 14b7c0b32cf361bc5632f9e3deab1405a07b8113 Mon Sep 17 00:00:00 2001 From: Ryan Van Etten Date: Sat, 10 Sep 2016 19:09:48 -0700 Subject: [PATCH 12/24] correctly spell "agrees" --- test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test.js b/test.js index 591f957..4cfad9e 100644 --- a/test.js +++ b/test.js @@ -26,7 +26,7 @@ return eol.auto(sample) === normalized; }); - aok('auto agress', 2 === aok.pass(meths, function(method) { + aok('auto agrees', 2 === aok.pass(meths, function(method) { return eol.auto(sample) === eol[method](sample); })); }(this); From 61183f72936f4dfdd7ba474f3167010e0c5bb57d Mon Sep 17 00:00:00 2001 From: Ryan Van Etten Date: Sat, 10 Sep 2016 19:41:56 -0700 Subject: [PATCH 13/24] rewrite tests --- test.js | 44 +++++++++++++++++++++++++------------------- 1 file changed, 25 insertions(+), 19 deletions(-) diff --git a/test.js b/test.js index 4cfad9e..ea88b1b 100644 --- a/test.js +++ b/test.js @@ -3,30 +3,36 @@ return !!~str.indexOf(needle); } - var common = typeof module != 'undefined' && !!module.exports; - var aok = common ? require('aok') : root.aok; - var eol = common ? require('./') : root.eol; - var platform = typeof process != 'undefined' && process.platform; - var meths = ['lf', 'cr', 'crlf', 'auto']; - var chars = ['\n', '\r', '\r\n', 'win32' === platform ? '\r\n' : '\n']; - var sample = ' ' + chars.join() + 'text' + chars.join(); + var common = typeof module != 'undefined' && !!module.exports + var aok = common ? require('aok') : root.aok + var eol = common ? require('./') : root.eol + var platform = typeof process != 'undefined' && process.platform + var meths = ['lf', 'cr', 'crlf', 'auto'] + var chars = ['\n', '\r', '\r\n', 'win32' === platform ? '\r\n' : '\n'] + var sample = ' ' + chars.join() + 'text' + chars.join() - aok.fail(meths, function(method, i) { - if (!contains('ab', 'a')) return void aok.warn('contains() does not return expected result.'); - if (!contains(sample, chars[i])) return void aok.warn('Sample lacks the needed characters.'); - return true; - }, aok, 1); + aok.prototype.fail = function() { + throw new Error('FAILED TEST: ' + this.id) + } + + aok('contains() sees contained text', contains('ab', 'a') === true) + aok('sample contains newlines', contains(sample, '\n') && contains(sample, '\r')) + aok('returns other strings as is', eol.auto('random') === 'random') + aok('returns empty strings as is', eol.auto('') === '') aok.pass(meths, function(method, i) { - var normalized = eol[method](sample); - aok(method + ' retains', contains(normalized, chars[i])); + var normalized = eol[method](sample) + aok(method + ' retains', contains(normalized, chars[i])) aok(method + ' normalizes', !aok.fail(chars, function(c) { - return contains(chars[i], c) === contains(normalized, c); - })); - return eol.auto(sample) === normalized; - }); + return contains(chars[i], c) === contains(normalized, c) + })) + + return eol.auto(sample) === normalized + }) aok('auto agrees', 2 === aok.pass(meths, function(method) { return eol.auto(sample) === eol[method](sample); - })); + })) + + aok.log('All tests passed =)') }(this); From 326396c3666ce1dee1b69a81e4e7265e0e7acb05 Mon Sep 17 00:00:00 2001 From: Ryan Van Etten Date: Sat, 10 Sep 2016 19:48:17 -0700 Subject: [PATCH 14/24] keywords --- package.json | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/package.json b/package.json index e2fb81d..855fb1b 100644 --- a/package.json +++ b/package.json @@ -8,10 +8,15 @@ "keywords": [ "eol", "newline", + "newlines", "convert", "converter", "conversion", "character", + "formatting", + "format", + "string", + "file", "ender" ], "main": "eol.js", From a9aa478ccb5a3f6871d85ea06b15c9d75b368a53 Mon Sep 17 00:00:00 2001 From: Ryan Van Etten Date: Sat, 10 Sep 2016 20:03:21 -0700 Subject: [PATCH 15/24] add another auto test --- test.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/test.js b/test.js index ea88b1b..05c22e2 100644 --- a/test.js +++ b/test.js @@ -6,9 +6,9 @@ var common = typeof module != 'undefined' && !!module.exports var aok = common ? require('aok') : root.aok var eol = common ? require('./') : root.eol - var platform = typeof process != 'undefined' && process.platform + var isWindows = typeof process != 'undefined' && 'win32' === process.platform var meths = ['lf', 'cr', 'crlf', 'auto'] - var chars = ['\n', '\r', '\r\n', 'win32' === platform ? '\r\n' : '\n'] + var chars = ['\n', '\r', '\r\n', isWindows ? '\r\n' : '\n'] var sample = ' ' + chars.join() + 'text' + chars.join() aok.prototype.fail = function() { @@ -30,9 +30,10 @@ return eol.auto(sample) === normalized }) - aok('auto agrees', 2 === aok.pass(meths, function(method) { + aok('auto is aware', eol[isWindows ? 'crlf' : 'lf'](sample) === eol.auto(sample)) + aok('auto matches only 1 and self', aok.pass(meths, function(method) { return eol.auto(sample) === eol[method](sample); - })) + }) === 2) aok.log('All tests passed =)') }(this); From 43408fd47b67f01a9932961c41e2745cda23f942 Mon Sep 17 00:00:00 2001 From: Ryan Van Etten Date: Sat, 10 Sep 2016 20:30:48 -0700 Subject: [PATCH 16/24] test whitespace and repeat chars --- test.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test.js b/test.js index 05c22e2..87ce78f 100644 --- a/test.js +++ b/test.js @@ -19,6 +19,10 @@ aok('sample contains newlines', contains(sample, '\n') && contains(sample, '\r')) aok('returns other strings as is', eol.auto('random') === 'random') aok('returns empty strings as is', eol.auto('') === '') + aok('whitespace intact', eol.lf(' \t ') === ' \t ') + aok('repeat newlines intact lf', eol.lf('\n\n\r\r') === '\n\n\n\n') + aok('repeat newlines intact lf', eol.cr('\n\n\r\r') === '\r\r\r\r') + aok('repeat newlines intact crlf', eol.crlf('\r\n\r\n') === '\r\n\r\n') aok.pass(meths, function(method, i) { var normalized = eol[method](sample) From f0fc109f68ee23c736f3636f1f6e875dfd3c6827 Mon Sep 17 00:00:00 2001 From: Ryan Van Etten Date: Sat, 10 Sep 2016 20:32:45 -0700 Subject: [PATCH 17/24] lint via npm pretest hook --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 855fb1b..3ed47cd 100644 --- a/package.json +++ b/package.json @@ -21,8 +21,8 @@ ], "main": "eol.js", "scripts": { - "lint": "jshint eol.js && jshint test.js", - "test": "npm run lint && node test.js" + "pretest": "jshint eol.js && jshint test.js", + "test": "node test.js" }, "repository": { "type": "git", From 2b8cdda09817c8e3055c061139f70ad5babf0bf0 Mon Sep 17 00:00:00 2001 From: Ryan Van Etten Date: Sat, 10 Sep 2016 20:33:50 -0700 Subject: [PATCH 18/24] correct cr repeat test id --- test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test.js b/test.js index 87ce78f..78beed4 100644 --- a/test.js +++ b/test.js @@ -21,7 +21,7 @@ aok('returns empty strings as is', eol.auto('') === '') aok('whitespace intact', eol.lf(' \t ') === ' \t ') aok('repeat newlines intact lf', eol.lf('\n\n\r\r') === '\n\n\n\n') - aok('repeat newlines intact lf', eol.cr('\n\n\r\r') === '\r\r\r\r') + aok('repeat newlines intact cr', eol.cr('\n\n\r\r') === '\r\r\r\r') aok('repeat newlines intact crlf', eol.crlf('\r\n\r\n') === '\r\n\r\n') aok.pass(meths, function(method, i) { From b1964e8422bfaac971f2bb09f6ccf5b74bed4f89 Mon Sep 17 00:00:00 2001 From: Ryan Van Etten Date: Sat, 10 Sep 2016 20:34:44 -0700 Subject: [PATCH 19/24] reword repeat tests --- test.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test.js b/test.js index 78beed4..000b069 100644 --- a/test.js +++ b/test.js @@ -20,9 +20,9 @@ aok('returns other strings as is', eol.auto('random') === 'random') aok('returns empty strings as is', eol.auto('') === '') aok('whitespace intact', eol.lf(' \t ') === ' \t ') - aok('repeat newlines intact lf', eol.lf('\n\n\r\r') === '\n\n\n\n') - aok('repeat newlines intact cr', eol.cr('\n\n\r\r') === '\r\r\r\r') - aok('repeat newlines intact crlf', eol.crlf('\r\n\r\n') === '\r\n\r\n') + aok('lf repeat newlines intact', eol.lf('\n\n\r\r') === '\n\n\n\n') + aok('cr repeat newlines intact', eol.cr('\n\n\r\r') === '\r\r\r\r') + aok('crlf repeat newlines intact', eol.crlf('\r\n\r\n') === '\r\n\r\n') aok.pass(meths, function(method, i) { var normalized = eol[method](sample) From 1846a4e066eb32c2637b214138b28418320c50a1 Mon Sep 17 00:00:00 2001 From: Ryan Van Etten Date: Sat, 10 Sep 2016 20:35:32 -0700 Subject: [PATCH 20/24] reword contains test --- test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test.js b/test.js index 000b069..7f03a62 100644 --- a/test.js +++ b/test.js @@ -15,7 +15,7 @@ throw new Error('FAILED TEST: ' + this.id) } - aok('contains() sees contained text', contains('ab', 'a') === true) + aok('contains sees contained text', contains('ab', 'a') === true) aok('sample contains newlines', contains(sample, '\n') && contains(sample, '\r')) aok('returns other strings as is', eol.auto('random') === 'random') aok('returns empty strings as is', eol.auto('') === '') From 52132520cb4a1d2a3ef0027a88146432a2b79b14 Mon Sep 17 00:00:00 2001 From: Ryan Van Etten Date: Sat, 10 Sep 2016 20:41:14 -0700 Subject: [PATCH 21/24] add LICENSE file --- LICENSE | 19 +++++++++++++++++++ README.md | 3 +-- 2 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..9cf1062 --- /dev/null +++ b/LICENSE @@ -0,0 +1,19 @@ +MIT License + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md index f2254c2..f95b962 100644 --- a/README.md +++ b/README.md @@ -20,5 +20,4 @@ - @return string with line endings normalized to `\r` ## License - -[MIT](package.json#L6-L7) \ No newline at end of file +MIT \ No newline at end of file From 1c931300da2e9ba5374694979d31e4d9859da796 Mon Sep 17 00:00:00 2001 From: Ryan Van Etten Date: Sat, 10 Sep 2016 20:42:56 -0700 Subject: [PATCH 22/24] add lang attr --- test.html | 1 + 1 file changed, 1 insertion(+) diff --git a/test.html b/test.html index dea231e..4941ff0 100644 --- a/test.html +++ b/test.html @@ -1,4 +1,5 @@ + Tests