Learn more  » Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Bower components Debian packages RPM packages NuGet packages

vistahigherlearning / statsd   deb

Repository URL to install this package:

/ usr / share / statsd / lib / set.js

/*jshint node:true, laxcomma:true */

var Set = function() {
  this.store = {};
};

Set.prototype = {
  has: function(value) {
    if (value) {
      return this.store.hasOwnProperty(value);
    } else {
      return false;
    }
  },
  insert: function(value) {
    if (value) {
      this.store[value] = value;
    }
  },
  clear: function() {
    this.store = {};
  },
  values: function() {
    var values = [];
    for (var value in this.store) {
      values.push(value);
    }
    return values;
  }
};

exports.Set = Set;