Sha256: 53158d48def083631ec452df702902bb23f800c13340e5309146c5f1e20e6be5

Contents?: true

Size: 1.35 KB

Versions: 7

Compression:

Stored size: 1.35 KB

Contents

import _Object$getOwnPropertyDescriptor from "../../core-js/object/get-own-property-descriptor";
import _Object$defineProperty from "../../core-js/object/define-property";
import _typeof from "../../helpers/esm/typeof";
import _WeakMap from "../../core-js/weak-map";

function _getRequireWildcardCache() {
  if (typeof _WeakMap !== "function") return null;
  var cache = new _WeakMap();

  _getRequireWildcardCache = function _getRequireWildcardCache() {
    return cache;
  };

  return cache;
}

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

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

  var cache = _getRequireWildcardCache();

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

  var newObj = {};
  var hasPropertyDescriptor = _Object$defineProperty && _Object$getOwnPropertyDescriptor;

  for (var key in obj) {
    if (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

7 entries across 7 versions & 1 rubygems

Version Path
condenser-0.3 lib/condenser/processors/node_modules/@babel/runtime-corejs3/helpers/esm/interopRequireWildcard.js
condenser-0.2 lib/condenser/processors/node_modules/@babel/runtime-corejs3/helpers/esm/interopRequireWildcard.js
condenser-0.1 lib/condenser/processors/node_modules/@babel/runtime-corejs3/helpers/esm/interopRequireWildcard.js
condenser-0.0.12 lib/condenser/processors/node_modules/@babel/runtime-corejs3/helpers/esm/interopRequireWildcard.js
condenser-0.0.11 lib/condenser/processors/node_modules/@babel/runtime-corejs3/helpers/esm/interopRequireWildcard.js
condenser-0.0.10 lib/condenser/processors/node_modules/@babel/runtime-corejs3/helpers/esm/interopRequireWildcard.js
condenser-0.0.9 lib/condenser/processors/node_modules/@babel/runtime-corejs3/helpers/esm/interopRequireWildcard.js