Skip to content

Commit

Permalink
Merge pull request #2860 from jgonggrijp/underscore-unwrap
Browse files Browse the repository at this point in the history
  • Loading branch information
jgonggrijp authored Jul 6, 2020
2 parents faac06d + a2c9f6d commit e6af0f9
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 42 deletions.
2 changes: 1 addition & 1 deletion modules/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,4 +194,4 @@ export { default as chunk } from './chunk.js';
// These modules support the "object-oriented" calling style. See also
// `underscore.js` and `index-default.js`.
export { default as mixin } from './mixin.js';
export { default } from './underscore-oop.js';
export { default } from './underscore-array-methods.js';
13 changes: 0 additions & 13 deletions modules/underscore-oop.js → modules/underscore-array-methods.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,4 @@ each(['concat', 'join', 'slice'], function(name) {
};
});

// Extracts the result from a wrapped and chained object.
_.prototype.value = function() {
return this._wrapped;
};

// Provide unwrapping proxies for some methods used in engine operations
// such as arithmetic and JSON stringification.
_.prototype.valueOf = _.prototype.toJSON = _.prototype.value;

_.prototype.toString = function() {
return String(this._wrapped);
};

export default _;
13 changes: 13 additions & 0 deletions modules/underscore.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,16 @@ export default function _(obj) {
}

_.VERSION = VERSION;

// Extracts the result from a wrapped and chained object.
_.prototype.value = function() {
return this._wrapped;
};

// Provide unwrapping proxies for some methods used in engine operations
// such as arithmetic and JSON stringification.
_.prototype.valueOf = _.prototype.toJSON = _.prototype.value;

_.prototype.toString = function() {
return String(this._wrapped);
};
26 changes: 13 additions & 13 deletions underscore-esm.js

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

2 changes: 1 addition & 1 deletion underscore-esm.js.map

Large diffs are not rendered by default.

26 changes: 13 additions & 13 deletions underscore.js

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

2 changes: 1 addition & 1 deletion underscore.js.map

Large diffs are not rendered by default.

0 comments on commit e6af0f9

Please sign in to comment.