Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

fetch-component-data

Package Overview
Dependencies
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fetch-component-data - npm Package Compare versions

Comparing version 7.8.0 to 9.0.0-rc.2

39

lib/fetchComponentData.js

@@ -1,23 +0,10 @@

"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = fetchComponentData;
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
import _defineProperty from "@babel/runtime/helpers/defineProperty";
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
var _excluded = ["store", "action", "parallel"];
import _regeneratorRuntime from "@babel/runtime/regenerator";
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }

@@ -72,10 +59,10 @@ function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }

function _executeFetchComponentData2() {
_executeFetchComponentData2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(options) {
_executeFetchComponentData2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(options) {
var store, action, parallel, rest, promises, result, _iterator, _step, branch, match, route, Component, componentModule, p, _res, results, _iterator2, _step2, res;
return _regenerator["default"].wrap(function _callee$(_context) {
return _regeneratorRuntime.wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
store = options.store, action = options.action, parallel = options.parallel, rest = (0, _objectWithoutProperties2["default"])(options, _excluded);
store = options.store, action = options.action, parallel = options.parallel, rest = _objectWithoutProperties(options, _excluded);
promises = [];

@@ -210,3 +197,3 @@ result = {};

function fetchComponentData(_x2, _x3) {
export default function fetchComponentData(_x2, _x3) {
return _fetchComponentData.apply(this, arguments);

@@ -216,5 +203,5 @@ }

function _fetchComponentData() {
_fetchComponentData = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(options, callback) {
_fetchComponentData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(options, callback) {
var res;
return _regenerator["default"].wrap(function _callee2$(_context2) {
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
while (1) {

@@ -263,4 +250,2 @@ switch (_context2.prev = _context2.next) {

return _fetchComponentData.apply(this, arguments);
}
module.exports = exports.default;
}

@@ -1,23 +0,3 @@

"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "fetchComponentData", {
enumerable: true,
get: function get() {
return _fetchComponentData["default"];
}
});
Object.defineProperty(exports, "fetchComponentDataMiddleware", {
enumerable: true,
get: function get() {
return _middleware["default"];
}
});
var _fetchComponentData = _interopRequireDefault(require("./fetchComponentData"));
var _middleware = _interopRequireDefault(require("./middleware"));
import fetchComponentData from './fetchComponentData';
import fetchComponentDataMiddleware from './middleware';
export { fetchComponentData, fetchComponentDataMiddleware };

@@ -1,16 +0,4 @@

"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = createFetchComponentDataMiddlware;
var _lodash = _interopRequireDefault(require("lodash"));
var _reactRouterConfig = require("react-router-config");
var _fetchComponentData = _interopRequireDefault(require("./fetchComponentData"));
import _ from 'lodash';
import { matchRoutes } from 'react-router-config';
import fetchComponentData from './fetchComponentData';
var routeChangeTypes = ['@@reduxReactRouter/routerDidChange', '@@router/LOCATION_CHANGE'];

@@ -22,3 +10,3 @@

function createFetchComponentDataMiddlware(getRoutes) {
export default function createFetchComponentDataMiddlware(getRoutes) {
var routes = getRoutes();

@@ -31,7 +19,7 @@ return function (store) {

if (currentLocation && _lodash["default"].includes(routeChangeTypes, action.type)) {
if (currentLocation && _.includes(routeChangeTypes, action.type)) {
var newLocation = action.payload && action.payload.location || action.payload;
if (locsEqual(currentLocation, newLocation)) return;
var branch = (0, _reactRouterConfig.matchRoutes)(routes, newLocation.pathname);
(0, _fetchComponentData["default"])({
var branch = matchRoutes(routes, newLocation.pathname);
fetchComponentData({
store: store,

@@ -48,4 +36,2 @@ branch: branch,

};
}
module.exports = exports.default;
}
{
"name": "fetch-component-data",
"version": "7.8.0",
"version": "9.0.0-rc.2",
"description": "Small util functions for Frameworkstein",

@@ -16,3 +16,3 @@ "main": "lib/index.js",

"scripts": {
"prepublish": "babel --root-mode upward ./src --out-dir ./lib --delete-dir-on-start",
"prepare": "babel --root-mode upward ./src --out-dir ./lib --delete-dir-on-start",
"build": "babel --root-mode upward ./src --out-dir ./lib --delete-dir-on-start",

@@ -42,3 +42,4 @@ "watch": "babel --root-mode upward ./src --out-dir ./lib --delete-dir-on-start --watch",

}
}
},
"gitHead": "159c2a58b21a00d985a8db91ae504e3d4ac07dd3"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc