You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

22 line
376 B

  1. module.exports = {
  2. toString: function () {
  3. let res = {};
  4. for (let p in this) {
  5. if (['type', 'obj', 'physics', 'objects', 'syncer'].indexOf(p) > -1)
  6. continue;
  7. let val = this[p];
  8. let stringVal = (val && val.toString) ? val.toString() : val;
  9. const type = typeof(val);
  10. if (
  11. type !== 'function'
  12. )
  13. res[p] = stringVal;
  14. }
  15. return res;
  16. }
  17. };