Comments (2)
Hi @jcward, not too sure about this one. I agree if stringify'ing a hash then returning 'Array' is misleading, but I don't think this is main point of this. Stringify is used to just turn any object into a string. When you use sort on a hash you get an array back anyway, but that is another point.
Are you currently using stringify and need 'Hash' returned? If you need the type then I'd use {}.class
which would be accurate.
I would make the stringify method private to allow the signature method only, but people might be consuming the stringify method now. If there is a need to specify Hash when using an original Hash then this can be looked at, but there is a reason why turning the Hash into an Array is implemented.
from crimp.
I'm just using stringify because it's easier to see what's happening under the hood than signature's hex output. Their equivalence is interchangeable (having the same string == having the same signature).
The jist of this issue is that Crimp considers []
the exact same as {}
-- maybe that's the intent. Also, [{}]
is the same as [[]]
, and {:foo=>[]}
as {:foo=>{}}
.
This issue is more about letting people know what they're getting with Crimp. Feel free to close as "as-designed".
For me, I expected a unique signature per any object I input. I wouldn't think [] == {}
so I was surprised.
from crimp.
Related Issues (2)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from crimp.