Your IP : 18.227.209.89


Current Path : /opt/alt/alt-nodejs11/root/lib/node_modules/npm/node_modules.bundled/lazy-property/
Upload File :
Current File : //opt/alt/alt-nodejs11/root/lib/node_modules/npm/node_modules.bundled/lazy-property/lazyProperty.js

"use strict"

function addLazyProperty(object, name, initializer, enumerable) {
  Object.defineProperty(object, name, {
    get: function() {
      var v = initializer.call(this)
      Object.defineProperty(this, name, { value: v, enumerable: !!enumerable, writable: true })
      return v
    },
    set: function(v) {
      Object.defineProperty(this, name, { value: v, enumerable: !!enumerable, writable: true })
      return v
    },
    enumerable: !!enumerable,
    configurable: true
  })
}

module.exports = addLazyProperty

?>