Skip to content

Commit

Permalink
build
Browse files Browse the repository at this point in the history
  • Loading branch information
yeikos committed Nov 14, 2020
1 parent 0acaaf3 commit 80151be
Show file tree
Hide file tree
Showing 3 changed files with 135 additions and 183 deletions.
2 changes: 1 addition & 1 deletion dist/merge.browser.min.js

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

315 changes: 133 additions & 182 deletions dist/merge.browser.test.js
Original file line number Diff line number Diff line change
@@ -1,98 +1,102 @@
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ }
/******/ };
/******/
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ return ns;
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 0);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ (function(module, exports, __webpack_require__) {
/******/ (() => { // webpackBootstrap
/******/ "use strict";
/******/ var __webpack_modules__ = ({

/***/ 496:
/***/ ((module, exports) => {


Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.isPlainObject = exports.clone = exports.recursive = exports.merge = exports.main = void 0;
module.exports = exports = main;
exports.default = main;
function main() {
var items = [];
for (var _i = 0; _i < arguments.length; _i++) {
items[_i] = arguments[_i];
}
return merge.apply(void 0, items);
}
exports.main = main;
main.clone = clone;
main.isPlainObject = isPlainObject;
main.recursive = recursive;
function merge() {
var items = [];
for (var _i = 0; _i < arguments.length; _i++) {
items[_i] = arguments[_i];
}
return _merge(items[0] === true, false, items);
}
exports.merge = merge;
function recursive() {
var items = [];
for (var _i = 0; _i < arguments.length; _i++) {
items[_i] = arguments[_i];
}
return _merge(items[0] === true, true, items);
}
exports.recursive = recursive;
function clone(input) {
if (Array.isArray(input)) {
var output = [];
for (var index = 0; index < input.length; ++index)
output.push(clone(input[index]));
return output;
}
else if (isPlainObject(input)) {
var output = {};
for (var index in input)
output[index] = clone(input[index]);
return output;
}
else {
return input;
}
}
exports.clone = clone;
function isPlainObject(input) {
return input && typeof input === 'object' && !Array.isArray(input);
}
exports.isPlainObject = isPlainObject;
function _recursiveMerge(base, extend) {
if (!isPlainObject(base))
return extend;
for (var key in extend)
base[key] = (isPlainObject(base[key]) && isPlainObject(extend[key])) ?
_recursiveMerge(base[key], extend[key]) :
extend[key];
return base;
}
function _merge(isClone, isRecursive, items) {
var result;
if (isClone || !isPlainObject(result = items.shift()))
result = {};
for (var index = 0; index < items.length; ++index) {
var item = items[index];
if (!isPlainObject(item))
continue;
for (var key in item) {
if (key === '__proto__' || key === 'constructor' || key === 'prototype')
continue;
var value = isClone ? clone(item[key]) : item[key];
result[key] = isRecursive ? _recursiveMerge(result[key], value) : value;
}
}
return result;
}


/***/ }),

/***/ 186:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
var __webpack_unused_export__;

Object.defineProperty(exports, "__esModule", { value: true });
var chai_1 = __webpack_require__(1);
var index_1 = __webpack_require__(2);
__webpack_unused_export__ = ({ value: true });
var chai_1 = __webpack_require__(153);
var index_1 = __webpack_require__(496);
describe('merge', function () {
it('basic', function () {
chai_1.assert.deepEqual(index_1.default({ a: 1 }, { b: 2 }), { a: 1, b: 2 });
Expand Down Expand Up @@ -195,96 +199,43 @@ describe('merge.recursive', function () {


/***/ }),
/* 1 */
/***/ (function(module, exports) {

module.exports = chai;

/***/ }),
/* 2 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

Object.defineProperty(exports, "__esModule", { value: true });
module.exports = exports = main;
exports.default = main;
function main() {
var items = [];
for (var _i = 0; _i < arguments.length; _i++) {
items[_i] = arguments[_i];
}
return merge.apply(void 0, items);
}
exports.main = main;
main.clone = clone;
main.isPlainObject = isPlainObject;
main.recursive = recursive;
function merge() {
var items = [];
for (var _i = 0; _i < arguments.length; _i++) {
items[_i] = arguments[_i];
}
return _merge(items[0] === true, false, items);
}
exports.merge = merge;
function recursive() {
var items = [];
for (var _i = 0; _i < arguments.length; _i++) {
items[_i] = arguments[_i];
}
return _merge(items[0] === true, true, items);
}
exports.recursive = recursive;
function clone(input) {
if (Array.isArray(input)) {
var output = [];
for (var index = 0; index < input.length; ++index)
output.push(clone(input[index]));
return output;
}
else if (isPlainObject(input)) {
var output = {};
for (var index in input)
output[index] = clone(input[index]);
return output;
}
else {
return input;
}
}
exports.clone = clone;
function isPlainObject(input) {
return input && typeof input === 'object' && !Array.isArray(input);
}
exports.isPlainObject = isPlainObject;
function _recursiveMerge(base, extend) {
if (!isPlainObject(base))
return extend;
for (var key in extend)
base[key] = (isPlainObject(base[key]) && isPlainObject(extend[key])) ?
_recursiveMerge(base[key], extend[key]) :
extend[key];
return base;
}
function _merge(isClone, isRecursive, items) {
var result;
if (isClone || !isPlainObject(result = items.shift()))
result = {};
for (var index = 0; index < items.length; ++index) {
var item = items[index];
if (!isPlainObject(item))
continue;
for (var key in item) {
if (key === '__proto__' || key === 'constructor' || key === 'prototype')
continue;
var value = isClone ? clone(item[key]) : item[key];
result[key] = isRecursive ? _recursiveMerge(result[key], value) : value;
}
}
return result;
}
/***/ 153:
/***/ ((module) => {

module.exports = chai;

/***/ })
/******/ ]);

/******/ });
/************************************************************************/
/******/ // The module cache
/******/ var __webpack_module_cache__ = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ if(__webpack_module_cache__[moduleId]) {
/******/ return __webpack_module_cache__[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = __webpack_module_cache__[moduleId] = {
/******/ // no module.id needed
/******/ // no module.loaded needed
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/************************************************************************/
/******/ // startup
/******/ // Load entry module
/******/ __webpack_require__(186);
/******/ // This entry module used 'exports' so it can't be inlined
/******/ })()
;
1 change: 1 addition & 0 deletions lib/src/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isPlainObject = exports.clone = exports.recursive = exports.merge = exports.main = void 0;
module.exports = exports = main;
exports.default = main;
function main() {
Expand Down

0 comments on commit 80151be

Please sign in to comment.