Skip to content

Removes Underscore dependency #100

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

Merged
merged 2 commits into from
Feb 13, 2018
Merged

Removes Underscore dependency #100

merged 2 commits into from
Feb 13, 2018

Conversation

grant
Copy link
Contributor

@grant grant commented Feb 8, 2018

Goal:

  • Remove 1548 lines of Apps Script to improve library parse + load time.
  • Remove copypasted [email protected] library from scm.

This PR:

  • Removes _ with gulpfile/package.json references
  • Use native util methods over _
    • Remove isEmpty_
  • Regens docs

Feel free to comment or modify.

@@ -39,24 +39,12 @@ function buildUrl_(url, params) {
function validate_(params) {
Object.keys(params).forEach(function(name) {
var value = params[name];
if (isEmpty_(value)) {
if (!value) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not functionally equivalent to isEmpty_(), but I don't think any of my validations rely on detecting empty arrays or objects.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point.

@erickoledadevrel
Copy link
Contributor

Thanks for the PR! Service.gs still uses _.extend() in a number of places however, and you'll need to find a replacement for that.

@grant
Copy link
Contributor Author

grant commented Feb 13, 2018

PTAL.

  • Added extend_()
    • Note: Only accepts 2 objects
    • Added Utility tests for this method
npm run test

> mocha
  Service
    #getToken()
       should load from the in-memory store
       should load from the cache and set the in-memory store
       should load from the properties and set the cache and in-memory store
    #saveToken_()
       should save the token to the properties, cache, and in-memory store
    #reset()
       should delete the token from properties, cache, and in-memory store

  Utilities
    #extend_()
       should extend (left) an object
       should extend (right) an object
       should extend (merge) an object


  8 passing (10ms)

@erickoledadevrel erickoledadevrel merged commit f75c066 into googleworkspace:master Feb 13, 2018
@erickoledadevrel
Copy link
Contributor

Looks great, thanks Grant!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants