+122
| 0.4.1 / 2014-04-24 | ||
| ================== | ||
| * Updating dependencies | ||
| * Adding digits and integer validators | ||
| 0.4.0 / 2014-04-07 | ||
| ================== | ||
| * Using https URLs in package.json | ||
| * Updating async and tape. | ||
| * Using `is` to check for things | ||
| * Using better tape matchers, and `is` functions | ||
| * Merge pull request [#107](https://github.com/caolan/forms/issues/107) from timjrobinson/nested_fields_fix_fix | ||
| Fixed bug where .bind with incomplete data was removing fields from form. | ||
| * Fixed bug where if you bind data to a form fields that were missing from the data were being removed from the form. | ||
| * Adding `npm run coverage` | ||
| * Merge pull request [#106](https://github.com/caolan/forms/issues/106) from timjrobinson/nested_fields_fix | ||
| Fixed null object error when a nested form is submitted but one of the subsections is missing. | ||
| * Fixed null pointer error when a nested form is submitted but one of the subsections is missing. | ||
| * Adding another matchValue test. | ||
| * Fixing whitespace; a bit of cleanup. | ||
| * Add plan statements, and using the "t" convention inside tests. | ||
| * Adding a matchValue validator. | ||
| Relates to [#82](https://github.com/caolan/forms/issues/82). | ||
| * Removing the express example, primarily because it doesn't work with express 3. Also, the dependency stuff is weird. | ||
| This should go in a separate repo rather than living inside `forms`. | ||
| Closes [#93](https://github.com/caolan/forms/issues/93). Relates to [#105](https://github.com/caolan/forms/issues/105). | ||
| * Merge pull request [#99](https://github.com/caolan/forms/issues/99) from Flaise/master | ||
| Made `%s` string formatting tokens optional in field validator error messages. | ||
| * Oops! Make sure we're running all tests | ||
| * Made `%s` string formatting tokens optional in field validator error messages. | ||
| * Add number widget. | ||
| From [#83](https://github.com/caolan/forms/issues/83). | ||
| * Pass an enctype in the simple example | ||
| * Updating json-template. | ||
| Note: it can't be installed from npm because the package.json is invalid. | ||
| * Merge pull request [#101](https://github.com/caolan/forms/issues/101) from caolan/use_tape_for_tests | ||
| Use tape for tests | ||
| * Converting tests over to tape instead of nodeunit. | ||
| * Using tape for tests instead. | ||
| * Adding "alphanumeric" to README, per [#98](https://github.com/caolan/forms/issues/98) | ||
| * Merge pull request [#98](https://github.com/caolan/forms/issues/98) from Flaise/master | ||
| Added alphanumeric validator for convenience. | ||
| * Added alphanumeric validator for convenience. | ||
| * Updating deps | ||
| * Updating dev deps | ||
| * Merge pull request [#92](https://github.com/caolan/forms/issues/92) from shinnn/master | ||
| Replace "!!!" with "doctype" | ||
| * Replace "!!!" with "doctype" | ||
| * Merge pull request [#91](https://github.com/caolan/forms/issues/91) from kukulili-labs/master | ||
| Add optional "tabindex"attribute to widgets | ||
| * Fix test | ||
| * Add optional "tabindex"attribute to widgets | ||
| * Updating browserify | ||
| * Remove node 0.6 workaround; test down to node 0.4 | ||
| * Adding `is` | ||
| * Merge pull request [#89](https://github.com/caolan/forms/issues/89) from timjrobinson/label-text | ||
| Made label text for camel case or dash separated field names format nicely | ||
| * Updating dependencies | ||
| * Renaming variables. | ||
| * Made label text for camel case or dash separated field names format nicely. | ||
| * Make the complex example use POST and be multipart-encoded. | ||
| * Use formidable to handle multipart-encoded form data. | ||
| * HTML attributes should be double quoted. | ||
| * Pass the method into the example template. | ||
| * submit buttons are so much better than submit inputs. | ||
| * Test in node 0.11 too | ||
| * Unset strict SSL for node 0.6 in Travis-CI | ||
| * Rearranging badges | ||
| * Adding npm badge and version svg. | ||
| * Updating browserify. | ||
| * Merge branch 'required_validator'. Closes [#81](https://github.com/caolan/forms/issues/81). | ||
| * Use String() instead of the toString prototype method. | ||
| * When the "required" option is true, use the default "required" validator. Otherwise, use the passed-in validator. | ||
| * Adding a "required" validator. | ||
| * Upgrading browserify. | ||
| 0.3.0 / 2013-09-16 | ||
| ================== | ||
| * v0.3.0 | ||
| * Merge pull request [#80](https://github.com/caolan/forms/issues/80) from path/dynamic-widget-attributes | ||
| Add support for dynamic widget attributes | ||
| * Add support for dynamic widget attributes | ||
| Sometimes it is desirable to set widget attributes after the form is | ||
| created. This makes it possible and should be fully backwards | ||
| compatible. | ||
| * Adding dev dependency badge. | ||
| * Rearranging dependencies. | ||
| * s/\t/ /g | ||
| * Merge branch 'nested_fields_merge' - merges [#77](https://github.com/caolan/forms/issues/77), fixes [#11](https://github.com/caolan/forms/issues/11) | ||
| * Using arguments.length to shift arguments. | ||
| * Adding spacing. | ||
| * Reverting this line. | ||
| * Bumping dev deps. | ||
| * Adding a trailing newline. | ||
| * Adding a nested example. | ||
| * Merge pull request [#77](https://github.com/caolan/forms/issues/77) | ||
| 0.2.3 / 2013-08-25 | ||
| ================== | ||
| * v0.2.3 | ||
| * Adding testling browsers. | ||
| * style corrections | ||
| * Adding Travis CI info to the README. Closes [#42](https://github.com/caolan/forms/issues/42). | ||
| * Fixing indentation. | ||
| * Fixing a syntax error. | ||
| * Reusing some common placeholder functions in these tests. | ||
| * Fixing a bug in my port of the String#trim shim, and cleaning it up a bit. | ||
| * Moving a misplaced semicolon. | ||
| * Moving this logic up into the closure. | ||
| * Combining var declarations. | ||
| * Removing arbitrary line breaks. | ||
| * Making sure "use strict" is always inside a function. | ||
| * Merge pull request [#78](https://github.com/caolan/forms/issues/78) from caolan/either_or | ||
| Adds "requiresFieldIfEmpty" validator | ||
| * Adding requiresFieldIfEmpty validator. | ||
| * If any field validator functions have a forceValidation property set, validate even when empty. | ||
| * take object literals as nested fields | ||
| * Adding ES5's String#trim | ||
| * Removing an extra space | ||
| * compatibility |
Sorry, the diff of this file is not supported yet
+10
-0
@@ -5,5 +5,15 @@ language: node_js | ||
| - "0.10" | ||
| - "0.9" | ||
| - "0.8" | ||
| - "0.6" | ||
| - "0.4" | ||
| before_install: | ||
| - '[ "${TRAVIS_NODE_VERSION}" == "0.6" ] || npm install -g npm@~1.4.6' | ||
| matrix: | ||
| fast_finish: true | ||
| allow_failures: | ||
| - node_js: "0.11" | ||
| - node_js: "0.9" | ||
| - node_js: "0.6" | ||
| - node_js: "0.4" | ||
@@ -206,1 +206,9 @@ /*jslint node: true */ | ||
| exports.digits = function (message) { | ||
| return exports.regexp(/^\d+$/, message || 'Numbers only.'); | ||
| }; | ||
| exports.integer = function (message) { | ||
| return exports.regexp(/^-?\d+$/, message || 'Please enter an integer value.'); | ||
| }; | ||
+2
-2
@@ -6,3 +6,3 @@ { | ||
| "author": "Caolan McMahon", | ||
| "version": "0.4.0", | ||
| "version": "0.4.1", | ||
| "repository": { | ||
@@ -30,3 +30,3 @@ "type": "git", | ||
| "testling": "~1.6.1", | ||
| "covert": "~0.3.1" | ||
| "covert": "~0.4.0" | ||
| }, | ||
@@ -33,0 +33,0 @@ "licenses": [ |
+2
-0
@@ -190,2 +190,4 @@ # Forms <sup>[![Version Badge][9]][8]</sup> | ||
| * alphanumeric | ||
| * digits | ||
| * integer | ||
@@ -192,0 +194,0 @@ ### Renderers |
@@ -364,1 +364,67 @@ /*jslint node: true */ | ||
| }); | ||
| test('integer', function (t) { | ||
| var v = validators.integer(); | ||
| t.test('valid integers', function(st) { | ||
| var valids = ['1', '10', '-1', '-10', '-10']; | ||
| st.plan(valids.length); | ||
| valids.forEach(function (input) { | ||
| v('form', { data: input }, function (err) { | ||
| st.equal(err, undefined); | ||
| }); | ||
| }); | ||
| st.end(); | ||
| }); | ||
| t.test('invalid integers', function(st) { | ||
| var invalids = ['1.5', 'one', '1,5', 'FFFFF', '+10']; | ||
| var msg = 'Please enter an integer value.'; | ||
| st.plan(invalids.length); | ||
| invalids.forEach(function (input) { | ||
| v('form', { data: input }, function (err) { | ||
| st.equal(err, msg); | ||
| }); | ||
| }); | ||
| st.end(); | ||
| }); | ||
| t.end(); | ||
| }); | ||
| test('digits', function (t) { | ||
| var v = validators.digits(); | ||
| t.test('valid digits', function(st) { | ||
| var valids = ['1', '10', '100']; | ||
| st.plan(valids.length); | ||
| valids.forEach(function (input) { | ||
| v('form', { data: input }, function (err) { | ||
| st.equal(err, undefined); | ||
| }); | ||
| }); | ||
| st.end(); | ||
| }); | ||
| t.test('invalid digits', function(st) { | ||
| var invalids = ['-1', '+10', 'one', '1.5']; | ||
| var msg = 'Numbers only.'; | ||
| st.plan(invalids.length); | ||
| invalids.forEach(function (input) { | ||
| v('form', { data: input }, function (err) { | ||
| st.equal(err, msg); | ||
| }); | ||
| }); | ||
| st.end(); | ||
| }); | ||
| t.end(); | ||
| }); | ||
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
138013
6.42%25
8.7%3382
1.68%359
0.56%