How to use the eris.hasOwnProperty function in eris

To help you get started, we’ve selected a few eris examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github macdja38 / pvpcraft / PvPCraft.js View on Github external
* Created by macdja38 on 2016-04-17.
 */
/* var module = require("module");
 module.wrapper[0] += ""use strict";";
 Object.freeze(module.wrap);
 */
"use strict";
const cluster = require("cluster");
const blocked = require("blocked");
const git = require("git-rev");
const ravenClient = require("raven");
const PvPClient = require("pvpclient");
const ConfigsDB = require("./lib/ConfigDB.js");
const Eris = require("eris");
for (let thing in Eris) {
  if (Eris.hasOwnProperty(thing) && typeof Eris[thing] === "function") {
    Eris[thing].prototype.toJSON = function toJSON() {
      let copy = {};
      keyLoop: for (let key in this) {
        if (this.hasOwnProperty(key) && !key.startsWith("_")) {
          for (let erisProp in Eris) {
            if (Eris.hasOwnProperty(erisProp)) {
              if (typeof Eris[erisProp] === "function" && this[key] instanceof Eris[erisProp]) {
                copy[key] = `[ Eris ${erisProp} ]`;
                continue keyLoop;
              }
            }
          }
          if (!this[key]) {
            copy[key] = this[key];
          } else if (this[key] instanceof Set) {
            copy[key] = "[ Set ]"
github macdja38 / pvpcraft / PvPCraft.js View on Github external
Eris[thing].prototype.toJSON = function toJSON() {
      let copy = {};
      keyLoop: for (let key in this) {
        if (this.hasOwnProperty(key) && !key.startsWith("_")) {
          for (let erisProp in Eris) {
            if (Eris.hasOwnProperty(erisProp)) {
              if (typeof Eris[erisProp] === "function" && this[key] instanceof Eris[erisProp]) {
                copy[key] = `[ Eris ${erisProp} ]`;
                continue keyLoop;
              }
            }
          }
          if (!this[key]) {
            copy[key] = this[key];
          } else if (this[key] instanceof Set) {
            copy[key] = "[ Set ]"
          } else if (this[key] instanceof Map) {
            copy[key] = "[ Map ]"
          } else {
            copy[key] = this[key];
          }
        }