hackergrrl / hyper-string

conflict-free p2p string data structure powered by a hyperlog of operations
39 stars 6 forks source link

Multiple char insertion/deletion #4

Closed ajoslin closed 8 years ago

ajoslin commented 8 years ago

Breaking change: The callbacks of both str.insert and str.delete now accept an array of ops.

I also added a gitignore for node_modules, standard.js linting (you seem to already follow standardjs anyway), updated the docs to reflect changes, and removed the outdated example file.

hackergrrl commented 8 years ago

Great work, @ajoslin! String-wise operations will be great to have. :heart:

ajoslin commented 8 years ago

@noffle what is your stance on type-assertions? I usually include assert in my modules and use it for type-checking.

The idea is that if one or more of the frontend modules I have in my project use assert, then they all may as well use it -- same byte usage.

In this case, I'm thinking of count: checking if it's a non-negative number.

I've committed without assertions for now.

hackergrrl commented 8 years ago

:+1: on these revisions, and :+1: for type assertions, if you'd like to include them in this PR.

ajoslin commented 8 years ago

Type assertions added to insert and delete :+1:

hackergrrl commented 8 years ago

Great! Just one nitpick on asserting on the done callback and we're good to merge.

hackergrrl commented 8 years ago

Excellent -- LGTM! :star2:

ajoslin commented 8 years ago

🎉