filter-value
Advanced tools
Comparing version 1.0.2-rc.0 to 1.0.2-rc.1
@@ -1,2 +0,2 @@ | ||
/** @license React v1.0.2-rc.0 | ||
/** @license React v1.0.2-rc.1 | ||
* filter-value.development.js | ||
@@ -113,13 +113,29 @@ * | ||
var FilterValue = function () { | ||
FilterValue.fromJSON = function fromJSON(obj) { | ||
if (typeof obj === 'string') { | ||
var _JSON$parse = JSON.parse(obj), | ||
name = _JSON$parse.name, | ||
item = _JSON$parse.item, | ||
type = _JSON$parse.type; | ||
/** | ||
* Creates an instance of FilterValue. | ||
* string, number, regexp, function, array of items mentioned before | ||
* | ||
* @param {string} name - name of filter | ||
* @param {any} item - value | ||
* @param {any} type - type of item | ||
* @memberOf FilterValue | ||
*/ | ||
function FilterValue() { | ||
var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; | ||
var item = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; | ||
var type = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; | ||
classCallCheck(this, FilterValue); | ||
return new FilterValue(name, item, type); | ||
_initialiseProps.call(this); | ||
this.originaItem = null; | ||
this.updateName(name); | ||
if (type !== null) { | ||
this.updateType(type); | ||
} | ||
return null; | ||
}; | ||
if (item === null) { | ||
return; | ||
} | ||
this.updateValue(item); | ||
} | ||
/** | ||
@@ -141,4 +157,4 @@ * Preparing item for right validation. | ||
} | ||
return item.map(function (i) { | ||
return new FilterValue(item.getName, i); | ||
return item.map(function (value) { | ||
return new FilterValue(item.Name, value); | ||
}); | ||
@@ -152,30 +168,3 @@ default: | ||
}; | ||
/** | ||
* Creates an instance of FilterValue. | ||
* string, number, regexp, function, array of items mentioned before! | ||
* | ||
* @param {string} name - name of filter! | ||
* @param {any} item - filter value! | ||
* | ||
* @memberOf FilterValue | ||
*/ | ||
function FilterValue() { | ||
var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; | ||
var item = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; | ||
var type = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; | ||
classCallCheck(this, FilterValue); | ||
_initialiseProps.call(this); | ||
this.updateName(name); | ||
if (type !== null) { | ||
this.updateType(type); | ||
} | ||
if (item === null) { | ||
return; | ||
} | ||
this.updateValue(item); | ||
} | ||
/** | ||
* Setter for name | ||
@@ -187,20 +176,5 @@ * | ||
/** | ||
* Setter for type | ||
* | ||
* @param {string} type new static type | ||
* | ||
* @memberOf FilterValue | ||
*/ | ||
/** | ||
* Remove static Type | ||
* | ||
* | ||
* @memberOf FilterValue | ||
*/ | ||
createClass(FilterValue, [{ | ||
key: 'getName', | ||
key: 'Name', | ||
@@ -217,2 +191,25 @@ /** | ||
} | ||
/** | ||
* Validation if possible to static type item | ||
* @param {any} item | ||
* @return {boolean} true when it's possible to retype | ||
* @memberOf FilterValue | ||
*/ | ||
/** | ||
* Setter for type | ||
* | ||
* @param {string} type new static type | ||
* | ||
* @memberOf FilterValue | ||
*/ | ||
/** | ||
* Remove static Type | ||
* | ||
* | ||
* @memberOf FilterValue | ||
*/ | ||
/** Setter for new value | ||
@@ -225,4 +222,12 @@ * Update filter value | ||
}, { | ||
key: 'value', | ||
/** | ||
* Getter for original value | ||
*/ | ||
get: function get$$1() { | ||
return this.originaItem; | ||
} | ||
/** | ||
* Basic exact compare. `===`! for number and strings. | ||
@@ -381,2 +386,3 @@ * | ||
this.updateValue = function (item) { | ||
_this.originaItem = item; | ||
_this.type = _this.checkValidity(item); | ||
@@ -383,0 +389,0 @@ |
@@ -1,2 +0,2 @@ | ||
/** @license React v1.0.2-rc.0 | ||
/** @license React v1.0.2-rc.1 | ||
* filter-value.production.min.js | ||
@@ -12,8 +12,8 @@ * | ||
var f=/[-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,g="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"===typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},h=function(){function a(b,a){for(var c=0;c<a.length;c++){var d=a[c];d.enumerable=d.enumerable||!1;d.configurable=!0;"value"in d&&(d.writable=!0);Object.defineProperty(b,d.key,d)}}return function(b,c,e){c&&a(b.prototype,c);e&&a(b,e);return b}}(),k=["number", | ||
"string","regexp","boolean"],m=function(){function a(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:null,c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null,e=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!(this instanceof a))throw new TypeError("Cannot call a class as a function");l.call(this);this.updateName(b);null!==e&&this.updateType(e);null!==c&&this.updateValue(c)}a.fromJSON=function(b){return"string"===typeof b?(b=JSON.parse(b),new a(b.name,b.item, | ||
b.type)):null};a.prototype.prepareItem=function(b){switch(this.type){case "array":if(Array.isArray(b[b.length-1]))throw new TypeError("Array in Array isn't supported!");return b.map(function(c){return new a(b.getName,c)});default:return this.staticType?this.RETYPE[this.staticType](b):b}};h(a,[{key:"getName",get:function(){return this.name}}]);return a}();m.regexEscape=function(a){return a.replace(f,"\\$\x26")}; | ||
function l(){var a=this;this.updateName=function(b){"string"===typeof b&&(a.name=b)};this.validStaticType=function(b){return k.some(function(a){return a===b})};this.updateType=function(b){a.validStaticType(b)&&(a.staticType=b)};this.removeType=function(){a.staticType=null};this.updateValue=function(b){a.type=a.checkValidity(b);if(a.type)a.item=a.prepareItem(b),a.compareFunc=a.TYPES[a.type];else throw new TypeError("item isn't valid filter value, possible types are string, RegExp, number, function, array of types mentioned before."); | ||
"string","regexp","boolean"],m=function(){function a(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:null,c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null,e=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!(this instanceof a))throw new TypeError("Cannot call a class as a function");l.call(this);this.originaItem=null;this.updateName(b);null!==e&&this.updateType(e);null!==c&&this.updateValue(c)}a.prototype.prepareItem=function(b){switch(this.type){case "array":if(Array.isArray(b[b.length- | ||
1]))throw new TypeError("Array in Array isn't supported!");return b.map(function(c){return new a(b.Name,c)});default:return this.staticType?this.RETYPE[this.staticType](b):b}};h(a,[{key:"Name",get:function(){return this.name}},{key:"value",get:function(){return this.originaItem}}]);return a}();m.regexEscape=function(a){return a.replace(f,"\\$\x26")}; | ||
function l(){var a=this;this.updateName=function(b){"string"===typeof b&&(a.name=b)};this.validStaticType=function(b){return k.some(function(a){return a===b})};this.updateType=function(b){a.validStaticType(b)&&(a.staticType=b)};this.removeType=function(){a.staticType=null};this.updateValue=function(b){a.originaItem=b;a.type=a.checkValidity(b);if(a.type)a.item=a.prepareItem(b),a.compareFunc=a.TYPES[a.type];else throw new TypeError("item isn't valid filter value, possible types are string, RegExp, number, function, array of types mentioned before."); | ||
};this.basicCompare=function(b){return a.item===b};this.dateCompare=function(b){return a.item.$.compare(b)};this.regexpCompare=function(b){return a.item.test(""+b)};this.arrayCompare=function(b){return a.item.some(function(a){return a.compare(b)})};this.funcCompare=function(b){return a.item(b)};this.rangeCompare=function(b){return a.item.from.$.isLess(b)&&a.item.to.$.isGreater(b)};this.TYPES={boolean:this.basicCompare,string:this.basicCompare,number:this.basicCompare,date:this.dateCompare,array:this.arrayCompare, | ||
regexp:this.regexpCompare,func:this.funcCompare,range:this.rangeCompare};this.numberRetype=function(b){return parseFloat(b)};this.stringRetype=function(b){return""+b};this.regexpRetype=function(b){return new RegExp(""+m.regexEscape(b))};this.booleanRetype=function(b){return!!b};this.RETYPE={number:this.numberRetype,string:this.stringRetype,regexp:this.regexpRetype,boolean:this.booleanRetype};this.compare=function(b){return a.compareFunc(b)};this.checkValidity=function(b){var c=a.checkRangeAbleTypes(b); | ||
if(!c)switch("undefined"===typeof b?"undefined":g(b)){case "boolean":c="boolean";break;case "function":c="func";break;case "object":Array.isArray(b)?c="array":b instanceof RegExp?c="regexp":b.from&&b.to&&a.checkRangeAbleTypes(b.from)===a.checkRangeAbleTypes(b.to)&&(c="range")}return c};this.checkRangeAbleTypes=function(b){var a=null;switch("undefined"===typeof b?"undefined":g(b)){case "string":a="string";break;case "number":a="number";break;case "object":b instanceof Date&&(a="date")}return a}} | ||
regexp:this.regexpCompare,func:this.funcCompare,range:this.rangeCompare};this.numberRetype=function(a){return parseFloat(a)};this.stringRetype=function(a){return""+a};this.regexpRetype=function(a){return new RegExp(""+m.regexEscape(a))};this.booleanRetype=function(a){return!!a};this.RETYPE={number:this.numberRetype,string:this.stringRetype,regexp:this.regexpRetype,boolean:this.booleanRetype};this.compare=function(b){return a.compareFunc(b)};this.checkValidity=function(b){var c=a.checkRangeAbleTypes(b); | ||
if(!c)switch("undefined"===typeof b?"undefined":g(b)){case "boolean":c="boolean";break;case "function":c="func";break;case "object":Array.isArray(b)?c="array":b instanceof RegExp?c="regexp":b.from&&b.to&&a.checkRangeAbleTypes(b.from)===a.checkRangeAbleTypes(b.to)&&(c="range")}return c};this.checkRangeAbleTypes=function(a){var b=null;switch("undefined"===typeof a?"undefined":g(a)){case "string":b="string";break;case "number":b="number";break;case "object":a instanceof Date&&(b="date")}return b}} | ||
var n=Object.freeze({default:m}),p=n&&m||n;module.exports=p.default?p.default:p; |
{ | ||
"name": "filter-value", | ||
"description": "Data engine is small data management lib for some sort and filter.", | ||
"version": "1.0.2-rc.0", | ||
"version": "1.0.2-rc.1", | ||
"keywords": [ | ||
@@ -6,0 +6,0 @@ "Data", |
@@ -1,2 +0,2 @@ | ||
/** @license Engine v1.0.2-rc.0 | ||
/** @license Engine v1.0.2-rc.1 | ||
* filter-value.development.js | ||
@@ -115,13 +115,29 @@ * | ||
var FilterValue = function () { | ||
FilterValue.fromJSON = function fromJSON(obj) { | ||
if (typeof obj === 'string') { | ||
var _JSON$parse = JSON.parse(obj), | ||
name = _JSON$parse.name, | ||
item = _JSON$parse.item, | ||
type = _JSON$parse.type; | ||
/** | ||
* Creates an instance of FilterValue. | ||
* string, number, regexp, function, array of items mentioned before | ||
* | ||
* @param {string} name - name of filter | ||
* @param {any} item - value | ||
* @param {any} type - type of item | ||
* @memberOf FilterValue | ||
*/ | ||
function FilterValue() { | ||
var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; | ||
var item = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; | ||
var type = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; | ||
classCallCheck(this, FilterValue); | ||
return new FilterValue(name, item, type); | ||
_initialiseProps.call(this); | ||
this.originaItem = null; | ||
this.updateName(name); | ||
if (type !== null) { | ||
this.updateType(type); | ||
} | ||
return null; | ||
}; | ||
if (item === null) { | ||
return; | ||
} | ||
this.updateValue(item); | ||
} | ||
/** | ||
@@ -143,4 +159,4 @@ * Preparing item for right validation. | ||
} | ||
return item.map(function (i) { | ||
return new FilterValue(item.getName, i); | ||
return item.map(function (value) { | ||
return new FilterValue(item.Name, value); | ||
}); | ||
@@ -154,30 +170,3 @@ default: | ||
}; | ||
/** | ||
* Creates an instance of FilterValue. | ||
* string, number, regexp, function, array of items mentioned before! | ||
* | ||
* @param {string} name - name of filter! | ||
* @param {any} item - filter value! | ||
* | ||
* @memberOf FilterValue | ||
*/ | ||
function FilterValue() { | ||
var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; | ||
var item = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; | ||
var type = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; | ||
classCallCheck(this, FilterValue); | ||
_initialiseProps.call(this); | ||
this.updateName(name); | ||
if (type !== null) { | ||
this.updateType(type); | ||
} | ||
if (item === null) { | ||
return; | ||
} | ||
this.updateValue(item); | ||
} | ||
/** | ||
* Setter for name | ||
@@ -189,20 +178,5 @@ * | ||
/** | ||
* Setter for type | ||
* | ||
* @param {string} type new static type | ||
* | ||
* @memberOf FilterValue | ||
*/ | ||
/** | ||
* Remove static Type | ||
* | ||
* | ||
* @memberOf FilterValue | ||
*/ | ||
createClass(FilterValue, [{ | ||
key: 'getName', | ||
key: 'Name', | ||
@@ -219,2 +193,25 @@ /** | ||
} | ||
/** | ||
* Validation if possible to static type item | ||
* @param {any} item | ||
* @return {boolean} true when it's possible to retype | ||
* @memberOf FilterValue | ||
*/ | ||
/** | ||
* Setter for type | ||
* | ||
* @param {string} type new static type | ||
* | ||
* @memberOf FilterValue | ||
*/ | ||
/** | ||
* Remove static Type | ||
* | ||
* | ||
* @memberOf FilterValue | ||
*/ | ||
/** Setter for new value | ||
@@ -227,4 +224,12 @@ * Update filter value | ||
}, { | ||
key: 'value', | ||
/** | ||
* Getter for original value | ||
*/ | ||
get: function get$$1() { | ||
return this.originaItem; | ||
} | ||
/** | ||
* Basic exact compare. `===`! for number and strings. | ||
@@ -383,2 +388,3 @@ * | ||
this.updateValue = function (item) { | ||
_this.originaItem = item; | ||
_this.type = _this.checkValidity(item); | ||
@@ -385,0 +391,0 @@ |
@@ -1,2 +0,2 @@ | ||
/** @license React v1.0.2-rc.0 | ||
/** @license React v1.0.2-rc.1 | ||
* filter-value.production.min.js | ||
@@ -12,7 +12,7 @@ * | ||
!1;e.configurable=!0;"value"in e&&(e.writable=!0);Object.defineProperty(b,e.key,e)}}return function(b,c,d){c&&a(b.prototype,c);d&&a(b,d);return b}}(),l=["number","string","regexp","boolean"],g=function(){function a(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:null,c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null,d=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!(this instanceof a))throw new TypeError("Cannot call a class as a function");m.call(this); | ||
this.updateName(b);null!==d&&this.updateType(d);null!==c&&this.updateValue(c)}a.fromJSON=function(b){return"string"===typeof b?(b=JSON.parse(b),new a(b.name,b.item,b.type)):null};a.prototype.prepareItem=function(b){switch(this.type){case "array":if(Array.isArray(b[b.length-1]))throw new TypeError("Array in Array isn't supported!");return b.map(function(c){return new a(b.getName,c)});default:return this.staticType?this.RETYPE[this.staticType](b):b}};k(a,[{key:"getName",get:function(){return this.name}}]); | ||
return a}();g.regexEscape=function(a){return a.replace(h,"\\$\x26")};var m=function(){var a=this;this.updateName=function(b){"string"===typeof b&&(a.name=b)};this.validStaticType=function(b){return l.some(function(a){return a===b})};this.updateType=function(b){a.validStaticType(b)&&(a.staticType=b)};this.removeType=function(){a.staticType=null};this.updateValue=function(b){a.type=a.checkValidity(b);if(a.type)a.item=a.prepareItem(b),a.compareFunc=a.TYPES[a.type];else throw new TypeError("item isn't valid filter value, possible types are string, RegExp, number, function, array of types mentioned before."); | ||
this.originaItem=null;this.updateName(b);null!==d&&this.updateType(d);null!==c&&this.updateValue(c)}a.prototype.prepareItem=function(b){switch(this.type){case "array":if(Array.isArray(b[b.length-1]))throw new TypeError("Array in Array isn't supported!");return b.map(function(c){return new a(b.Name,c)});default:return this.staticType?this.RETYPE[this.staticType](b):b}};k(a,[{key:"Name",get:function(){return this.name}},{key:"value",get:function(){return this.originaItem}}]);return a}();g.regexEscape= | ||
function(a){return a.replace(h,"\\$\x26")};var m=function(){var a=this;this.updateName=function(b){"string"===typeof b&&(a.name=b)};this.validStaticType=function(b){return l.some(function(a){return a===b})};this.updateType=function(b){a.validStaticType(b)&&(a.staticType=b)};this.removeType=function(){a.staticType=null};this.updateValue=function(b){a.originaItem=b;a.type=a.checkValidity(b);if(a.type)a.item=a.prepareItem(b),a.compareFunc=a.TYPES[a.type];else throw new TypeError("item isn't valid filter value, possible types are string, RegExp, number, function, array of types mentioned before."); | ||
};this.basicCompare=function(b){return a.item===b};this.dateCompare=function(b){return a.item.$.compare(b)};this.regexpCompare=function(b){return a.item.test(""+b)};this.arrayCompare=function(b){return a.item.some(function(a){return a.compare(b)})};this.funcCompare=function(b){return a.item(b)};this.rangeCompare=function(b){return a.item.from.$.isLess(b)&&a.item.to.$.isGreater(b)};this.TYPES={boolean:this.basicCompare,string:this.basicCompare,number:this.basicCompare,date:this.dateCompare,array:this.arrayCompare, | ||
regexp:this.regexpCompare,func:this.funcCompare,range:this.rangeCompare};this.numberRetype=function(b){return parseFloat(b)};this.stringRetype=function(b){return""+b};this.regexpRetype=function(b){return new RegExp(""+g.regexEscape(b))};this.booleanRetype=function(b){return!!b};this.RETYPE={number:this.numberRetype,string:this.stringRetype,regexp:this.regexpRetype,boolean:this.booleanRetype};this.compare=function(b){return a.compareFunc(b)};this.checkValidity=function(b){var c=a.checkRangeAbleTypes(b); | ||
if(!c)switch("undefined"===typeof b?"undefined":d(b)){case "boolean":c="boolean";break;case "function":c="func";break;case "object":Array.isArray(b)?c="array":b instanceof RegExp?c="regexp":b.from&&b.to&&a.checkRangeAbleTypes(b.from)===a.checkRangeAbleTypes(b.to)&&(c="range")}return c};this.checkRangeAbleTypes=function(b){var a=null;switch("undefined"===typeof b?"undefined":d(b)){case "string":a="string";break;case "number":a="number";break;case "object":b instanceof Date&&(a="date")}return a}},f= | ||
regexp:this.regexpCompare,func:this.funcCompare,range:this.rangeCompare};this.numberRetype=function(a){return parseFloat(a)};this.stringRetype=function(a){return""+a};this.regexpRetype=function(a){return new RegExp(""+g.regexEscape(a))};this.booleanRetype=function(a){return!!a};this.RETYPE={number:this.numberRetype,string:this.stringRetype,regexp:this.regexpRetype,boolean:this.booleanRetype};this.compare=function(b){return a.compareFunc(b)};this.checkValidity=function(b){var c=a.checkRangeAbleTypes(b); | ||
if(!c)switch("undefined"===typeof b?"undefined":d(b)){case "boolean":c="boolean";break;case "function":c="func";break;case "object":Array.isArray(b)?c="array":b instanceof RegExp?c="regexp":b.from&&b.to&&a.checkRangeAbleTypes(b.from)===a.checkRangeAbleTypes(b.to)&&(c="range")}return c};this.checkRangeAbleTypes=function(a){var b=null;switch("undefined"===typeof a?"undefined":d(a)){case "string":b="string";break;case "number":b="number";break;case "object":a instanceof Date&&(b="date")}return b}},f= | ||
Object.freeze({default:g});f=f&&g||f;return f.default?f.default:f}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
38644
909