GithubHelp home page GithubHelp logo

cryo's Introduction

Notes

I'm a mediocre developer hacking away at hard problems. Whenever I figure something out, I write a note to myself so when I inevitably have the same problem in the future, I'll have a reference.

I've been doing this for years, locally, but just recently started pushing notes to a repo.

cryo's People

Contributors

booleangate avatar hunterloftis avatar wbyoung avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cryo's Issues

Prototype functions

Does it work with functions defined on an object's prototype? At a first look it doesn't seem so.

RangeError: Maximum call stack size exceeded

I am trying to stringify objects slightly larger than the example object that I have posted. And I receive the following error.

Error:

RangeError: Maximum call stack size exceeded
    at Process.hasOwnProperty (native)
    at cloneWithReferences (/Users/Alex/code/systems/alive/node_modules/cryo/lib/cryo.js:57:20)
    at cloneWithReferences (/Users/Alex/code/systems/alive/node_modules/cryo/lib/cryo.js:58:26)
    at cloneWithReferences (/Users/Alex/code/systems/alive/node_modules/cryo/lib/cryo.js:58:26)
    at cloneWithReferences (/Users/Alex/code/systems/alive/node_modules/cryo/lib/cryo.js:58:26)
    at cloneWithReferences (/Users/Alex/code/systems/alive/node_modules/cryo/lib/cryo.js:58:26)
    at cloneWithReferences (/Users/Alex/code/systems/alive/node_modules/cryo/lib/cryo.js:58:26)
    at cloneWithReferences (/Users/Alex/code/systems/alive/node_modules/cryo/lib/cryo.js:58:26)
    at cloneWithReferences (/Users/Alex/code/systems/alive/node_modules/cryo/lib/cryo.js:58:26)
    at cloneWithReferences (/Users/Alex/code/systems/alive/node_modules/cryo/lib/cryo.js:58:26)

Object:

{"root":"_CRYO_REF_5","references":[{"contents":{},"value":"_CRYO_OBJECT_"},{"contents":{"0":"node","1":"app.js"},"value":"_CRYO_ARRAY_"},{"contents":{"port":9000},"value":"_CRYO_OBJECT_"},{"contents":{"0":"ignore","1":10,"2":11},"value":"_CRYO_ARRAY_"},{"contents":{},"value":"_CRYO_FUNCTION_function (restarts) {\n    return sleep[restarts - 1] || sleep[sleep.length - 1]\n  }"},{"contents":{"domain":null,"_events":"_CRYO_REF_0","_eventsCount":0,"_maxListeners":"_CRYO_UNDEFINED_","id":null,"status":"stopped","command":"_CRYO_REF_1","name":"test","cwd":"/Users/Alex/psudo-server/www/node/_test","env":"_CRYO_REF_2","uid":"_CRYO_UNDEFINED_","gid":"_CRYO_UNDEFINED_","pid":0,"stdio":"_CRYO_REF_3","stdout":"_CRYO_UNDEFINED_","stderr":"_CRYO_UNDEFINED_","windowsVerbatimArguments":"_CRYO_UNDEFINED_","crashed":false,"sleep":"_CRYO_REF_4","maxRestarts":5,"kill":30000,"child":null,"started":null,"timeout":null},"value":"_CRYO_OBJECT_"}]}

Objects of a given class

As it stands, cryo can re-create objects, but recreates vanilla objects, not those of their original type.

Would you be open to a pull request that added functionality so that something like this would be possible:

function Shape() {
  this.x = 0;
  this.y = 0;
}

var shape = new Shape();
var cryoShape = Cryo.parse(Cryo.stringify(shape));

shape instanceof Shape; // true
cryoShape instanceof Shape; // true

It would likely use __proto__ and/or setPrototypeOf and may require a way for types to be found during Cryo.parse.

status of this project?

Looks like the last commit was in 2017. Is this project still maintained or should it be considered EOL? @hunterloftis
Also, I couldn't find a license listed for your project. Can you make one publicly available?

Example output of stringify?

Looked through most of the tests, examples, and docs and still can't find an example of what the output looks like.

Security issue

Hi,

I'm a member of the Node.js Security WG and we received a report regarding a security issue with this module. We tried inviting the author by e-mail but received no response so I'm opening this issue and inviting anyone with commit and npm publish rights to collaborate with us on a fix.

Support ES6 Class

I was just wondering if anyone has looked into adding this before and not done it for any reason, and if not, @hunterloftis would you accept a PR to add this?

Support ES6 Map and Set

Certainly these can be done in a custom way, but it would be nice to support these structures by default, since they are often used.

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.