Skip to content
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

Updated Bucky.coffee #34

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

sreevisakh
Copy link

It was not reading options provided in the script tag. because default value was overriding. in line 86

It was not reading options provided in the script tag. because default value was overriding. in line 86
@@ -83,7 +83,7 @@ exportDef = ->
else if tagOptions[key]?.toString().toLowerCase() is 'false'
tagOptions[key] = null

options = extend {}, defaults, tagOptions
options = extend {}, tagOptions, defaults
Copy link
Contributor

Choose a reason for hiding this comment

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

Either I'm crazy or extend is incorrectly implemented, b/c the original implementation absolutely should result in tagOptions overriding defaults.

Copy link
Member

Choose a reason for hiding this comment

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

Agreed with @zackbloom:

# Extend impl copied straight from Bucky (https://github.com/HubSpot/BuckyClient/blob/646ab9ebcbcaaab4e68c7fcbf66e109dd418b3b3/bucky.coffee#L18-L22https://github.com/HubSpot/BuckyClient/blob/646ab9ebcbcaaab4e68c7fcbf66e109dd418b3b3/bucky.coffee#L18-L22https://github.com/HubSpot/BuckyClient/blob/646ab9ebcbcaaab4e68c7fcbf66e109dd418b3b3/bucky.coffee#L18-L22)https://github.com/HubSpot/BuckyClient/blob/646ab9ebcbcaaab4e68c7fcbf66e109dd418b3b3/bucky.coffee#L18-L22)
extend = (a, objs...) ->
  for obj in objs
    for key, val of obj
      a[key] = val
  a

 console.log extend {}, { a: 1 }, { a: 2, b: 'other' }
 # => {a: 2, b: "other"}

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.

3 participants