Skip to content

Commit

Permalink
Stable Version 1.2.4.
Browse files Browse the repository at this point in the history
Fixes #15
  • Loading branch information
jmdobry committed Apr 8, 2015
1 parent 1e8ed07 commit 7214011
Show file tree
Hide file tree
Showing 7 changed files with 142 additions and 141 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
##### 1.2.4 - 08 April 2015

###### Backwards compatible bug fixes
- #15 - Rule names conflict with schema-attribute names

##### 1.2.3 - 07 April 2015

###### Backwards compatible bug fixes
Expand Down
210 changes: 103 additions & 107 deletions dist/js-data-schema.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
* js-data-schema
* @version 1.2.3 - Homepage <https://github.com/js-data/js-data-schema/>
* @version 1.2.4 - Homepage <https://github.com/js-data/js-data-schema/>
* @author Jason Dobry <[email protected]>
* @copyright (c) 2013-2015 Jason Dobry
* @license MIT <https://github.com/js-data/js-data-schema/blob/master/LICENSE>
Expand Down Expand Up @@ -732,11 +732,7 @@ return /******/ (function(modules) { // webpackBootstrap
type: value
};
} else if (utils.isObject(value)) {
if (utils.contains(rules, key)) {
throw new Error("Rule configuration for rule \"" + key + "\" cannot be an object!");
} else {
_validateSchema(value, rules);
}
_validateSchema(value, rules);
}
});
}
Expand Down Expand Up @@ -1339,7 +1335,7 @@ return /******/ (function(modules) { // webpackBootstrap
/* 26 */
/***/ function(module, exports, __webpack_require__) {

var indexOf = __webpack_require__(42);
var indexOf = __webpack_require__(40);

/**
* If array contains values.
Expand All @@ -1356,8 +1352,8 @@ return /******/ (function(modules) { // webpackBootstrap
/***/ function(module, exports, __webpack_require__) {

var unique = __webpack_require__(29);
var filter = __webpack_require__(40);
var every = __webpack_require__(41);
var filter = __webpack_require__(41);
var every = __webpack_require__(42);
var contains = __webpack_require__(26);
var slice = __webpack_require__(36);

Expand Down Expand Up @@ -1386,7 +1382,7 @@ return /******/ (function(modules) { // webpackBootstrap
/***/ function(module, exports, __webpack_require__) {

var unique = __webpack_require__(29);
var filter = __webpack_require__(40);
var filter = __webpack_require__(41);
var some = __webpack_require__(43);
var contains = __webpack_require__(26);
var slice = __webpack_require__(36);
Expand Down Expand Up @@ -1414,7 +1410,7 @@ return /******/ (function(modules) { // webpackBootstrap
/* 29 */
/***/ function(module, exports, __webpack_require__) {

var filter = __webpack_require__(40);
var filter = __webpack_require__(41);

/**
* @return {array} Array of unique items
Expand Down Expand Up @@ -1670,9 +1666,9 @@ return /******/ (function(modules) { // webpackBootstrap
/* 37 */
/***/ function(module, exports, __webpack_require__) {

var identity = __webpack_require__(46);
var prop = __webpack_require__(47);
var deepMatches = __webpack_require__(48);
var identity = __webpack_require__(45);
var prop = __webpack_require__(46);
var deepMatches = __webpack_require__(47);

/**
* Converts argument into a valid iterator.
Expand Down Expand Up @@ -1710,7 +1706,7 @@ return /******/ (function(modules) { // webpackBootstrap
/* 38 */
/***/ function(module, exports, __webpack_require__) {

var clone = __webpack_require__(45);
var clone = __webpack_require__(48);
var forOwn = __webpack_require__(19);
var kindOf = __webpack_require__(44);
var isPlainObject = __webpack_require__(33);
Expand Down Expand Up @@ -1785,6 +1781,40 @@ return /******/ (function(modules) { // webpackBootstrap
/* 40 */
/***/ function(module, exports, __webpack_require__) {



/**
* Array.indexOf
*/
function indexOf(arr, item, fromIndex) {
fromIndex = fromIndex || 0;
if (arr == null) {
return -1;
}

var len = arr.length,
i = fromIndex < 0 ? len + fromIndex : fromIndex;
while (i < len) {
// we iterate over sparse items since there is no way to make it
// work properly on IE 7-8. see #64
if (arr[i] === item) {
return i;
}

i++;
}

return -1;
}

module.exports = indexOf;



/***/ },
/* 41 */
/***/ function(module, exports, __webpack_require__) {

var makeIterator = __webpack_require__(37);

/**
Expand Down Expand Up @@ -1814,7 +1844,7 @@ return /******/ (function(modules) { // webpackBootstrap


/***/ },
/* 41 */
/* 42 */
/***/ function(module, exports, __webpack_require__) {

var makeIterator = __webpack_require__(37);
Expand Down Expand Up @@ -1846,40 +1876,6 @@ return /******/ (function(modules) { // webpackBootstrap



/***/ },
/* 42 */
/***/ function(module, exports, __webpack_require__) {



/**
* Array.indexOf
*/
function indexOf(arr, item, fromIndex) {
fromIndex = fromIndex || 0;
if (arr == null) {
return -1;
}

var len = arr.length,
i = fromIndex < 0 ? len + fromIndex : fromIndex;
while (i < len) {
// we iterate over sparse items since there is no way to make it
// work properly on IE 7-8. see #64
if (arr[i] === item) {
return i;
}

i++;
}

return -1;
}

module.exports = indexOf;



/***/ },
/* 43 */
/***/ function(module, exports, __webpack_require__) {
Expand Down Expand Up @@ -1943,61 +1939,6 @@ return /******/ (function(modules) { // webpackBootstrap
/* 45 */
/***/ function(module, exports, __webpack_require__) {

var kindOf = __webpack_require__(44);
var isPlainObject = __webpack_require__(33);
var mixIn = __webpack_require__(49);

/**
* Clone native types.
*/
function clone(val){
switch (kindOf(val)) {
case 'Object':
return cloneObject(val);
case 'Array':
return cloneArray(val);
case 'RegExp':
return cloneRegExp(val);
case 'Date':
return cloneDate(val);
default:
return val;
}
}

function cloneObject(source) {
if (isPlainObject(source)) {
return mixIn({}, source);
} else {
return source;
}
}

function cloneRegExp(r) {
var flags = '';
flags += r.multiline ? 'm' : '';
flags += r.global ? 'g' : '';
flags += r.ignoreCase ? 'i' : '';
return new RegExp(r.source, flags);
}

function cloneDate(date) {
return new Date(+date);
}

function cloneArray(arr) {
return arr.slice();
}

module.exports = clone;




/***/ },
/* 46 */
/***/ function(module, exports, __webpack_require__) {



/**
Expand All @@ -2013,7 +1954,7 @@ return /******/ (function(modules) { // webpackBootstrap


/***/ },
/* 47 */
/* 46 */
/***/ function(module, exports, __webpack_require__) {


Expand All @@ -2033,7 +1974,7 @@ return /******/ (function(modules) { // webpackBootstrap


/***/ },
/* 48 */
/* 47 */
/***/ function(module, exports, __webpack_require__) {

var forOwn = __webpack_require__(19);
Expand Down Expand Up @@ -2093,6 +2034,61 @@ return /******/ (function(modules) { // webpackBootstrap



/***/ },
/* 48 */
/***/ function(module, exports, __webpack_require__) {

var kindOf = __webpack_require__(44);
var isPlainObject = __webpack_require__(33);
var mixIn = __webpack_require__(49);

/**
* Clone native types.
*/
function clone(val){
switch (kindOf(val)) {
case 'Object':
return cloneObject(val);
case 'Array':
return cloneArray(val);
case 'RegExp':
return cloneRegExp(val);
case 'Date':
return cloneDate(val);
default:
return val;
}
}

function cloneObject(source) {
if (isPlainObject(source)) {
return mixIn({}, source);
} else {
return source;
}
}

function cloneRegExp(r) {
var flags = '';
flags += r.multiline ? 'm' : '';
flags += r.global ? 'g' : '';
flags += r.ignoreCase ? 'i' : '';
return new RegExp(r.source, flags);
}

function cloneDate(date) {
return new Date(+date);
}

function cloneArray(arr) {
return arr.slice();
}

module.exports = clone;




/***/ },
/* 49 */
/***/ function(module, exports, __webpack_require__) {
Expand Down
4 changes: 2 additions & 2 deletions dist/js-data-schema.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/js-data-schema.min.map

Large diffs are not rendered by default.

6 changes: 1 addition & 5 deletions lib/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,11 +222,7 @@ function _validateSchema(attrs, rules) {
type: value
};
} else if (utils.isObject(value)) {
if (utils.contains(rules, key)) {
throw new Error(`Rule configuration for rule "${key}" cannot be an object!`);
} else {
_validateSchema(value, rules);
}
_validateSchema(value, rules);
}
});
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "js-data-schema",
"description": "Define and validate rules, datatypes and schemata in Node and in the browser.",
"version": "1.2.3",
"version": "1.2.4",
"homepage": "http://www.js-data.io/docs/js-data-schema",
"repository": {
"type": "git",
Expand Down
Loading

0 comments on commit 7214011

Please sign in to comment.