@expo/require-utils 56.1.4-canary-20260624-9d83b81 → 57.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/checks.js CHANGED
@@ -1,2 +1,2 @@
1
-
2
- //# sourceMappingURL=checks.js.map
1
+ "use strict";
2
+ //# sourceMappingURL=checks.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
1
+ {"version":3,"file":"checks.js","names":[],"sources":["../src/checks.ts"],"sourcesContent":[""],"mappings":"","ignoreList":[]}
@@ -1,98 +1,89 @@
1
1
  "use strict";
2
+
2
3
  Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- 0 && (module.exports = {
6
- annotateError: null,
7
- formatDiagnostic: null
4
+ value: true
8
5
  });
9
- function _export(target, all) {
10
- for(var name in all)Object.defineProperty(target, name, {
11
- enumerable: true,
12
- get: Object.getOwnPropertyDescriptor(all, name).get
13
- });
14
- }
15
- _export(exports, {
16
- get annotateError () {
17
- return annotateError;
18
- },
19
- get formatDiagnostic () {
20
- return formatDiagnostic;
21
- }
22
- });
23
- function _nodeurl() {
24
- const data = /*#__PURE__*/ _interop_require_default(require("node:url"));
25
- _nodeurl = function() {
26
- return data;
27
- };
6
+ exports.annotateError = annotateError;
7
+ exports.formatDiagnostic = formatDiagnostic;
8
+ function _nodeUrl() {
9
+ const data = _interopRequireDefault(require("node:url"));
10
+ _nodeUrl = function () {
28
11
  return data;
12
+ };
13
+ return data;
29
14
  }
30
- function _interop_require_default(obj) {
31
- return obj && obj.__esModule ? obj : {
32
- default: obj
33
- };
34
- }
15
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
35
16
  function errorToLoc(filename, error) {
36
- if (error.name === 'ReferenceError' || error.name === 'SyntaxError') {
37
- let stack = `${error.stack || ''}`;
38
- stack = stack.slice(error.name.length + 2 /* '${name}: ' prefix */ );
39
- stack = stack.slice(error.message.length);
40
- const trace = stack.match(/at ([^\n]+):(\d+):(\d+)/m);
41
- if (_nodeurl().default.pathToFileURL(filename).href === trace?.[1]) {
42
- const line = Number(trace[2]);
43
- return Number.isSafeInteger(line) ? {
44
- line,
45
- column: Number(trace[3]) || undefined
46
- } : null;
47
- }
17
+ if (error.name === 'ReferenceError' || error.name === 'SyntaxError') {
18
+ let stack = `${error.stack || ''}`;
19
+ stack = stack.slice(error.name.length + 2 /* '${name}: ' prefix */);
20
+ stack = stack.slice(error.message.length);
21
+ const trace = stack.match(/at ([^\n]+):(\d+):(\d+)/m);
22
+ if (_nodeUrl().default.pathToFileURL(filename).href === trace?.[1]) {
23
+ const line = Number(trace[2]);
24
+ return Number.isSafeInteger(line) ? {
25
+ line,
26
+ column: Number(trace[3]) || undefined
27
+ } : null;
48
28
  }
49
- return null;
29
+ }
30
+ return null;
50
31
  }
51
32
  function formatDiagnostic(diagnostic) {
52
- if (!diagnostic) {
53
- return null;
54
- }
55
- const { start, file, messageText } = diagnostic;
56
- if (file && messageText && start != null) {
57
- const { codeFrameColumns } = require('@babel/code-frame');
58
- const { line, character } = file.getLineAndCharacterOfPosition(start);
59
- const loc = {
60
- line: line + 1,
61
- column: character + 1
62
- };
63
- const codeFrame = codeFrameColumns(file.getText(), {
64
- start: loc
65
- }, {
66
- highlightCode: true
67
- });
68
- const annotatedError = new SyntaxError(`${messageText}\n${codeFrame}`);
69
- annotatedError.codeFrame = codeFrame;
70
- delete annotatedError.stack;
71
- return annotatedError;
72
- }
33
+ if (!diagnostic) {
73
34
  return null;
35
+ }
36
+ const {
37
+ start,
38
+ file,
39
+ messageText
40
+ } = diagnostic;
41
+ if (file && messageText && start != null) {
42
+ const {
43
+ codeFrameColumns
44
+ } = require('@babel/code-frame');
45
+ const {
46
+ line,
47
+ character
48
+ } = file.getLineAndCharacterOfPosition(start);
49
+ const loc = {
50
+ line: line + 1,
51
+ column: character + 1
52
+ };
53
+ const codeFrame = codeFrameColumns(file.getText(), {
54
+ start: loc
55
+ }, {
56
+ highlightCode: true
57
+ });
58
+ const annotatedError = new SyntaxError(`${messageText}\n${codeFrame}`);
59
+ annotatedError.codeFrame = codeFrame;
60
+ delete annotatedError.stack;
61
+ return annotatedError;
62
+ }
63
+ return null;
74
64
  }
75
65
  function annotateError(code, filename, error) {
76
- if (typeof error !== 'object' || error == null) {
77
- return null;
78
- }
79
- if (code) {
80
- const loc = errorToLoc(filename, error);
81
- if (loc) {
82
- const { codeFrameColumns } = require('@babel/code-frame');
83
- const codeFrame = codeFrameColumns(code, {
84
- start: loc
85
- }, {
86
- highlightCode: true
87
- });
88
- const annotatedError = error;
89
- annotatedError.codeFrame = codeFrame;
90
- annotatedError.message += `\n${codeFrame}`;
91
- delete annotatedError.stack;
92
- return annotatedError;
93
- }
94
- }
66
+ if (typeof error !== 'object' || error == null) {
95
67
  return null;
68
+ }
69
+ if (code) {
70
+ const loc = errorToLoc(filename, error);
71
+ if (loc) {
72
+ const {
73
+ codeFrameColumns
74
+ } = require('@babel/code-frame');
75
+ const codeFrame = codeFrameColumns(code, {
76
+ start: loc
77
+ }, {
78
+ highlightCode: true
79
+ });
80
+ const annotatedError = error;
81
+ annotatedError.codeFrame = codeFrame;
82
+ annotatedError.message += `\n${codeFrame}`;
83
+ delete annotatedError.stack;
84
+ return annotatedError;
85
+ }
86
+ }
87
+ return null;
96
88
  }
97
-
98
- //# sourceMappingURL=codeframe.js.map
89
+ //# sourceMappingURL=codeframe.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["codeframe.ts"],"sourcesContent":[null],"names":["annotateError","formatDiagnostic","errorToLoc","filename","error","name","stack","slice","length","message","trace","match","url","pathToFileURL","href","line","Number","isSafeInteger","column","undefined","diagnostic","start","file","messageText","codeFrameColumns","require","character","getLineAndCharacterOfPosition","loc","codeFrame","getText","highlightCode","annotatedError","SyntaxError","code"],"mappings":";;;;;;;;;;;;;;;QAqCgBA;eAAAA;;QApBAC;eAAAA;;;;gEAjBA;;;;;;;;;;;AAGhB,SAASC,W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IAAmB,EAAE/B,QAAgB,EAAEC,KAAY;IAC/E,IAAI,OAAOA,UAAU,YAAYA,SAAS,MAAM;QAC9C,OAAO;IACT;IACA,IAAI8B,MAAM;QACR,MAAMN,MAAM1B,WAAWC,UAAUC;QACjC,IAAIwB,KAAK;YACP,MAAM,EAAEJ,gBAAgB,EAAE,GAAuCC,QAAQ;YACzE,MAAMI,YAAYL,iBAAiBU,MAAM;gBAAEb,OAAOO;YAAI,GAAG;gBAAEG,eAAe;YAAK;YAC/E,MAAMC,iBAAiB5B;YACvB4B,eAAeH,SAAS,GAAGA;YAC3BG,eAAevB,OAAO,IAAI,CAAC,EAAE,EAAEoB,WAAW;YAC1C,OAAOG,eAAe1B,KAAK;YAC3B,OAAO0B;QACT;IACF;IACA,OAAO;AACT"}
1
+ {"version":3,"file":"codeframe.js","names":["_nodeUrl","data","_interopRequireDefault","require","e","__esModule","default","errorToLoc","filename","error","name","stack","slice","length","message","trace","match","url","pathToFileURL","href","line","Number","isSafeInteger","column","undefined","formatDiagnostic","diagnostic","start","file","messageText","codeFrameColumns","character","getLineAndCharacterOfPosition","loc","codeFrame","getText","highlightCode","annotatedError","SyntaxError","annotateError","code"],"sources":["../src/codeframe.ts"],"sourcesContent":["import url from 'node:url';\nimport type { Diagnostic } from 'typescript';\n\nfunction errorToLoc(filename: string, error: Error) {\n if (error.name === 'ReferenceError' || error.name === 'SyntaxError') {\n let stack = `${error.stack || ''}`;\n stack = stack.slice(error.name.length + 2 /* '${name}: ' prefix */);\n stack = stack.slice(error.message.length);\n const trace = stack.match(/at ([^\\n]+):(\\d+):(\\d+)/m);\n if (url.pathToFileURL(filename).href === trace?.[1]) {\n const line = Number(trace[2]);\n return Number.isSafeInteger(line) ? { line, column: Number(trace[3]) || undefined } : null;\n }\n }\n return null;\n}\n\nexport function formatDiagnostic(diagnostic: Diagnostic | undefined) {\n if (!diagnostic) {\n return null;\n }\n const { start, file, messageText } = diagnostic;\n if (file && messageText && start != null) {\n const { codeFrameColumns }: typeof import('@babel/code-frame') = require('@babel/code-frame');\n const { line, character } = file.getLineAndCharacterOfPosition(start);\n const loc = { line: line + 1, column: character + 1 };\n const codeFrame = codeFrameColumns(file.getText(), { start: loc }, { highlightCode: true });\n const annotatedError = new SyntaxError(`${messageText}\\n${codeFrame}`) as SyntaxError & {\n codeFrame: string;\n };\n annotatedError.codeFrame = codeFrame;\n delete annotatedError.stack;\n return annotatedError;\n }\n return null;\n}\n\nexport function annotateError(code: string | null, filename: string, error: Error) {\n if (typeof error !== 'object' || error == null) {\n return null;\n }\n if (code) {\n const loc = errorToLoc(filename, error);\n if (loc) {\n const { codeFrameColumns }: typeof import('@babel/code-frame') = require('@babel/code-frame');\n const codeFrame = codeFrameColumns(code, { start: loc }, { highlightCode: true });\n const annotatedError = error as Error & { codeFrame: string };\n annotatedError.codeFrame = codeFrame;\n annotatedError.message += `\\n${codeFrame}`;\n delete annotatedError.stack;\n return annotatedError;\n }\n }\n return null;\n}\n"],"mappings":";;;;;;;AAAA,SAAAA,SAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,QAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA2B,SAAAC,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAG3B,SAASG,UAAUA,CAACC,QAAgB,EAAEC,KAAY,EAAE;EAClD,IAAIA,KAAK,CAACC,IAAI,KAAK,gBAAgB,IAAID,KAAK,CAACC,IAAI,KAAK,aAAa,EAAE;IACnE,IAAIC,KAAK,GAAG,GAAGF,KAAK,CAACE,KAAK,IAAI,EAAE,EAAE;IAClCA,KAAK,GAAGA,KAAK,CAACC,KAAK,CAACH,KAAK,CAACC,IAAI,CAACG,MAAM,GAAG,CAAC,CAAC,wBAAwB,CAAC;IACnEF,KAAK,GAAGA,KAAK,CAACC,KAAK,CAACH,KAAK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AAS;IACpC,OAAOG,cAAc,CAAC1B,KAAK;IAC3B,OAAO0B,cAAc;EACvB;EACA,OAAO,IAAI;AACb;AAEO,SAASE,aAAaA,CAACC,IAAmB,EAAEhC,QAAgB,EAAEC,KAAY,EAAE;EACjF,IAAI,OAAOA,KAAK,KAAK,QAAQ,IAAIA,KAAK,IAAI,IAAI,EAAE;IAC9C,OAAO,IAAI;EACb;EACA,IAAI+B,IAAI,EAAE;IACR,MAAMP,GAAG,GAAG1B,UAAU,CAACC,QAAQ,EAAEC,KAAK,CAAC;IACvC,IAAIwB,GAAG,EAAE;MACP,MAAM;QAAEH;MAAqD,CAAC,GAAG3B,OAAO,CAAC,mBAAmB,CAAC;MAC7F,MAAM+B,SAAS,GAAGJ,gBAAgB,CAACU,IAAI,EAAE;QAAEb,KAAK,EAAEM;MAAI,CAAC,EAAE;QAAEG,aAAa,EAAE;MAAK,CAAC,CAAC;MACjF,MAAMC,cAAc,GAAG5B,KAAsC;MAC7D4B,cAAc,CAACH,SAAS,GAAGA,SAAS;MACpCG,cAAc,CAACvB,OAAO,IAAI,KAAKoB,SAAS,EAAE;MAC1C,OAAOG,cAAc,CAAC1B,KAAK;MAC3B,OAAO0B,cAAc;IACvB;EACF;EACA,OAAO,IAAI;AACb","ignoreList":[]}
package/build/index.js CHANGED
@@ -1,23 +1,39 @@
1
1
  "use strict";
2
+
2
3
  Object.defineProperty(exports, "__esModule", {
3
- value: true
4
+ value: true
4
5
  });
5
- 0 && __export(require("./load")) && __export(require("./resolve")) && __export(require("./resolveGlobal"));
6
- _export_star(require("./load"), exports);
7
- _export_star(require("./resolve"), exports);
8
- _export_star(require("./resolveGlobal"), exports);
9
- function _export_star(from, to) {
10
- Object.keys(from).forEach(function(k) {
11
- if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
12
- Object.defineProperty(to, k, {
13
- enumerable: true,
14
- get: function() {
15
- return from[k];
16
- }
17
- });
18
- }
19
- });
20
- return from;
21
- }
22
-
23
- //# sourceMappingURL=index.js.map
6
+ var _load = require("./load");
7
+ Object.keys(_load).forEach(function (key) {
8
+ if (key === "default" || key === "__esModule") return;
9
+ if (key in exports && exports[key] === _load[key]) return;
10
+ Object.defineProperty(exports, key, {
11
+ enumerable: true,
12
+ get: function () {
13
+ return _load[key];
14
+ }
15
+ });
16
+ });
17
+ var _resolve = require("./resolve");
18
+ Object.keys(_resolve).forEach(function (key) {
19
+ if (key === "default" || key === "__esModule") return;
20
+ if (key in exports && exports[key] === _resolve[key]) return;
21
+ Object.defineProperty(exports, key, {
22
+ enumerable: true,
23
+ get: function () {
24
+ return _resolve[key];
25
+ }
26
+ });
27
+ });
28
+ var _resolveGlobal = require("./resolveGlobal");
29
+ Object.keys(_resolveGlobal).forEach(function (key) {
30
+ if (key === "default" || key === "__esModule") return;
31
+ if (key in exports && exports[key] === _resolveGlobal[key]) return;
32
+ Object.defineProperty(exports, key, {
33
+ enumerable: true,
34
+ get: function () {
35
+ return _resolveGlobal[key];
36
+ }
37
+ });
38
+ });
39
+ //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["index.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;qBAAc;qBACA;qBACA"}
1
+ {"version":3,"file":"index.js","names":["_load","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_resolve","_resolveGlobal"],"sources":["../src/index.ts"],"sourcesContent":["export * from './load';\nexport * from './resolve';\nexport * from './resolveGlobal';\n"],"mappings":";;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,KAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,KAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,KAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,QAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,QAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,QAAA,CAAAL,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAC,QAAA,CAAAL,GAAA;IAAA;EAAA;AAAA;AACA,IAAAM,cAAA,GAAAV,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAQ,cAAA,EAAAP,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAM,cAAA,CAAAN,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAE,cAAA,CAAAN,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}