-
Notifications
You must be signed in to change notification settings - Fork 280
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
types for localstorage wrong #352
Comments
I was experiencing this issue (.getItem is not a function). My mistake was assuming that Doesn't work: ...
vorpal.localStorage("test").getItem("t")
If you look at the src of the localStorage function: vorpal.localStorage = function (id) {
var ls = Object.create(LocalStorage);
ls.setId(id);
_.extend(this.localStorage, ls);
return this;
}; when called it extends the localStorage instance but returns the vorpal instance, meaning that to make that one-liner work, you'd need to access localStorage again after calling it as a function: vorpal.localStorage("test").localStorage.getItem("t") Not just returning the vorpal
.delimiter('test$')
.localStorage("test")
.show();
vorpal.localStorage.getItem("t") tl;dr: You can't chain |
vorpal.localstorage has wrong type on the instance. It does not have setItem and getItem
The text was updated successfully, but these errors were encountered: