Skip to content

Commit

Permalink
Add isGenerator and isGeneratorFunction. Bump dependencies.
Browse files Browse the repository at this point in the history
  • Loading branch information
brianneisler committed Aug 12, 2016
1 parent d01059a commit f538ce1
Show file tree
Hide file tree
Showing 183 changed files with 637 additions and 628 deletions.
7 changes: 3 additions & 4 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,17 @@
"comma-dangle": [2, "never"],
"curly": 2,
"eol-last": 2,
"id-length": [2, {"min": 2, "max": 50, "properties": "never", "exceptions": ["i", "x", "_"]}],
"generator-star-spacing": [2, "after"],
"id-length": [2, {"min": 2, "max": 50, "properties": "never", "exceptions": ["e", "i", "x", "_"]}],
"indent": [2, 2, {"SwitchCase": 1}],
"no-alert": 2,
"no-console": 2,
"no-const-assign": 2,
"no-else-return": 2,
"no-shadow": 2,
"no-unused-vars": 2,
"no-var": 2,
"prefer-const": 2,
"quotes": [2, "single"],
"semi": [2, "always"],
"semi": [2, "never"],
"spaced-comment": 0,
"strict": [2, "never"]
}
Expand Down
68 changes: 37 additions & 31 deletions gulpfile.babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
// Imports
//-------------------------------------------------------------------------------

import gulp from 'gulp';
import babel from 'gulp-babel';
import eslint from 'gulp-eslint';
import mocha from 'gulp-mocha';
import sourcemaps from 'gulp-sourcemaps';
import util from 'gulp-util';
import del from 'del';
import babelRegister from 'babel-core/register';
import gulp from 'gulp'
import babel from 'gulp-babel'
import eslint from 'gulp-eslint'
import mocha from 'gulp-mocha'
import sourcemaps from 'gulp-sourcemaps'
import util from 'gulp-util'
import del from 'del'
import babelRegister from 'babel-core/register'


//-------------------------------------------------------------------------------
Expand All @@ -21,20 +21,20 @@ const sources = {
'src/**',
'!**/tests/**'
]
};
}


//-------------------------------------------------------------------------------
// Gulp Tasks
//-------------------------------------------------------------------------------

gulp.task('default', ['prod']);
gulp.task('default', ['prod'])

gulp.task('prod', ['babel']);
gulp.task('prod', ['babel'])

gulp.task('dev', ['babel', 'lint', 'babel-watch', 'lint-watch']);
gulp.task('dev', ['babel', 'lint', 'babel-watch', 'lint-watch'])

gulp.task('test', ['lint', 'mocha']);
gulp.task('test', ['lint', 'mocha'])

gulp.task('babel', function() {
return gulp.src(sources.babel)
Expand All @@ -47,9 +47,9 @@ gulp.task('babel', function() {
.pipe(sourcemaps.write('./'))
.pipe(gulp.dest('./dist'))
.on('error', (error) => {
util.log(error);
});
});
util.log(error)
})
})

gulp.task('lint', () => {
return gulp.src([
Expand All @@ -61,9 +61,9 @@ gulp.task('lint', () => {
.pipe(eslint.formatEach())
.pipe(eslint.failOnError())
.on('error', function (error) {
util.log('Stream Exiting With Error', error);
});
});
util.log('Stream Exiting With Error', error)
})
})

gulp.task('mocha', () => {
return gulp.src([
Expand All @@ -75,35 +75,41 @@ gulp.task('mocha', () => {
compilers: {
js: babelRegister
}
}));
});
}))
})

gulp.task('clean', () => {
return del([
'dist'
]);
});
])
})

gulp.task('cleanse', () => {
return del([
'node_modules'
])
})


//-------------------------------------------------------------------------------
// Gulp Watchers
//-------------------------------------------------------------------------------

gulp.task('babel-watch', function() {
gulp.watch(sources.babel, ['babel']);
});
gulp.watch(sources.babel, ['babel'])
})

