interlockjs / interlock

JS bundler - inspired by Git, built on Babel.
MIT License
72 stars 7 forks source link

Constructor input validation #24

Closed baer closed 9 years ago

baer commented 9 years ago

PR to validate input for the Interlock constructor (#19)

baer commented 9 years ago

I'd like to propose that there be only one way to write config. Allowing Strings as the dest has already required you to write the 30 line normalizeOpts and will (potentially) require extra config in the validation logic.

options = {
  ...
  // Plural form indicates that it is a collection of entry points. 
  entryPoints: [{
    src: ""
    dest: ""
  }]
}
options = {
  ...
  // Plural form indicates that it is a collection of entry points. 
  entryPoints: {
    src: { dest: "" }
  }
}
divmain commented 9 years ago

@baer

Thanks!

baer commented 9 years ago

Fair enough - I'll get this wrapped up tomorrow.

divmain commented 9 years ago

Excellent. I'll be online intermittently this week, but will be checking in every once in awhile.

baer commented 9 years ago

@divmain - this is ready for another look. It's done but I left you two comments you should have a look at before you decide to merge/not merge. I left is as WIP until it's fully resolved.