Skip to content

Commit

Permalink
Merge pull request #5 from AO16/moment-namespace
Browse files Browse the repository at this point in the history
Moment namespace
  • Loading branch information
rjhilgefort committed Dec 4, 2015
2 parents d090bcf + 87ddf10 commit 7d7693c
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 9 deletions.
34 changes: 27 additions & 7 deletions dist/lodash-extras.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/lodash-extras.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ _.mixin(lodashExtras);

// Only mixin moment-extras if available
import lodashMoment from './lodash-moment';
if (_.isPresent(window.moment)) _.mixin(lodashMoment);
if (_.isPresent(window.moment)) _.moment = lodashMoment;

// Only mixin ember-extras if available
import lodashEmber from './lodash-ember';
Expand Down
17 changes: 17 additions & 0 deletions src/lodash-moment.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/**
* This utility assumes `Ember` exists globally
*/
import lodashUtils from './_core/lodash-utils';


/**
* Collection of all the utils in here. Add to this as you go.
*/
Expand Down Expand Up @@ -37,4 +43,15 @@ export var ensureMoment = (value, valueDefault) => {
lodashMoment.ensureMoment = ensureMoment;


/**
* Generate deep `is` methods and override standard methods to handle both
*
* @method is{Condition}
* @param {Object} value: Base value to look through
* @param {String} propString: Property string to apply to `get`
* @return {Boolean}
*/
lodashUtils.buildIsMethods(lodashMoment, lodashMoment);


export default lodashMoment;

0 comments on commit 7d7693c

Please sign in to comment.