gulp.task('lint-watch', function() {
const lintAndPrint = eslint();
lintAndPrint.pipe(eslint.formatEach());
const lintAndPrint = eslint()
lintAndPrint.pipe(eslint.formatEach())

return gulp.watch('src/**/*.js', function (event) {
if (event.type !== 'deleted') {
gulp.src(event.path)
.pipe(lintAndPrint, {end: false})
.on('error', function (error) {
util.log(error);
});
util.log(error)
})
}
});
});
})
})
8 changes: 3 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
Error.stackTraceLimit=Infinity;

var _ = require('lodash'); //eslint-disable-line no-var
var lodash = _.runInContext(); //eslint-disable-line no-var
module.exports = lodash.mixin(require('./dist'));
var _ = require('lodash') //eslint-disable-line no-var
var lodash = _.runInContext() //eslint-disable-line no-var
module.exports = lodash.mixin(require('./dist'))
32 changes: 17 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,33 +14,35 @@
"homepage": "https://github.com/brianneisler/mudash#readme",
"scripts": {
"clean": "gulp clean",
"cleanse": "gulp cleanse",
"dev": "gulp dev",
"test": "gulp test"
},
"dependencies": {
"es6-symbol": "^3.1.0",
"immutable": "^3.7.6",
"immutable-devtools": "^0.0.7",
"lodash": "^4.13.1"
"immutable": "^3.8.1",
"is-generator": "^1.0.3",
"lodash": "^4.15.0"
},
"devDependencies": {
"babel-core": "^6.9.1",
"babel-eslint": "^6.0.4",
"babel-polyfill": "6.9.1",
"babel-preset-es2015": "^6.9.0",
"babel-preset-stage-1": "^6.5.0",
"babel-preset-stage-2": "^6.5.0",
"bluebird": "^3.4.0",
"babel-core": "^6.13.2",
"babel-eslint": "^6.1.2",
"babel-polyfill": "6.13.0",
"babel-preset-es2015": "^6.13.2",
"babel-preset-stage-1": "^6.13.0",
"babel-preset-stage-2": "^6.13.0",
"bluebird": "^3.4.1",
"chai": "^3.5.0",
"del": "^2.2.0",
"eslint": "^2.10.2",
"del": "^2.2.1",
"eslint": "^3.2.2",
"gulp": "^3.9.1",
"gulp-babel": "^6.1.2",
"gulp-eslint": "^2.0.0",
"gulp-mocha": "^2.2.0",
"gulp-eslint": "^3.0.1",
"gulp-mocha": "^3.0.0",
"gulp-recipe": "0.0.2",
"gulp-sourcemaps": "^1.6.0",
"gulp-util": "^3.0.7"
"gulp-util": "^3.0.7",
"immutable-devtools": "^0.0.7"
},
"license": "MIT",
"keywords": [
Expand Down
4 changes: 2 additions & 2 deletions src/apply.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import _ from 'lodash';
import _ from 'lodash'

export default function apply(method, args) {
return _.isFunction(method) ? method.apply(null, args) : null;
return _.isFunction(method) ? method.apply(null, args) : null
}
4 changes: 2 additions & 2 deletions src/assign.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
import { _hint } from './util';
export default _hint('assign', true);
import { _hint } from './util'
export default _hint('assign', true)
2 changes: 1 addition & 1 deletion src/baseGet.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { baseGet as default } from './core';
export { baseGet as default } from './core'
2 changes: 1 addition & 1 deletion src/baseHas.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { baseHas as default } from './core';
export { baseHas as default } from './core'
2 changes: 1 addition & 1 deletion src/baseSet.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { baseSet as default } from './core';
export { baseSet as default } from './core'
8 changes: 4 additions & 4 deletions src/butLast.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { _hint } from './util';
import compose from './compose';
import iterable from './iterable';
import { _hint } from './util'
import compose from './compose'
import iterable from './iterable'

export default compose(_hint('butLast'), iterable);
export default compose(_hint('butLast'), iterable)
4 changes: 2 additions & 2 deletions src/call.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import apply from './apply';
import apply from './apply'

export default function call(method, ...args) {
return apply(method, args);
return apply(method, args)
}
4 changes: 2 additions & 2 deletions src/chunk.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import { _hint } from './util';
import { _hint } from './util'

export default _hint('chunk');
export default _hint('chunk')
4 changes: 2 additions & 2 deletions src/clone.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import { _hint } from './util';
import { _hint } from './util'

export default _hint('clone');
export default _hint('clone')
6 changes: 3 additions & 3 deletions src/cloneDeep.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import _ from 'lodash';
import { deepClone } from './customizers';
import _ from 'lodash'
import { deepClone } from './customizers'

export default function cloneDeep(data) {
return _.cloneDeepWith(data, deepClone);
return _.cloneDeepWith(data, deepClone)
}
6 changes: 3 additions & 3 deletions src/cloneDeepWith.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import _ from 'lodash';
import { deepClone } from './composers';
import _ from 'lodash'
import { deepClone } from './composers'

export default function cloneDeepWith(data, customizer) {
return _.cloneDeepWith(data, deepClone(customizer));
return _.cloneDeepWith(data, deepClone(customizer))
}
4 changes: 2 additions & 2 deletions src/cloneWith.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import { _hint } from './util';
import { _hint } from './util'

export default _hint('cloneWith');
export default _hint('cloneWith')
4 changes: 2 additions & 2 deletions src/compact.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import { _hint } from './util';
import { _hint } from './util'

export default _hint('compact');
export default _hint('compact')
10 changes: 5 additions & 5 deletions src/compose.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
export default function compose(...funcs) {
if (funcs.length === 0) {
return arg => arg;
return arg => arg
}

if (funcs.length === 1) {
return funcs[0];
return funcs[0]
}

const last = funcs[funcs.length - 1];
const rest = funcs.slice(0, -1);
return (...args) => rest.reduceRight((composed, func) => func(composed), last(...args));
const last = funcs[funcs.length - 1]
const rest = funcs.slice(0, -1)
return (...args) => rest.reduceRight((composed, func) => func(composed), last(...args))
}
18 changes: 9 additions & 9 deletions src/composers/deepClone.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
import _ from 'lodash';
import { isImmutable } from '../core';
import _ from 'lodash'
import { isImmutable } from '../core'

export default function deepClone(customizer) {
const cloner = (data, key, object) => {
if (_.isFunction(customizer)) {
const result = customizer(data, key, object);
const result = customizer(data, key, object)
if (!_.isUndefined(result)) {
return result;
return result
}
}
if (isImmutable(data)) {
data.forEach((value, _key) => {
data = data.set(_key, _.cloneDeepWith(value, cloner));
});
return data;
data = data.set(_key, _.cloneDeepWith(value, cloner))
})
return data
}
};
return cloner;
}
return cloner
}
6 changes: 3 additions & 3 deletions src/composers/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export { default as deepClone } from './deepClone';
export { default as keyIn } from './keyIn';
export { default as property } from './property';
export { default as deepClone } from './deepClone'
export { default as keyIn } from './keyIn'
export { default as property } from './property'
8 changes: 4 additions & 4 deletions src/composers/keyIn.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import Immutable from 'immutable';
import Immutable from 'immutable'

export function keyIn(keys) {
const keySet = Immutable.Set(keys);
const keySet = Immutable.Set(keys)
return (value, key) => {
return keySet.has(key);
};
return keySet.has(key)
}
}
6 changes: 3 additions & 3 deletions src/composers/property.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { get } from '../core';
import { get } from '../core'
export default function property(path) {
return (data) => {
return get(data, path);
};
return get(data, path)
}
}
4 changes: 2 additions & 2 deletions src/concat.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import { _hint } from './util';
import { _hint } from './util'

export default _hint('concat');
export default _hint('concat')
2 changes: 1 addition & 1 deletion src/constants/INFINITY.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export default 1 / 0;
export default 1 / 0
2 changes: 1 addition & 1 deletion src/constants/MAX_SAFE_INTEGER.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export default 9007199254740991;
export default 9007199254740991
4 changes: 2 additions & 2 deletions src/constants/index.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export { default as INFINITY } from './INFINITY';
export { default as MAX_SAFE_INTEGER } from './MAX_SAFE_INTEGER';
export { default as INFINITY } from './INFINITY'
export { default as MAX_SAFE_INTEGER } from './MAX_SAFE_INTEGER'
Loading

0 comments on commit f538ce1

Please sign in to comment.