Sha256: 59ade12d433b6746ad0f5b2c3b2b2f58fba8f706ea52ea7e40f34d484613dc7d

Contents?: true

Size: 1.52 KB

Versions: 4

Compression:

Stored size: 1.52 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.NodeLib = mod.exports;
  }
})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports) {
  "use strict";

  Object.defineProperty(_exports, "__esModule", {
    value: true
  });
  _exports.NodeLib = void 0;
  var NodeLib = {
    nodes: {},
    keywords: {},
    add: function add(node) {
      this.nodes[node.name] = node;
    },
    addKeyword: function addKeyword(name, callback, cache) {
      cache = cache !== undefined ? cache : true;
      this.keywords[name] = {
        callback: callback,
        cache: cache
      };
    },
    remove: function remove(node) {
      delete this.nodes[node.name];
    },
    removeKeyword: function removeKeyword(name) {
      delete this.keywords[name];
    },
    get: function get(name) {
      return this.nodes[name];
    },
    getKeyword: function getKeyword(name, builder) {
      return this.keywords[name].callback.call(this, builder);
    },
    getKeywordData: function getKeywordData(name) {
      return this.keywords[name];
    },
    contains: function contains(name) {
      return this.nodes[name] !== undefined;
    },
    containsKeyword: function containsKeyword(name) {
      return this.keywords[name] !== undefined;
    }
  };
  _exports.NodeLib = NodeLib;
});

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/NodeLib.js
opal-js_wrap-three-0.1.4 lib-opal/js_wrap/three/nodes/core/NodeLib.js
opal-js_wrap-three-0.1.3 lib-opal/js_wrap/three/nodes/core/NodeLib.js
opal-js_wrap-three-0.1.2 lib-opal/js_wrap/three/nodes/core/NodeLib.js