From bc5758edf2cffd4a1c9a1c8aa2e3430ab38fc27b Mon Sep 17 00:00:00 2001 From: Piotr Kowalczuk Date: Fri, 16 May 2014 17:05:13 +0200 Subject: [PATCH 1/7] Remote validator. --- README.md | 18 +++++++++- lib/fields.js | 1 - lib/forms.js | 23 +++++++++++-- test/test-form.js | 87 ++++++++++++++++++++++++++++++++++++++++++++++- 4 files changed, 124 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 19739a5..366bbcb 100644 --- a/README.md +++ b/README.md @@ -123,7 +123,6 @@ For integrating with Twitter bootstrap 3 (horizontal form), this is what you nee }); var bootstrapField = function (name, object) { - object.widget.classes = object.widget.classes || []; object.widget.classes.push('form-control'); @@ -217,6 +216,23 @@ Forms can be created with an optional "options" object as well. * `validatePastFirstError`: `true`, otherwise assumes `false` * If `false`, the first validation error will halt form validation. * If `true`, all fields will be validated. +* `remoteValidator`: function that returns an object of validation, eg by making the http request. If it is defined fields validation will be ignored. An example: + + ``` + var remoteValidator = function(data, next) { + var response = { + field1: { + error: 'validation error 1', + value: 'wrongInput1' + }, + field2: { + error: 'validation error 2', + value: 'wrongInput2' + } + }; + next(response); + } + ``` ### Form object diff --git a/lib/fields.js b/lib/fields.js index 49e1fba..7b3e4a9 100644 --- a/lib/fields.js +++ b/lib/fields.js @@ -187,4 +187,3 @@ exports.date = function (opt) { exports.object = function (fields, opts) { return forms.create(fields || {}); }; - diff --git a/lib/forms.js b/lib/forms.js index 0d12d71..14188c1 100644 --- a/lib/forms.js +++ b/lib/forms.js @@ -32,6 +32,8 @@ exports.create = function (fields, opts) { var b = {}; b.toHTML = f.toHTML; b.fields = {}; + b.remoteValidator = f.remoteValidator; + Object.keys(f.fields).forEach(function (k) { if (data != null) { b.fields[k] = f.fields[k].bind(data[k]); @@ -41,12 +43,29 @@ exports.create = function (fields, opts) { a[k] = b.fields[k].data; return a; }, {}); + b.remoteValidatorCallback = function (response) { + var form = b; + for (var fieldName in form.fields) { + if (form.fields.hasOwnProperty(fieldName)) { + form.fields[fieldName].error = response[fieldName].error; + form.fields[fieldName].value = response[fieldName].value; + } + } + }; b.validate = function (obj, callback) { if (arguments.length === 1) { obj = callback; callback = arguments[0]; } + if(b.remoteValidator) { + b.remoteValidator(b.data, (function(b) { + return b.remoteValidatorCallback + })(b)); + callback(null, b); + return; + } + async.forEach(Object.keys(b.fields), function (k, callback) { b.fields[k].validate(b, function (err, bound_field) { b.fields[k] = bound_field; @@ -111,8 +130,8 @@ exports.create = function (fields, opts) { var kname = is.string(name) ? name + '[' + k + ']' : k; return html + form.fields[k].toHTML(kname, iterator); }, ''); - } + }, + remoteValidator: opts.remoteValidator }; return f; }; - diff --git a/test/test-form.js b/test/test-form.js index 8f9cb39..2457f30 100644 --- a/test/test-form.js +++ b/test/test-form.js @@ -151,6 +151,92 @@ test('validate invalid data', function (t) { }); }); +test('validate valid data with remote validator', function (t) { + t.plan(2); + var fields = { + field1: forms.fields.string(), + field2: forms.fields.string() + }; + + var options = { + remoteValidator: function(data, next) { + var response = { + field1: { + error: '', + value: 'field1 value' + }, + field2: { + error: '', + value: 'field2 value' + } + }; + next(response); + } + }; + + var f = forms.create(fields, options); + + f.bind({field1: '1', field2: '2'}).validate(function (err, f) { + t.equal(f.isValid(), false); + t.equal( + f.toHTML(), + '
' + + '' + + '' + + '
' + + '
' + + '' + + '' + + '
' + ); + t.end(); + }); +}); + +test('validate invalid data with remote validator', function (t) { + t.plan(2); + var fields = { + field1: forms.fields.string(), + field2: forms.fields.string() + }; + + var options = { + remoteValidator: function(data, next) { + var response = { + field1: { + error: 'validation error 1', + value: 'wrongInput1' + }, + field2: { + error: 'validation error 2', + value: 'wrongInput2' + } + }; + next(response); + } + }; + + var f = forms.create(fields, options); + + f.bind({field1: '1', field2: '2'}).validate(function (err, f) { + t.equal(f.isValid(), false); + t.equal( + f.toHTML(), + '
' + + '

validation error 1

' + + '' + + '' + + '
' + + '
' + + '

validation error 2

' + + '' + + '' + + '
' + ); + t.end(); + }); +}); + test('handle empty', function (t) { t.plan(3); var f = forms.create({field1: forms.fields.string()}); @@ -444,4 +530,3 @@ test('div bound error', function (t) { t.end(); }); }); - From c215306ef13b38253bb15f067664a049a7fdc9d1 Mon Sep 17 00:00:00 2001 From: Piotr Kowalczuk Date: Sat, 17 May 2014 18:27:58 +0200 Subject: [PATCH 2/7] Async remote validator fix. --- lib/forms.js | 19 ++++++++----------- test/test-form.js | 48 +++++++++++++++++++++++++---------------------- 2 files changed, 34 insertions(+), 33 deletions(-) diff --git a/lib/forms.js b/lib/forms.js index 14188c1..3f66e8c 100644 --- a/lib/forms.js +++ b/lib/forms.js @@ -43,15 +43,6 @@ exports.create = function (fields, opts) { a[k] = b.fields[k].data; return a; }, {}); - b.remoteValidatorCallback = function (response) { - var form = b; - for (var fieldName in form.fields) { - if (form.fields.hasOwnProperty(fieldName)) { - form.fields[fieldName].error = response[fieldName].error; - form.fields[fieldName].value = response[fieldName].value; - } - } - }; b.validate = function (obj, callback) { if (arguments.length === 1) { obj = callback; @@ -60,9 +51,15 @@ exports.create = function (fields, opts) { if(b.remoteValidator) { b.remoteValidator(b.data, (function(b) { - return b.remoteValidatorCallback + return function (err, response) { + var form = b; + Object.keys(form.fields).forEach(function (fieldName) { + form.fields[fieldName].error = response[fieldName].error; + form.fields[fieldName].value = response[fieldName].value; + }); + callback(err, form); + }; })(b)); - callback(null, b); return; } diff --git a/test/test-form.js b/test/test-form.js index 2457f30..5ed050e 100644 --- a/test/test-form.js +++ b/test/test-form.js @@ -160,17 +160,19 @@ test('validate valid data with remote validator', function (t) { var options = { remoteValidator: function(data, next) { - var response = { - field1: { - error: '', - value: 'field1 value' - }, - field2: { - error: '', - value: 'field2 value' - } - }; - next(response); + setTimeout(function() { + var response = { + field1: { + error: '', + value: 'field1 value' + }, + field2: { + error: '', + value: 'field2 value' + } + }; + next(null, response); + }, 100); } }; @@ -202,17 +204,19 @@ test('validate invalid data with remote validator', function (t) { var options = { remoteValidator: function(data, next) { - var response = { - field1: { - error: 'validation error 1', - value: 'wrongInput1' - }, - field2: { - error: 'validation error 2', - value: 'wrongInput2' - } - }; - next(response); + setTimeout(function() { + var response = { + field1: { + error: 'validation error 1', + value: 'wrongInput1' + }, + field2: { + error: 'validation error 2', + value: 'wrongInput2' + } + }; + next(null, response); + }, 100); } }; From fb9c08ef8386bbe961b95350c0b1477f7de2cd8a Mon Sep 17 00:00:00 2001 From: Piotr Kowalczuk Date: Sat, 17 May 2014 18:38:17 +0200 Subject: [PATCH 3/7] Readme file update, new remote validator example. --- README.md | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 366bbcb..2b0793e 100644 --- a/README.md +++ b/README.md @@ -220,18 +220,20 @@ Forms can be created with an optional "options" object as well. ``` var remoteValidator = function(data, next) { - var response = { - field1: { - error: 'validation error 1', - value: 'wrongInput1' - }, - field2: { - error: 'validation error 2', - value: 'wrongInput2' - } - }; - next(response); - } + var error = null; + var response = { + field1: { + error: 'validation error 1', + value: 'wrongInput1' + }, + field2: { + error: 'validation error 2', + value: 'wrongInput2' + } + }; + + next(err, response); + }; ``` @@ -385,4 +387,3 @@ containing a HTML representation of the field. [7]: https://nodei.co/npm/forms.png?downloads=true&stars=true [8]: https://npmjs.org/package/forms [9]: http://vb.teelaun.ch/caolan/forms.svg - From 471b3c99007d222c089f80705b8c9d3d6afce6ab Mon Sep 17 00:00:00 2001 From: Piotr Kowalczuk Date: Sat, 17 May 2014 22:07:48 +0200 Subject: [PATCH 4/7] Remote validator and regular validators can work together. --- README.md | 10 +++++----- lib/forms.js | 28 +++++++++++++--------------- test/test-form.js | 6 +++--- 3 files changed, 21 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index 2b0793e..90569bf 100644 --- a/README.md +++ b/README.md @@ -216,19 +216,19 @@ Forms can be created with an optional "options" object as well. * `validatePastFirstError`: `true`, otherwise assumes `false` * If `false`, the first validation error will halt form validation. * If `true`, all fields will be validated. -* `remoteValidator`: function that returns an object of validation, eg by making the http request. If it is defined fields validation will be ignored. An example: +* `remoteValidator`: function that returns an object of validation, eg by making the http request. An example: ``` var remoteValidator = function(data, next) { var error = null; var response = { field1: { - error: 'validation error 1', - value: 'wrongInput1' + error: 'validation message', + value: 'invalid value' }, field2: { - error: 'validation error 2', - value: 'wrongInput2' + error: null, + value: 'valid value' } }; diff --git a/lib/forms.js b/lib/forms.js index 3f66e8c..a9b586d 100644 --- a/lib/forms.js +++ b/lib/forms.js @@ -49,27 +49,25 @@ exports.create = function (fields, opts) { callback = arguments[0]; } - if(b.remoteValidator) { - b.remoteValidator(b.data, (function(b) { - return function (err, response) { - var form = b; - Object.keys(form.fields).forEach(function (fieldName) { - form.fields[fieldName].error = response[fieldName].error; - form.fields[fieldName].value = response[fieldName].value; - }); - callback(err, form); - }; - })(b)); - return; - } - async.forEach(Object.keys(b.fields), function (k, callback) { b.fields[k].validate(b, function (err, bound_field) { b.fields[k] = bound_field; callback(validatePastFirstError ? null : err); }); }, function (err) { - callback(err, b); + if(b.remoteValidator) { + b.remoteValidator(b.data, (function(form) { + return function (err, response) { + Object.keys(form.fields).forEach(function (fieldName) { + form.fields[fieldName].error = response[fieldName].error; + form.fields[fieldName].value = response[fieldName].value; + }); + callback(err, form); + }; + })(b)); + } else { + callback(err, b); + } }); }; b.isValid = function () { diff --git a/test/test-form.js b/test/test-form.js index 5ed050e..c5d8e3f 100644 --- a/test/test-form.js +++ b/test/test-form.js @@ -163,11 +163,11 @@ test('validate valid data with remote validator', function (t) { setTimeout(function() { var response = { field1: { - error: '', + error: null, value: 'field1 value' }, field2: { - error: '', + error: null, value: 'field2 value' } }; @@ -179,7 +179,7 @@ test('validate valid data with remote validator', function (t) { var f = forms.create(fields, options); f.bind({field1: '1', field2: '2'}).validate(function (err, f) { - t.equal(f.isValid(), false); + t.equal(f.isValid(), true); t.equal( f.toHTML(), '
' + From 90433707fda7595523532d0475bb639cd2270f1a Mon Sep 17 00:00:00 2001 From: Piotr Kowalczuk Date: Sun, 25 May 2014 13:54:57 +0200 Subject: [PATCH 5/7] Form validators option, async form validator. --- README.md | 52 ++++++++++++++++++++++++------------ lib/forms.js | 26 +++++++++--------- lib/validators.js | 13 ++++++++- test/test-form.js | 58 ++++++++++++++++++----------------------- test/test-validators.js | 39 +++++++++++++++++++++++++++ 5 files changed, 125 insertions(+), 63 deletions(-) diff --git a/README.md b/README.md index 90569bf..db2ba65 100644 --- a/README.md +++ b/README.md @@ -172,7 +172,7 @@ components following the same API. * multipleSelect * label -### Validators +### Field validators * matchField * matchValue @@ -193,6 +193,10 @@ components following the same API. * digits * integer +### Form validators + +* async + ### Renderers * div @@ -216,24 +220,40 @@ Forms can be created with an optional "options" object as well. * `validatePastFirstError`: `true`, otherwise assumes `false` * If `false`, the first validation error will halt form validation. * If `true`, all fields will be validated. -* `remoteValidator`: function that returns an object of validation, eg by making the http request. An example: +* `validators`: form validators. An example: ``` - var remoteValidator = function(data, next) { - var error = null; - var response = { - field1: { - error: 'validation message', - value: 'invalid value' - }, - field2: { - error: null, - value: 'valid value' - } - }; + var forms = require('forms'), + fields = forms.fields, + validators = forms.validators; - next(err, response); + var options = { + validators = [ + validators.async(function(data, next) { + + // eg. post request. + + var err = null; + var response = { + username: { + error: 'User with that name already exists.', + value: 'qwe' + }, + password: { + error: 'Password is to short.', + value: 123 + } + }; + + next(err, response); + }) + ] }; + + var reg_form = forms.create({ + username: fields.string(), + password: fields.password() + }, options); ``` @@ -365,7 +385,7 @@ Returns a string containing a HTML representation of the widget for the given field. -### Validator +### Field Validator A function that accepts a bound form, bound field and a callback as arguments. It should apply a test to the field to assert its validity. Once processing diff --git a/lib/forms.js b/lib/forms.js index a9b586d..719f231 100644 --- a/lib/forms.js +++ b/lib/forms.js @@ -32,7 +32,7 @@ exports.create = function (fields, opts) { var b = {}; b.toHTML = f.toHTML; b.fields = {}; - b.remoteValidator = f.remoteValidator; + b.validators = f.validators || []; Object.keys(f.fields).forEach(function (k) { if (data != null) { @@ -55,19 +55,17 @@ exports.create = function (fields, opts) { callback(validatePastFirstError ? null : err); }); }, function (err) { - if(b.remoteValidator) { - b.remoteValidator(b.data, (function(form) { - return function (err, response) { - Object.keys(form.fields).forEach(function (fieldName) { - form.fields[fieldName].error = response[fieldName].error; - form.fields[fieldName].value = response[fieldName].value; - }); - callback(err, form); - }; - })(b)); - } else { - callback(err, b); + if(err) { + return callback(err, b); } + + async.forEach(b.validators, function(validator, callback) { + validator(b, function(err) { + callback(validatePastFirstError ? null : err); + }); + }, function(err) { + callback(err, b); + }); }); }; b.isValid = function () { @@ -126,7 +124,7 @@ exports.create = function (fields, opts) { return html + form.fields[k].toHTML(kname, iterator); }, ''); }, - remoteValidator: opts.remoteValidator + validators: opts.validators }; return f; }; diff --git a/lib/validators.js b/lib/validators.js index dceec16..35b5bd0 100644 --- a/lib/validators.js +++ b/lib/validators.js @@ -61,6 +61,18 @@ exports.required = function (message) { }; }; +exports.async = function (asyncFunction) { + return function(form, callback) { + asyncFunction(form.data, function(err, response) { + Object.keys(form.fields).forEach(function (fieldName) { + form.fields[fieldName].error = response[fieldName].error; + form.fields[fieldName].value = response[fieldName].value; + }); + callback(err, form); + }); + }; +}; + exports.requiresFieldIfEmpty = function (alternate_field, message) { if (!message) { message = 'One of %s or %s is required.'; } var validator = function (form, field, callback) { @@ -210,4 +222,3 @@ exports.digits = function (message) { exports.integer = function (message) { return exports.regexp(/^-?\d+$/, message || 'Please enter an integer value.'); }; - diff --git a/test/test-form.js b/test/test-form.js index c5d8e3f..1b90977 100644 --- a/test/test-form.js +++ b/test/test-form.js @@ -151,7 +151,7 @@ test('validate invalid data', function (t) { }); }); -test('validate valid data with remote validator', function (t) { +test('validate valid data with form validator', function (t) { t.plan(2); var fields = { field1: forms.fields.string(), @@ -159,21 +159,18 @@ test('validate valid data with remote validator', function (t) { }; var options = { - remoteValidator: function(data, next) { - setTimeout(function() { - var response = { - field1: { - error: null, - value: 'field1 value' - }, - field2: { - error: null, - value: 'field2 value' - } - }; - next(null, response); - }, 100); - } + validators: [ + function(form, next) { + setTimeout(function() { + form.fields.field1.value = 'field1 value'; + form.fields.field1.error = null; + form.fields.field2.value = 'field2 value'; + form.fields.field2.error = null; + + next(null, form); + }, 100); + } + ] }; var f = forms.create(fields, options); @@ -195,7 +192,7 @@ test('validate valid data with remote validator', function (t) { }); }); -test('validate invalid data with remote validator', function (t) { +test('validate invalid data with form validator', function (t) { t.plan(2); var fields = { field1: forms.fields.string(), @@ -203,21 +200,18 @@ test('validate invalid data with remote validator', function (t) { }; var options = { - remoteValidator: function(data, next) { - setTimeout(function() { - var response = { - field1: { - error: 'validation error 1', - value: 'wrongInput1' - }, - field2: { - error: 'validation error 2', - value: 'wrongInput2' - } - }; - next(null, response); - }, 100); - } + validators: [ + function(form, next) { + setTimeout(function() { + form.fields.field1.value = 'wrongInput1'; + form.fields.field1.error = 'validation error 1'; + form.fields.field2.value = 'wrongInput2'; + form.fields.field2.error = 'validation error 2'; + + next(null, form); + }, 100); + } + ] }; var f = forms.create(fields, options); diff --git a/test/test-validators.js b/test/test-validators.js index d6429a5..99e744d 100644 --- a/test/test-validators.js +++ b/test/test-validators.js @@ -427,3 +427,42 @@ test('digits', function (t) { t.end(); }); +test('async', function (t) { + t.test('validator should process response to form object properly', function (st) { + var data = { + fields: { + field1: {data: 'invalid value'}, + field2: {data: 'valid value'} + } + }; + + var asyncFunction = function(data, next) { + var err = null; + var response = { + field1: { + error: 'validation message', + value: 'invalid value' + }, + field2: { + error: null, + value: 'valid value' + } + }; + + next(err, response); + }; + + var v = validators.async(asyncFunction); + st.plan(4); + v(data, function (err, form) { + st.equal(form.fields.field1.error, 'validation message'); + st.equal(form.fields.field1.value, 'invalid value'); + st.equal(form.fields.field2.error, null); + st.equal(form.fields.field2.value, 'valid value'); + + st.end(); + }); + }); + + t.end(); +}); From ae67dae043e90c265f27d808ed402a5a88293bbd Mon Sep 17 00:00:00 2001 From: Piotr Kowalczuk Date: Sun, 25 May 2014 14:05:25 +0200 Subject: [PATCH 6/7] jscs fix --- lib/forms.js | 8 ++++---- lib/validators.js | 4 ++-- test/test-form.js | 8 ++++---- test/test-validators.js | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/lib/forms.js b/lib/forms.js index 719f231..058ee1e 100644 --- a/lib/forms.js +++ b/lib/forms.js @@ -55,15 +55,15 @@ exports.create = function (fields, opts) { callback(validatePastFirstError ? null : err); }); }, function (err) { - if(err) { + if (err) { return callback(err, b); } - async.forEach(b.validators, function(validator, callback) { - validator(b, function(err) { + async.forEach(b.validators, function (validator, callback) { + validator(b, function (err) { callback(validatePastFirstError ? null : err); }); - }, function(err) { + }, function (err) { callback(err, b); }); }); diff --git a/lib/validators.js b/lib/validators.js index 35b5bd0..6630694 100644 --- a/lib/validators.js +++ b/lib/validators.js @@ -62,8 +62,8 @@ exports.required = function (message) { }; exports.async = function (asyncFunction) { - return function(form, callback) { - asyncFunction(form.data, function(err, response) { + return function (form, callback) { + asyncFunction(form.data, function (err, response) { Object.keys(form.fields).forEach(function (fieldName) { form.fields[fieldName].error = response[fieldName].error; form.fields[fieldName].value = response[fieldName].value; diff --git a/test/test-form.js b/test/test-form.js index 1b90977..a77c1df 100644 --- a/test/test-form.js +++ b/test/test-form.js @@ -160,8 +160,8 @@ test('validate valid data with form validator', function (t) { var options = { validators: [ - function(form, next) { - setTimeout(function() { + function (form, next) { + setTimeout(function () { form.fields.field1.value = 'field1 value'; form.fields.field1.error = null; form.fields.field2.value = 'field2 value'; @@ -201,8 +201,8 @@ test('validate invalid data with form validator', function (t) { var options = { validators: [ - function(form, next) { - setTimeout(function() { + function (form, next) { + setTimeout(function () { form.fields.field1.value = 'wrongInput1'; form.fields.field1.error = 'validation error 1'; form.fields.field2.value = 'wrongInput2'; diff --git a/test/test-validators.js b/test/test-validators.js index 99e744d..67560d6 100644 --- a/test/test-validators.js +++ b/test/test-validators.js @@ -436,7 +436,7 @@ test('async', function (t) { } }; - var asyncFunction = function(data, next) { + var asyncFunction = function (data, next) { var err = null; var response = { field1: { From f1f39eb55ac2ad01c56d43259744bbcd48232962 Mon Sep 17 00:00:00 2001 From: Piotr Kowalczuk Date: Wed, 28 May 2014 18:33:41 +0200 Subject: [PATCH 7/7] Trailing lines fix. --- .idea/encodings.xml | 5 +++++ .idea/forms.iml | 9 +++++++++ .idea/misc.xml | 22 ++++++++++++++++++++++ .idea/modules.xml | 9 +++++++++ .idea/scopes/scope_settings.xml | 5 +++++ .idea/vcs.xml | 7 +++++++ LICENSE | 1 - index.js | 1 - lib/htmlEscape.js | 1 - lib/render.js | 1 - lib/tag.js | 1 - lib/widgets.js | 1 - test-browser.js | 1 - 13 files changed, 57 insertions(+), 7 deletions(-) create mode 100644 .idea/encodings.xml create mode 100644 .idea/forms.iml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/scopes/scope_settings.xml create mode 100644 .idea/vcs.xml diff --git a/.idea/encodings.xml b/.idea/encodings.xml new file mode 100644 index 0000000..e206d70 --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/.idea/forms.iml b/.idea/forms.iml new file mode 100644 index 0000000..6b8184f --- /dev/null +++ b/.idea/forms.iml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..d16ceba --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,22 @@ + + + + + + + diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..0443700 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/.idea/scopes/scope_settings.xml b/.idea/scopes/scope_settings.xml new file mode 100644 index 0000000..922003b --- /dev/null +++ b/.idea/scopes/scope_settings.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..c80f219 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/LICENSE b/LICENSE index 485b34a..b7f9d50 100644 --- a/LICENSE +++ b/LICENSE @@ -17,4 +17,3 @@ 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/index.js b/index.js index b7ab242..535c6b9 100644 --- a/index.js +++ b/index.js @@ -1,4 +1,3 @@ // This file is just added for convenience so this repository can be // directly checked out into a project's deps folder module.exports = require('./lib/forms'); - diff --git a/lib/htmlEscape.js b/lib/htmlEscape.js index cff3246..d21fa11 100644 --- a/lib/htmlEscape.js +++ b/lib/htmlEscape.js @@ -28,4 +28,3 @@ module.exports = (function () { return htmlEscape; }()); - diff --git a/lib/render.js b/lib/render.js index a2d67cc..62b70c2 100644 --- a/lib/render.js +++ b/lib/render.js @@ -52,4 +52,3 @@ exports.table = function (name, field, opt) { return tag('tr', { classes: field.classes() }, th + td); }; - diff --git a/lib/tag.js b/lib/tag.js index 73d0a3a..76be98c 100644 --- a/lib/tag.js +++ b/lib/tag.js @@ -59,4 +59,3 @@ var tag = function tag(tagName, attrsMap, content) { tag.attrs = attrs; module.exports = tag; - diff --git a/lib/widgets.js b/lib/widgets.js index 0206e78..f89659f 100644 --- a/lib/widgets.js +++ b/lib/widgets.js @@ -246,4 +246,3 @@ exports.multipleSelect = function (opt) { }; return w; }; - diff --git a/test-browser.js b/test-browser.js index 415d61c..b1d3a42 100755 --- a/test-browser.js +++ b/test-browser.js @@ -8,4 +8,3 @@ // require('./test/test-validators'); // disabled until this unicode fix is merged: https://github.com/substack/testling/pull/35 require('./test/test-widgets'); }()); -