Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Move the ‘enum’ attribute into a separate file

  • Loading branch information...
commit f0e9c13331c67a8b5f2aee6804328b3897b0c77a 1 parent 93f84a5
@Baggz authored
Showing with 10 additions and 0 deletions.
  1. +10 −0 src/engines/json/attributes/enum.js
View
10 src/engines/json/attributes/enum.js
@@ -0,0 +1,10 @@
+/**
+ * Enum
+ */
+Validation.prototype.addAttributeConstructor('enum', function enumConstructor() {
+
+ return function enum(property, propertyValue, attributeValue, propertyAttributes, callback) {
+ return (attributeValue.indexOf(propertyValue) === -1) ? callback(true) : callback();
+ };
+
+});
Please sign in to comment.
Something went wrong with that request. Please try again.