1 | 'use strict';
|
2 |
|
3 | Object.defineProperty(exports, '__esModule', {
|
4 | value: true
|
5 | });
|
6 | exports.default = void 0;
|
7 |
|
8 | function _os() {
|
9 | const data = require('os');
|
10 |
|
11 | _os = function () {
|
12 | return data;
|
13 | };
|
14 |
|
15 | return data;
|
16 | }
|
17 |
|
18 | function path() {
|
19 | const data = _interopRequireWildcard(require('path'));
|
20 |
|
21 | path = function () {
|
22 | return data;
|
23 | };
|
24 |
|
25 | return data;
|
26 | }
|
27 |
|
28 | function _jestUtil() {
|
29 | const data = require('jest-util');
|
30 |
|
31 | _jestUtil = function () {
|
32 | return data;
|
33 | };
|
34 |
|
35 | return data;
|
36 | }
|
37 |
|
38 | function _getRequireWildcardCache(nodeInterop) {
|
39 | if (typeof WeakMap !== 'function') return null;
|
40 | var cacheBabelInterop = new WeakMap();
|
41 | var cacheNodeInterop = new WeakMap();
|
42 | return (_getRequireWildcardCache = function (nodeInterop) {
|
43 | return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
44 | })(nodeInterop);
|
45 | }
|
46 |
|
47 | function _interopRequireWildcard(obj, nodeInterop) {
|
48 | if (!nodeInterop && obj && obj.__esModule) {
|
49 | return obj;
|
50 | }
|
51 | if (obj === null || (typeof obj !== 'object' && typeof obj !== 'function')) {
|
52 | return {default: obj};
|
53 | }
|
54 | var cache = _getRequireWildcardCache(nodeInterop);
|
55 | if (cache && cache.has(obj)) {
|
56 | return cache.get(obj);
|
57 | }
|
58 | var newObj = {};
|
59 | var hasPropertyDescriptor =
|
60 | Object.defineProperty && Object.getOwnPropertyDescriptor;
|
61 | for (var key in obj) {
|
62 | if (key !== 'default' && Object.prototype.hasOwnProperty.call(obj, key)) {
|
63 | var desc = hasPropertyDescriptor
|
64 | ? Object.getOwnPropertyDescriptor(obj, key)
|
65 | : null;
|
66 | if (desc && (desc.get || desc.set)) {
|
67 | Object.defineProperty(newObj, key, desc);
|
68 | } else {
|
69 | newObj[key] = obj[key];
|
70 | }
|
71 | }
|
72 | }
|
73 | newObj.default = obj;
|
74 | if (cache) {
|
75 | cache.set(obj, newObj);
|
76 | }
|
77 | return newObj;
|
78 | }
|
79 |
|
80 |
|
81 |
|
82 |
|
83 |
|
84 |
|
85 |
|
86 | const getCacheDirectory = () => {
|
87 | const {getuid} = process;
|
88 | const tmpdirPath = path().join(
|
89 | (0, _jestUtil().tryRealpath)((0, _os().tmpdir)()),
|
90 | 'jest'
|
91 | );
|
92 |
|
93 | if (getuid == null) {
|
94 | return tmpdirPath;
|
95 | } else {
|
96 |
|
97 |
|
98 |
|
99 | return `${tmpdirPath}_${getuid.call(process).toString(36)}`;
|
100 | }
|
101 | };
|
102 |
|
103 | var _default = getCacheDirectory;
|
104 | exports.default = _default;
|