Sha256: 0b1d11bf460056bc6fa7c1263eb232991121c753452a74dc8e7bba9b151f7b59

Contents?: true

Size: 1.13 KB

Versions: 36

Compression:

Stored size: 1.13 KB

Contents

import _typeof from "../../helpers/esm/typeof";

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

36 entries across 36 versions & 5 rubygems

Version Path
optimacms-0.1.61 spec/dummy/node_modules/@babel/runtime/helpers/esm/interopRequireWildcard.js
trusty-cms-5.0.7 node_modules/@babel/runtime/helpers/esm/interopRequireWildcard.js
trusty-cms-5.0.6 node_modules/@babel/runtime/helpers/esm/interopRequireWildcard.js
trusty-cms-5.0.5 node_modules/@babel/runtime/helpers/esm/interopRequireWildcard.js
trusty-cms-5.0.4 node_modules/@babel/runtime/helpers/esm/interopRequireWildcard.js
trusty-cms-5.0.3 node_modules/@babel/runtime/helpers/esm/interopRequireWildcard.js
trusty-cms-5.0.2 node_modules/@babel/runtime/helpers/esm/interopRequireWildcard.js
trusty-cms-5.0.1 node_modules/@babel/runtime/helpers/esm/interopRequireWildcard.js
trusty-cms-4.3.5 node_modules/@babel/runtime/helpers/esm/interopRequireWildcard.js
trusty-cms-5.0.0 node_modules/@babel/runtime/helpers/esm/interopRequireWildcard.js
trusty-cms-4.3.4 node_modules/@babel/runtime/helpers/esm/interopRequireWildcard.js
trusty-cms-4.3.3 node_modules/@babel/runtime/helpers/esm/interopRequireWildcard.js
trusty-cms-4.3.2 node_modules/@babel/runtime/helpers/esm/interopRequireWildcard.js
trusty-cms-4.3.1 node_modules/@babel/runtime/helpers/esm/interopRequireWildcard.js
trusty-cms-4.3 node_modules/@babel/runtime/helpers/esm/interopRequireWildcard.js
trusty-cms-4.2.3 node_modules/@babel/runtime/helpers/esm/interopRequireWildcard.js
tang-0.2.1 spec/tang_app/node_modules/@babel/runtime/helpers/esm/interopRequireWildcard.js
trusty-cms-4.2.2 node_modules/@babel/runtime/helpers/esm/interopRequireWildcard.js
trusty-cms-4.2.1 node_modules/@babel/runtime/helpers/esm/interopRequireWildcard.js
trusty-cms-4.2 node_modules/@babel/runtime/helpers/esm/interopRequireWildcard.js