component / model

Minimalistic extensible data models
122 stars 40 forks source link

fix toJSON() copy #62

Closed juliangruber closed 1 year ago

juliangruber commented 10 years ago

I expect .toJSON() to return a copy, so I can mess with data without changing the real model.

We might use a more efficient cloning algorithm, I'm not sure where this method is used.

vendethiel commented 10 years ago

I think attrs is usually shallow, so we probably can go faster than using JSON serializing :)

ianstormtaylor commented 10 years ago

prior discussion was here: https://github.com/component/model/pull/39/files but i think im still +1 having a clone