fly-json-odm
Version:
An Object Document Mapper to handle JSON on the fly for NodeJS or Browser
29 lines (25 loc) • 581 B
JavaScript
// The reason we disable equal strict because we want a no strict for comparisons operator.
/* eslint eqeqeq:0 */
;
/**
* Unstrict Operator
* @param {string} operator
* @param {*} v this is the property value
* @param {*} s this is the search value
* @return {bool}
*/
function unstrict (operator, v, s) {
switch (operator) {
case '=':
return v == s;
case '==':
return v == s;
case '!=':
return v != s;
default:
throw new Error('Comparisons operator is not available!');
}
}
module.exports = {
unstrict
};