Sha256: 22bd3342847a6f8905dc279ff905b01f98a48f2c194912622f187cf033a4141a

Contents?: true

Size: 1.31 KB

Versions: 30

Compression:

Stored size: 1.31 KB

Contents

import _typeof from "@babel/runtime/helpers/typeof";

function _getRequireWildcardCache(nodeInterop) {
  if (typeof WeakMap !== "function") return null;
  var cacheBabelInterop = new WeakMap();
  var cacheNodeInterop = new WeakMap();
  return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) {
    return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
  })(nodeInterop);
}

export default function _interopRequireWildcard(obj, nodeInterop) {
  if (!nodeInterop && obj && obj.__esModule) {
    return obj;
  }

  if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") {
    return {
      "default": obj
    };
  }

  var cache = _getRequireWildcardCache(nodeInterop);

  if (cache && cache.has(obj)) {
    return cache.get(obj);
  }

  var newObj = {};
  var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;

  for (var key in obj) {
    if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
      var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;

      if (desc && (desc.get || desc.set)) {
        Object.defineProperty(newObj, key, desc);
      } else {
        newObj[key] = obj[key];
      }
    }
  }

  newObj["default"] = obj;

  if (cache) {
    cache.set(obj, newObj);
  }

  return newObj;
}

Version data entries

30 entries across 30 versions & 3 rubygems

Version Path
isomorfeus-redux-4.2.0 node_modules/@babel/runtime/helpers/esm/interopRequireWildcard.js
isomorfeus-redux-4.1.18 node_modules/@babel/runtime/helpers/esm/interopRequireWildcard.js
isomorfeus-redux-4.1.17 node_modules/@babel/runtime/helpers/esm/interopRequireWildcard.js
isomorfeus-redux-4.1.16 node_modules/@babel/runtime/helpers/esm/interopRequireWildcard.js
isomorfeus-redux-4.1.15 node_modules/@babel/runtime/helpers/esm/interopRequireWildcard.js
isomorfeus-redux-4.1.14 node_modules/@babel/runtime/helpers/esm/interopRequireWildcard.js
isomorfeus-redux-4.1.13 node_modules/@babel/runtime/helpers/esm/interopRequireWildcard.js
isomorfeus-redux-4.1.12 node_modules/@babel/runtime/helpers/esm/interopRequireWildcard.js
disco_app-0.16.1 test/dummy/node_modules/@babel/runtime/helpers/esm/interopRequireWildcard.js
isomorfeus-redux-4.1.11 node_modules/@babel/runtime/helpers/esm/interopRequireWildcard.js
isomorfeus-redux-4.1.10 node_modules/@babel/runtime/helpers/esm/interopRequireWildcard.js
isomorfeus-redux-4.1.9 node_modules/@babel/runtime/helpers/esm/interopRequireWildcard.js
disco_app-0.15.2 test/dummy/node_modules/@babel/runtime/helpers/esm/interopRequireWildcard.js
isomorfeus-redux-4.1.8 node_modules/@babel/runtime/helpers/esm/interopRequireWildcard.js
isomorfeus-redux-4.1.7 node_modules/@babel/runtime/helpers/esm/interopRequireWildcard.js
disco_app-0.18.4 test/dummy/node_modules/@babel/runtime/helpers/esm/interopRequireWildcard.js
disco_app-0.18.1 test/dummy/node_modules/@babel/runtime/helpers/esm/interopRequireWildcard.js
disco_app-0.12.7.pre.puma.pre.3 test/dummy/node_modules/@babel/runtime/helpers/esm/interopRequireWildcard.js
disco_app-0.14.0 test/dummy/node_modules/@babel/runtime/helpers/esm/interopRequireWildcard.js
disco_app-0.13.6.pre.puma.pre.3 test/dummy/node_modules/@babel/runtime/helpers/esm/interopRequireWildcard.js