-
Notifications
You must be signed in to change notification settings - Fork 278
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
Update lib/local-storage.js to ES2015 #242
base: master
Are you sure you want to change the base?
Update lib/local-storage.js to ES2015 #242
Conversation
Conflicts: dist/command.js dist/option.js lib/command.js
Rename variable from Vantage to Vorpal
Updated dev deps and switched to Yarn
Updated Inquirer to v3 and other prod deps
…values Support default values for options
Remove dist folder
…ig for Babel and ESLint.
Update babel/eslint build config
Convert commands to ES2015
I feel like this entire file can be removed. It's almost a 1:1 map of the native For example, this is the current code: vorpal.localStorage = function (id) {
var ls = Object.create(LocalStorage);
ls.setId(id);
_.extend(this.localStorage, ls);
return this;
}; Which can be changed to: vorpal.localStorage = function (id) {
if (!id) {
throw new Error('vorpal.localStorage() requires a unique key to be passed in.');
}
Object.assign(this.localStorage, new LocalStorage(DEFAULT_STORAGE_PATH + id));
return this;
}; I haven't tested it yet, but worth a shot. |
Agreed. Go for it. |
Sounds good to me. Seems like we can close this. @milesj Would you like to take a crack at reusing |
Yeah I can take a look at it. I'll leave this PR open in case it doesn't work. |
Tests and linter pass. Runs in Node without babel.