immutable-devtools
Advanced tools
Comparing version 0.0.0 to 0.0.1
@@ -1,1 +0,250 @@ | ||
!function(n){function e(r){if(t[r])return t[r].exports;var o=t[r]={exports:{},id:r,loaded:!1};return n[r].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var t={};return e.m=n,e.c=t,e.p="",e(0)}([function(n,e,t){"use strict";function r(n){return n&&n.__esModule?n:{"default":n}}function o(n){return n&&"undefined"!=typeof Symbol&&n.constructor===Symbol?"symbol":typeof n}function u(n){if(void 0===("undefined"==typeof window?"undefined":o(window)))throw new Error("Can only install immutable-devtools in a browser environment.");i!==!0&&(window.devtoolsFormatters=window.devtoolsFormatters||[],window.devtoolsFormatters.push((0,d["default"])(n)),i=!0)}Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=u;var a=t(1),d=r(a),i=!1;"undefined"!=typeof Immutable&&(Immutable.installDevTools=u.bind(null,Immutable))},function(n,e){"use strict";function t(n){if(Array.isArray(n)){for(var e=0,t=Array(n.length);e<n.length;e++)t[e]=n[e];return t}return Array.from(n)}function r(n){function e(n,e){return["object",{object:n,config:e}]}function r(n){return n.size>0}function a(n){return["span",u,n+": "]}function d(n){var r=n.map(function(n,t){return["li",a(t),e(n)]}).toList().toJS();return["ol",o].concat(t(r))}function i(n){var r=n.map(function(n){return["li",e(n)]}).toJS();return["ol",o].concat(t(r))}function c(e){return e instanceof n.Record?v:Object.keys(w).filter(function(t){return n[t]["is"+t](e)}).map(function(n){return w[n]}).concat(s)[0]}var f={},s={header:function(n,t){return t===f?null:e(n,f)},hasBody:function(n,e){return!1},body:function(n,e){return null}},l={header:function(){return["span","Map"]},hasBody:r,body:d},y={header:function(){return["span","OrderedMap"]},hasBody:r,body:d},p={header:function(){return["span","List"]},hasBody:r,body:d},b={header:function(){return["span","Stack"]},hasBody:r,body:i},h={header:function(){return["span","Set"]},hasBody:r,body:i},m={header:function(){return["span","OrderedSet"]},hasBody:r,body:i},v={header:function(){return["span","Record"]},hasBody:r,body:function(n){var r=n.keySeq().map(function(t){return["li",a(t),e(n.get(t))]}).toJS();return["ol",o].concat(t(r))}},w={List:p,Map:l,OrderedMap:y,Set:h,OrderedSet:m,Stack:b};return{header:function(n,e){return c(n).header(n,e)},hasBody:function(n,e){return c(n).hasBody(n,e)},body:function(n,e){return c(n).body(n,e)}}}Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=r;var o={style:"list-style-type: none; padding: 0; margin: 0 0 0 12px"},u={style:"color:#881391"}}]); | ||
module.exports = | ||
/******/ (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] = { | ||
/******/ exports: {}, | ||
/******/ id: moduleId, | ||
/******/ loaded: false | ||
/******/ }; | ||
/******/ // Execute the module function | ||
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); | ||
/******/ // Flag the module as loaded | ||
/******/ module.loaded = 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; | ||
/******/ // __webpack_public_path__ | ||
/******/ __webpack_require__.p = ""; | ||
/******/ // Load entry module and return exports | ||
/******/ return __webpack_require__(0); | ||
/******/ }) | ||
/************************************************************************/ | ||
/******/ ([ | ||
/* 0 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.default = install; | ||
var _createFormatter = __webpack_require__(1); | ||
var _createFormatter2 = _interopRequireDefault(_createFormatter); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function _typeof(obj) { return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj; } | ||
var installed = false; | ||
// Check for globally defined Immutable and add an install method to it. | ||
if (typeof Immutable !== "undefined") { | ||
Immutable.installDevTools = install.bind(null, Immutable); | ||
} | ||
// I imagine most people are using Immutable as a CommonJS module though... | ||
function install(Immutable) { | ||
if ((typeof window === "undefined" ? "undefined" : _typeof(window)) === undefined) { | ||
throw new Error("Can only install immutable-devtools in a browser environment."); | ||
} | ||
// Don't install more than once. | ||
if (installed === true) { | ||
return; | ||
} | ||
window.devtoolsFormatters = window.devtoolsFormatters || []; | ||
window.devtoolsFormatters.push((0, _createFormatter2.default)(Immutable)); | ||
installed = true; | ||
} | ||
/***/ }, | ||
/* 1 */ | ||
/***/ function(module, exports) { | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.default = createFormatter; | ||
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; return arr2; } else { return Array.from(arr); } } | ||
var listStyle = { style: "list-style-type: none; padding: 0; margin: 0 0 0 12px" }; | ||
var keyStyle = { style: "color:#881391" }; | ||
function createFormatter(Immutable) { | ||
function reference(any, config) { | ||
return ["object", { object: any, config: config }]; | ||
} | ||
var stop = {}; // Signals formatter to stop infinite recursion | ||
var defaultFormatter = { | ||
header: function header(x, config) { | ||
if (config === stop) return null; | ||
return reference(x, stop); | ||
}, | ||
hasBody: function hasBody(x, config) { | ||
return false; | ||
}, | ||
body: function body(x, config) { | ||
return null; | ||
} | ||
}; | ||
function notEmpty(collection) { | ||
return collection.size > 0; | ||
} | ||
function keySpan(key) { | ||
return ["span", keyStyle, key + ": "]; | ||
} | ||
function displayKeyValueList(collection) { | ||
var children = collection.map(function (value, key) { | ||
return ["li", keySpan(key), reference(value)]; | ||
}).toList().toJS(); | ||
return ["ol", listStyle].concat(_toConsumableArray(children)); | ||
} | ||
var mapFormatter = { | ||
header: function header() { | ||
return ["span", "Map"]; | ||
}, | ||
hasBody: notEmpty, | ||
body: displayKeyValueList | ||
}; | ||
var orderedMapFormatter = { | ||
header: function header() { | ||
return ["span", "OrderedMap"]; | ||
}, | ||
hasBody: notEmpty, | ||
body: displayKeyValueList | ||
}; | ||
var listFormatter = { | ||
header: function header() { | ||
return ["span", "List"]; | ||
}, | ||
hasBody: notEmpty, | ||
body: displayKeyValueList | ||
}; | ||
function setBody(set) { | ||
var children = set.map(function (item) { | ||
return ["li", reference(item)]; | ||
}).toJS(); | ||
return ["ol", listStyle].concat(_toConsumableArray(children)); | ||
} | ||
var stackFormatter = { | ||
header: function header() { | ||
return ["span", "Stack"]; | ||
}, | ||
hasBody: notEmpty, | ||
body: setBody | ||
}; | ||
var setFormatter = { | ||
header: function header() { | ||
return ["span", "Set"]; | ||
}, | ||
hasBody: notEmpty, | ||
body: setBody | ||
}; | ||
var orderedSetFormatter = { | ||
header: function header() { | ||
return ["span", "OrderedSet"]; | ||
}, | ||
hasBody: notEmpty, | ||
body: setBody | ||
}; | ||
var recordFormatter = { | ||
header: function header() { | ||
return ["span", "Record"]; | ||
}, | ||
hasBody: notEmpty, | ||
body: function body(record) { | ||
var children = record.keySeq().map(function (key) { | ||
return ["li", keySpan(key), reference(record.get(key))]; | ||
}).toJS(); | ||
return ["ol", listStyle].concat(_toConsumableArray(children)); | ||
} | ||
}; | ||
var immutableFormatters = { | ||
List: listFormatter, | ||
Map: mapFormatter, | ||
OrderedMap: orderedMapFormatter, | ||
Set: setFormatter, | ||
OrderedSet: orderedSetFormatter, | ||
Stack: stackFormatter | ||
}; | ||
function getFormatter(any) { | ||
if (any instanceof Immutable.Record) return recordFormatter; | ||
return Object.keys(immutableFormatters).filter(function (type) { | ||
return Immutable[type]["is" + type](any); | ||
}).map(function (type) { | ||
return immutableFormatters[type]; | ||
}).concat(defaultFormatter) // Fallback used when not immutable value | ||
[0]; | ||
} | ||
return { | ||
header: function header(any, config) { | ||
return getFormatter(any).header(any, config); | ||
}, | ||
hasBody: function hasBody(any, config) { | ||
return getFormatter(any).hasBody(any, config); | ||
}, | ||
body: function body(any, config) { | ||
return getFormatter(any).body(any, config); | ||
} | ||
}; | ||
} | ||
/***/ } | ||
/******/ ]); |
{ | ||
"name": "immutable-devtools", | ||
"version": "0.0.0", | ||
"version": "0.0.1", | ||
"description": "Chrome Dev Tools formatter for the Immutable JS library", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Empty package
Supply chain riskPackage does not contain any code. It may be removed, is name squatting, or the result of a faulty package publish.
Found 1 instance in 1 package
8426
192