Code Monkey home page Code Monkey logo

fiona's People

Contributors

billymoon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

fiona's Issues

Fiona.Unique should not return objects that look like each other

Calling unique with Fiona.Json returns unique results as it's json strings being compared...

Fiona().unique(3, Fiona.Json({ nice: Fiona.Number({ max: 5 }) }))
(3) ['{"nice":1}', '{"nice":2}', '{"nice":5}']

... but with objects, they are compared for equality and can then be duplicated because they are not the same object even though they have the same data shape ...

JSON.stringify(Fiona().unique(3, Fiona.Object({ nice: Fiona.Number({ max: 5 }) })))
'[{"nice":0},{"nice":2},{"nice":0}]'

... it should be possible to request unique data structures, not just unique values

numeric seeds converted to string in some cases but not others

When using in object structure, the approach of building string from initseed could be unexpected as sometimes numeric seed and string seed produce different output, and sometimes the same.

Fiona(123).random()
// 0.7081193615254571
Fiona('123').random()
// 0.9708307874253163

Fiona(123).object(Fiona.Random())
// 0.46259732286566746
Fiona('123').object(Fiona.Random())
// 0.46259732286566746

Fiona(123).info()
// {initseed: 123}
Fiona('123').info()
// {initseed: "123"}
Fiona(123).object(seeded => seeded.info())
// {initseed: "root/123"}
Fiona('123').object(seeded => seeded.info())
// {initseed: "root/123"}

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.