Code Monkey home page Code Monkey logo

suman-utils's Introduction

Suman-Utils

Build Status

Shared utility library for SumanJS projects

Has many public utility functions for various tasks, mostly unique to SumanJS.

suman-utils's People

Contributors

oresoftware avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

suman-utils's Issues

use new Map() for customStringify() cache

this

 const customStringify = function (v) {
  let cache = [];
  return JSON.stringify(v, function (key, value) {
    if (typeof value === 'object' && value !== null) {
      if (cache.indexOf(value) !== -1) {
        // Circular reference found, discard key
        return;
      }
      // Store value in our collection
      cache.push(value);
    }
    return value;
  });
};

should become

 const customStringify = function (v) {
  let cache = new Map();
  return JSON.stringify(v, function (key, value) {
    if (typeof value === 'object' && value !== null) {
      if (cache.get(value)) {
        // Circular reference found, discard key
        return;
      }
      // Store value in our collection
      cache.set(value,true);
    }
    return value;
  });
};

event emitter leak?

 [watch-worker] (node:5440) Warning: Possible EventEmitter memory leak detected. 11 finish listeners added. Use emitter.setMaxListeners() to increase limit
 [watch-worker]   => Suman-Utils warning =>  Warning: Possible EventEmitter memory leak detected. 11 finish listeners added. Use emitter.setMaxListeners() to increase limit
 [watch-worker]     at _addListener (events.js:259:19)
 [watch-worker]     at Socket.addListener (events.js:275:10)
 [watch-worker]     at Socket.Readable.on (_stream_readable.js:687:35)
 [watch-worker]     at Socket.once (events.js:301:8)
 [watch-worker]     at Socket.Readable.pipe (_stream_readable.js:596:8)
 [watch-worker]     at handleStdioAndExit (/Users/alexamil/WebstormProjects/oresoftware/sumanjs/suman-watch/lib/make-execute.js:38:22)
 [watch-worker]     at noDaemon_1 (/Users/alexamil/WebstormProjects/oresoftware/sumanjs/suman-watch/lib/make-execute.js:89:21)
 [watch-worker]     at _combinedTickCallback (internal/process/next_tick.js:73:7)
 [watch-worker]     at process._tickCallback (internal/process/next_tick.js:104:9)
 [watch-worker]   => Suman warning =>  Warning: Possible EventEmitter memory leak detected. 11 finish listeners added. Use emitter.setMaxListeners() to increase limit
 [watch-worker]     at _addListener (events.js:259:19)
 [watch-worker]     at Socket.addListener (events.js:275:10)
 [watch-worker]     at Socket.Readable.on (_stream_readable.js:687:35)
 [watch-worker]     at Socket.once (events.js:301:8)
 [watch-worker]     at Socket.Readable.pipe (_stream_readable.js:596:8)
 [watch-worker]     at handleStdioAndExit (/Users/alexamil/WebstormProjects/oresoftware/sumanjs/suman-watch/lib/make-execute.js:38:22)
 [watch-worker]     at noDaemon_1 (/Users/alexamil/WebstormProjects/oresoftware/sumanjs/suman-watch/lib/make-execute.js:89:21)
 [watch-worker]     at _combinedTickCallback (internal/process/next_tick.js:73:7)
 [watch-worker]     at process._tickCallback (internal/process/next_tick.js:104:9)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.