Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Move the ‘length’ attribute into a separate file

  • Loading branch information...
commit dca23634f34da4d81be3dfa56602c6457d846f0f 1 parent f0e9c13
@Baggz authored
Showing with 14 additions and 0 deletions.
  1. +14 −0 src/engines/json/attributes/length.js
View
14 src/engines/json/attributes/length.js
@@ -0,0 +1,14 @@
+/**
+ * Length
+ */
+Validation.prototype.addAttributeConstructor('length', function lengthConstructor() {
+
+ return function length(property, propertyValue, attributeValue, propertyAttributes, callback) {
+ if (isString(propertyValue) && propertyValue.length === attributeValue) {
+ return callback();
+ } else {
+ return callback(true);
+ }
+ };
+
+});
Please sign in to comment.
Something went wrong with that request. Please try again.