Your IP : 216.73.216.86


Current Path : /home/emeraadmin/public_html/node_modules/d3-selection/src/
Upload File :
Current File : /home/emeraadmin/public_html/node_modules/d3-selection/src/local.js

var nextId = 0;

export default function local() {
  return new Local;
}

function Local() {
  this._ = "@" + (++nextId).toString(36);
}

Local.prototype = local.prototype = {
  constructor: Local,
  get: function(node) {
    var id = this._;
    while (!(id in node)) if (!(node = node.parentNode)) return;
    return node[id];
  },
  set: function(node, value) {
    return node[this._] = value;
  },
  remove: function(node) {
    return this._ in node && delete node[this._];
  },
  toString: function() {
    return this._;
  }
};