eyes.utils
Advanced tools
Comparing version 0.0.16 to 0.0.17
{ | ||
"name": "eyes.utils", | ||
"version": "0.0.16", | ||
"version": "0.0.17", | ||
"description": "General purpose Javascript utilities.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -77,3 +77,34 @@ /* | ||
/** | ||
* Creates a property with default configuration (writable, enumerable, configurable). | ||
* | ||
* @param {object} obj The object to create the property on. | ||
* @param {string} name The name of the property | ||
* @param {Function} getFunc The getter of the property | ||
* @param {Function} setFunc The setter of the property | ||
*/ | ||
GeneralUtils.definePropertyWithDefaultConfig = function (obj, name, getFunc, setFunc) { | ||
Object.defineProperty(obj, name, { | ||
enumerable: true, | ||
configurable: true, | ||
get: getFunc, | ||
set: setFunc | ||
}); | ||
} | ||
/** | ||
* Creates a property with default configuration (writable, enumerable, configurable) and default getter/setter. | ||
* | ||
* @param {object} obj The object to create the property on. | ||
* @param {string} name The name of the property | ||
*/ | ||
GeneralUtils.defineStandardProperty = function (obj, name) { | ||
var getFunc = function () { return this["_" + name]; } | ||
var setFunc = function (v) { this["_" + name] = v; } | ||
GeneralUtils.definePropertyWithDefaultConfig(obj, name, getFunc, setFunc); | ||
} | ||
module.exports = GeneralUtils; | ||
}()); | ||
}()); |
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
82288
1795