Skip to content

Instantly share code, notes, and snippets.

@SukantGujar
Created May 15, 2017 07:41
Show Gist options
  • Save SukantGujar/51cdff317210b760248ace574d4ab9fa to your computer and use it in GitHub Desktop.
Save SukantGujar/51cdff317210b760248ace574d4ab9fa to your computer and use it in GitHub Desktop.
Prepack experiment main.bundle.js
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory();
else if(typeof define === 'function' && define.amd)
define([], factory);
else if(typeof exports === 'object')
exports["logger"] = factory();
else
root["prepack-experiments"] = root["prepack-experiments"] || {}, root["prepack-experiments"]["logger"] = factory();
})(this, function() {
return /******/ (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;
/******/
/******/ // identity function for calling harmony imports with the correct context
/******/ __webpack_require__.i = function(value) { return value; };
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, {
/******/ configurable: false,
/******/ enumerable: true,
/******/ get: getter
/******/ });
/******/ }
/******/ };
/******/
/******/ // 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 = 6);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ (function(module, exports, __webpack_require__) {
var _isPlaceholder = __webpack_require__(1);
/**
* Optimized internal one-arity curry function.
*
* @private
* @category Function
* @param {Function} fn The function to curry.
* @return {Function} The curried function.
*/
module.exports = function _curry1(fn) {
return function f1(a) {
if (arguments.length === 0 || _isPlaceholder(a)) {
return f1;
} else {
return fn.apply(this, arguments);
}
};
};
/***/ }),
/* 1 */
/***/ (function(module, exports) {
module.exports = function _isPlaceholder(a) {
return a != null &&
typeof a === 'object' &&
a['@@functional/placeholder'] === true;
};
/***/ }),
/* 2 */
/***/ (function(module, exports, __webpack_require__) {
var _curry1 = __webpack_require__(0);
var _isPlaceholder = __webpack_require__(1);
/**
* Optimized internal two-arity curry function.
*
* @private
* @category Function
* @param {Function} fn The function to curry.
* @return {Function} The curried function.
*/
module.exports = function _curry2(fn) {
return function f2(a, b) {
switch (arguments.length) {
case 0:
return f2;
case 1:
return _isPlaceholder(a) ? f2
: _curry1(function(_b) { return fn(a, _b); });
default:
return _isPlaceholder(a) && _isPlaceholder(b) ? f2
: _isPlaceholder(a) ? _curry1(function(_a) { return fn(_a, b); })
: _isPlaceholder(b) ? _curry1(function(_b) { return fn(a, _b); })
: fn(a, b);
}
};
};
/***/ }),
/* 3 */
/***/ (function(module, exports) {
module.exports = function _has(prop, obj) {
return Object.prototype.hasOwnProperty.call(obj, prop);
};
/***/ }),
/* 4 */
/***/ (function(module, exports, __webpack_require__) {
var _curry1 = __webpack_require__(0);
var _has = __webpack_require__(3);
var _isArguments = __webpack_require__(10);
/**
* Returns a list containing the names of all the enumerable own properties of
* the supplied object.
* Note that the order of the output array is not guaranteed to be consistent
* across different JS platforms.
*
* @func
* @memberOf R
* @since v0.1.0
* @category Object
* @sig {k: v} -> [k]
* @param {Object} obj The object to extract properties from
* @return {Array} An array of the object's own properties.
* @example
*
* R.keys({a: 1, b: 2, c: 3}); //=> ['a', 'b', 'c']
*/
module.exports = (function() {
// cover IE < 9 keys issues
var hasEnumBug = !({toString: null}).propertyIsEnumerable('toString');
var nonEnumerableProps = ['constructor', 'valueOf', 'isPrototypeOf', 'toString',
'propertyIsEnumerable', 'hasOwnProperty', 'toLocaleString'];
// Safari bug
var hasArgsEnumBug = (function() {
'use strict';
return arguments.propertyIsEnumerable('length');
}());
var contains = function contains(list, item) {
var idx = 0;
while (idx < list.length) {
if (list[idx] === item) {
return true;
}
idx += 1;
}
return false;
};
return typeof Object.keys === 'function' && !hasArgsEnumBug ?
_curry1(function keys(obj) {
return Object(obj) !== obj ? [] : Object.keys(obj);
}) :
_curry1(function keys(obj) {
if (Object(obj) !== obj) {
return [];
}
var prop, nIdx;
var ks = [];
var checkArgsLength = hasArgsEnumBug && _isArguments(obj);
for (prop in obj) {
if (_has(prop, obj) && (!checkArgsLength || prop !== 'length')) {
ks[ks.length] = prop;
}
}
if (hasEnumBug) {
nIdx = nonEnumerableProps.length - 1;
while (nIdx >= 0) {
prop = nonEnumerableProps[nIdx];
if (_has(prop, obj) && !contains(ks, prop)) {
ks[ks.length] = prop;
}
nIdx -= 1;
}
}
return ks;
});
}());
/***/ }),
/* 5 */
/***/ (function(module, exports, __webpack_require__) {
var _curry3 = __webpack_require__(9);
var _reduce = __webpack_require__(13);
/**
* Returns a single item by iterating through the list, successively calling
* the iterator function and passing it an accumulator value and the current
* value from the array, and then passing the result to the next call.
*
* The iterator function receives two values: *(acc, value)*. It may use
* `R.reduced` to shortcut the iteration.
*
* The arguments' order of `reduceRight`'s iterator function is *(value, acc)*.
*
* Note: `R.reduce` does not skip deleted or unassigned indices (sparse
* arrays), unlike the native `Array.prototype.reduce` method. For more details
* on this behavior, see:
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce#Description
*
* Dispatches to the `reduce` method of the third argument, if present.
*
* @func
* @memberOf R
* @since v0.1.0
* @category List
* @sig ((a, b) -> a) -> a -> [b] -> a
* @param {Function} fn The iterator function. Receives two values, the accumulator and the
* current element from the array.
* @param {*} acc The accumulator value.
* @param {Array} list The list to iterate over.
* @return {*} The final, accumulated value.
* @see R.reduced, R.addIndex, R.reduceRight
* @example
*
* R.reduce(R.subtract, 0, [1, 2, 3, 4]) // => ((((0 - 1) - 2) - 3) - 4) = -10
* - -10
* / \ / \
* - 4 -6 4
* / \ / \
* - 3 ==> -3 3
* / \ / \
* - 2 -1 2
* / \ / \
* 0 1 0 1
*
* @symb R.reduce(f, a, [b, c, d]) = f(f(f(a, b), c), d)
*/
module.exports = _curry3(_reduce);
/***/ }),
/* 6 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var _reduce = __webpack_require__(5);
var _reduce2 = _interopRequireDefault(_reduce);
var _keys = __webpack_require__(4);
var _keys2 = _interopRequireDefault(_keys);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var log = function log(target) {
return function (level) {
return function (message) {
return target[level](message);
};
};
};
var Logger = function Logger(target) {
var _this = this;
_classCallCheck(this, Logger);
this.LOG_STATUS_FLAGS = (0, _reduce2.default)(function (p, v) {
return Object.assign({}, p, _defineProperty({}, v, v));
}, {}, ["ERROR", "WARN", "INFO", "DEBUG", "SILLY"].map(function (x) {
return x.toLowerCase();
}));
this.target = target;
(0, _reduce2.default)(function (p, v) {
return Object.assign(p, _defineProperty({}, v, log(_this.target)(v)));
}, this, (0, _keys2.default)(this.LOG_STATUS_FLAGS));
};
;
module.exports = Object.assign({}, new Logger(console));
/***/ }),
/* 7 */
/***/ (function(module, exports, __webpack_require__) {
var _arity = __webpack_require__(8);
var _curry2 = __webpack_require__(2);
/**
* Creates a function that is bound to a context.
* Note: `R.bind` does not provide the additional argument-binding capabilities of
* [Function.prototype.bind](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind).
*
* @func
* @memberOf R
* @since v0.6.0
* @category Function
* @category Object
* @sig (* -> *) -> {*} -> (* -> *)
* @param {Function} fn The function to bind to context
* @param {Object} thisObj The context to bind `fn` to
* @return {Function} A function that will execute in the context of `thisObj`.
* @see R.partial
* @example
*
* var log = R.bind(console.log, console);
* R.pipe(R.assoc('a', 2), R.tap(log), R.assoc('a', 3))({a: 1}); //=> {a: 3}
* // logs {a: 2}
* @symb R.bind(f, o)(a, b) = f.call(o, a, b)
*/
module.exports = _curry2(function bind(fn, thisObj) {
return _arity(fn.length, function() {
return fn.apply(thisObj, arguments);
});
});
/***/ }),
/* 8 */
/***/ (function(module, exports) {
module.exports = function _arity(n, fn) {
/* eslint-disable no-unused-vars */
switch (n) {
case 0: return function() { return fn.apply(this, arguments); };
case 1: return function(a0) { return fn.apply(this, arguments); };
case 2: return function(a0, a1) { return fn.apply(this, arguments); };
case 3: return function(a0, a1, a2) { return fn.apply(this, arguments); };
case 4: return function(a0, a1, a2, a3) { return fn.apply(this, arguments); };
case 5: return function(a0, a1, a2, a3, a4) { return fn.apply(this, arguments); };
case 6: return function(a0, a1, a2, a3, a4, a5) { return fn.apply(this, arguments); };
case 7: return function(a0, a1, a2, a3, a4, a5, a6) { return fn.apply(this, arguments); };
case 8: return function(a0, a1, a2, a3, a4, a5, a6, a7) { return fn.apply(this, arguments); };
case 9: return function(a0, a1, a2, a3, a4, a5, a6, a7, a8) { return fn.apply(this, arguments); };
case 10: return function(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9) { return fn.apply(this, arguments); };
default: throw new Error('First argument to _arity must be a non-negative integer no greater than ten');
}
};
/***/ }),
/* 9 */
/***/ (function(module, exports, __webpack_require__) {
var _curry1 = __webpack_require__(0);
var _curry2 = __webpack_require__(2);
var _isPlaceholder = __webpack_require__(1);
/**
* Optimized internal three-arity curry function.
*
* @private
* @category Function
* @param {Function} fn The function to curry.
* @return {Function} The curried function.
*/
module.exports = function _curry3(fn) {
return function f3(a, b, c) {
switch (arguments.length) {
case 0:
return f3;
case 1:
return _isPlaceholder(a) ? f3
: _curry2(function(_b, _c) { return fn(a, _b, _c); });
case 2:
return _isPlaceholder(a) && _isPlaceholder(b) ? f3
: _isPlaceholder(a) ? _curry2(function(_a, _c) { return fn(_a, b, _c); })
: _isPlaceholder(b) ? _curry2(function(_b, _c) { return fn(a, _b, _c); })
: _curry1(function(_c) { return fn(a, b, _c); });
default:
return _isPlaceholder(a) && _isPlaceholder(b) && _isPlaceholder(c) ? f3
: _isPlaceholder(a) && _isPlaceholder(b) ? _curry2(function(_a, _b) { return fn(_a, _b, c); })
: _isPlaceholder(a) && _isPlaceholder(c) ? _curry2(function(_a, _c) { return fn(_a, b, _c); })
: _isPlaceholder(b) && _isPlaceholder(c) ? _curry2(function(_b, _c) { return fn(a, _b, _c); })
: _isPlaceholder(a) ? _curry1(function(_a) { return fn(_a, b, c); })
: _isPlaceholder(b) ? _curry1(function(_b) { return fn(a, _b, c); })
: _isPlaceholder(c) ? _curry1(function(_c) { return fn(a, b, _c); })
: fn(a, b, c);
}
};
};
/***/ }),
/* 10 */
/***/ (function(module, exports, __webpack_require__) {
var _has = __webpack_require__(3);
module.exports = (function() {
var toString = Object.prototype.toString;
return toString.call(arguments) === '[object Arguments]' ?
function _isArguments(x) { return toString.call(x) === '[object Arguments]'; } :
function _isArguments(x) { return _has('callee', x); };
}());
/***/ }),
/* 11 */
/***/ (function(module, exports) {
/**
* Tests whether or not an object is an array.
*
* @private
* @param {*} val The object to test.
* @return {Boolean} `true` if `val` is an array, `false` otherwise.
* @example
*
* _isArray([]); //=> true
* _isArray(null); //=> false
* _isArray({}); //=> false
*/
module.exports = Array.isArray || function _isArray(val) {
return (val != null &&
val.length >= 0 &&
Object.prototype.toString.call(val) === '[object Array]');
};
/***/ }),
/* 12 */
/***/ (function(module, exports) {
module.exports = function _isString(x) {
return Object.prototype.toString.call(x) === '[object String]';
};
/***/ }),
/* 13 */
/***/ (function(module, exports, __webpack_require__) {
var _xwrap = __webpack_require__(14);
var bind = __webpack_require__(7);
var isArrayLike = __webpack_require__(15);
module.exports = (function() {
function _arrayReduce(xf, acc, list) {
var idx = 0;
var len = list.length;
while (idx < len) {
acc = xf['@@transducer/step'](acc, list[idx]);
if (acc && acc['@@transducer/reduced']) {
acc = acc['@@transducer/value'];
break;
}
idx += 1;
}
return xf['@@transducer/result'](acc);
}
function _iterableReduce(xf, acc, iter) {
var step = iter.next();
while (!step.done) {
acc = xf['@@transducer/step'](acc, step.value);
if (acc && acc['@@transducer/reduced']) {
acc = acc['@@transducer/value'];
break;
}
step = iter.next();
}
return xf['@@transducer/result'](acc);
}
function _methodReduce(xf, acc, obj) {
return xf['@@transducer/result'](obj.reduce(bind(xf['@@transducer/step'], xf), acc));
}
var symIterator = (typeof Symbol !== 'undefined') ? Symbol.iterator : '@@iterator';
return function _reduce(fn, acc, list) {
if (typeof fn === 'function') {
fn = _xwrap(fn);
}
if (isArrayLike(list)) {
return _arrayReduce(fn, acc, list);
}
if (typeof list.reduce === 'function') {
return _methodReduce(fn, acc, list);
}
if (list[symIterator] != null) {
return _iterableReduce(fn, acc, list[symIterator]());
}
if (typeof list.next === 'function') {
return _iterableReduce(fn, acc, list);
}
throw new TypeError('reduce: list must be array or iterable');
};
}());
/***/ }),
/* 14 */
/***/ (function(module, exports) {
module.exports = (function() {
function XWrap(fn) {
this.f = fn;
}
XWrap.prototype['@@transducer/init'] = function() {
throw new Error('init not implemented on XWrap');
};
XWrap.prototype['@@transducer/result'] = function(acc) { return acc; };
XWrap.prototype['@@transducer/step'] = function(acc, x) {
return this.f(acc, x);
};
return function _xwrap(fn) { return new XWrap(fn); };
}());
/***/ }),
/* 15 */
/***/ (function(module, exports, __webpack_require__) {
var _curry1 = __webpack_require__(0);
var _isArray = __webpack_require__(11);
var _isString = __webpack_require__(12);
/**
* Tests whether or not an object is similar to an array.
*
* @func
* @memberOf R
* @since v0.5.0
* @category Type
* @category List
* @sig * -> Boolean
* @param {*} x The object to test.
* @return {Boolean} `true` if `x` has a numeric length property and extreme indices defined; `false` otherwise.
* @deprecated since v0.23.0
* @example
*
* R.isArrayLike([]); //=> true
* R.isArrayLike(true); //=> false
* R.isArrayLike({}); //=> false
* R.isArrayLike({length: 10}); //=> false
* R.isArrayLike({0: 'zero', 9: 'nine', length: 10}); //=> true
*/
module.exports = _curry1(function isArrayLike(x) {
if (_isArray(x)) { return true; }
if (!x) { return false; }
if (typeof x !== 'object') { return false; }
if (_isString(x)) { return false; }
if (x.nodeType === 1) { return !!x.length; }
if (x.length === 0) { return true; }
if (x.length > 0) {
return x.hasOwnProperty(0) && x.hasOwnProperty(x.length - 1);
}
return false;
});
/***/ })
/******/ ]);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment