Which is better way? committed one or below,

gulp.task('watch:less', function() {
  gulp.watch('src/themes/**/*.less', function(event){
    os=event.path.match(/themes\/(.*)\//)[1];
    less_for(os, osTypes.indexOf(os));
  });
});