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

delete unwanted options from map transforms #36

Merged
merged 1 commit into from
Mar 9, 2015

Conversation

Rich-Harris
Copy link
Contributor

This relates to babel/gobble-babel#2 - a map transform can specify default options like so:

function myTransform ( code, options ) {
  // ...
}

myTransform.defaults = {
  // we need these for some map transforms, but we don't want to
  // pass them through to the underlying library or otherwise use
  // it inside the transform
  accept: [ '.yaml', '.json' ],
  ext: '.js',

  // we probably *do* want this to be passed through
  somethingElse: 42
};

This changes the behaviour such that ext and accept are removed from the options object passed into the transform. (This might seem slightly arbitrary, but map transforms are already a layer of opinionation on top of 'standard' transforms, and the convenience outweighs the potential pain, IMO.)

Rich-Harris added a commit that referenced this pull request Mar 9, 2015
delete unwanted options from map transforms
@Rich-Harris Rich-Harris merged commit 5813202 into master Mar 9, 2015
@TrySound TrySound deleted the delete-unwanted-options branch June 2, 2016 20:26
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.

1 participant