Sha256: 49b3e1024dfdfcdc0e79497b818a842751ddf90e4743fda95e154f8078863438

Contents?: true

Size: 1.62 KB

Versions: 4

Compression:

Stored size: 1.62 KB

Contents

(function (global, factory) {
  if (typeof define === "function" && define.amd) {
    define(["exports"], factory);
  } else if (typeof exports !== "undefined") {
    factory(exports);
  } else {
    var mod = {
      exports: {}
    };
    factory(mod.exports);
    global.NodeUtils = mod.exports;
  }
})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports) {
  "use strict";

  Object.defineProperty(_exports, "__esModule", {
    value: true
  });
  _exports.NodeUtils = void 0;
  var NodeUtils = {
    elements: ['x', 'y', 'z', 'w'],
    addShortcuts: function () {
      function applyShortcut(proxy, property, subProperty) {
        if (subProperty) {
          return {
            get: function get() {
              return this[proxy][property][subProperty];
            },
            set: function set(val) {
              this[proxy][property][subProperty] = val;
            }
          };
        } else {
          return {
            get: function get() {
              return this[proxy][property];
            },
            set: function set(val) {
              this[proxy][property] = val;
            }
          };
        }
      }

      return function addShortcuts(proto, proxy, list) {
        var shortcuts = {};

        for (var i = 0; i < list.length; ++i) {
          var data = list[i].split('.'),
              property = data[0],
              subProperty = data[1];
          shortcuts[property] = applyShortcut(proxy, property, subProperty);
        }

        Object.defineProperties(proto, shortcuts);
      };
    }()
  };
  _exports.NodeUtils = NodeUtils;
});

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
opal-js_wrap-three-0.1.5 lib-opal/js_wrap/three/nodes/core/NodeUtils.js
opal-js_wrap-three-0.1.4 lib-opal/js_wrap/three/nodes/core/NodeUtils.js
opal-js_wrap-three-0.1.3 lib-opal/js_wrap/three/nodes/core/NodeUtils.js
opal-js_wrap-three-0.1.2 lib-opal/js_wrap/three/nodes/core/NodeUtils.js