@openzeppelin/upgrades-core 1.46.0 → 1.47.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.
Files changed (63) hide show
  1. package/dist/cli/validate/validate-upgrade-safety.test.js +18 -0
  2. package/dist/cli/validate/validate-upgrade-safety.test.js.map +1 -1
  3. package/dist/storage/compare.d.ts.map +1 -1
  4. package/dist/storage/compare.js +3 -3
  5. package/dist/storage/compare.js.map +1 -1
  6. package/dist/storage/extract.d.ts +15 -3
  7. package/dist/storage/extract.d.ts.map +1 -1
  8. package/dist/storage/extract.js +47 -15
  9. package/dist/storage/extract.js.map +1 -1
  10. package/dist/storage/namespace.d.ts.map +1 -1
  11. package/dist/storage/namespace.js +8 -2
  12. package/dist/storage/namespace.js.map +1 -1
  13. package/dist/storage/report-rename-retype.test.js +30 -0
  14. package/dist/storage/report-rename-retype.test.js.map +1 -1
  15. package/dist/storage/report.js +9 -1
  16. package/dist/storage/report.js.map +1 -1
  17. package/dist/storage-namespaced-renamed-retyped.test.d.ts +2 -0
  18. package/dist/storage-namespaced-renamed-retyped.test.d.ts.map +1 -0
  19. package/dist/storage-namespaced-renamed-retyped.test.js +278 -0
  20. package/dist/storage-namespaced-renamed-retyped.test.js.map +1 -0
  21. package/dist/storage-struct-member-renamed-retyped.test.d.ts +2 -0
  22. package/dist/storage-struct-member-renamed-retyped.test.d.ts.map +1 -0
  23. package/dist/storage-struct-member-renamed-retyped.test.js +256 -0
  24. package/dist/storage-struct-member-renamed-retyped.test.js.map +1 -0
  25. package/dist/utils/annotations.d.ts +1 -0
  26. package/dist/utils/annotations.d.ts.map +1 -1
  27. package/dist/utils/annotations.js +4 -1
  28. package/dist/utils/annotations.js.map +1 -1
  29. package/dist/utils/struct-member-docs.d.ts +52 -0
  30. package/dist/utils/struct-member-docs.d.ts.map +1 -0
  31. package/dist/utils/struct-member-docs.js +264 -0
  32. package/dist/utils/struct-member-docs.js.map +1 -0
  33. package/dist/utils/struct-member-docs.test.d.ts +2 -0
  34. package/dist/utils/struct-member-docs.test.d.ts.map +1 -0
  35. package/dist/utils/struct-member-docs.test.js +320 -0
  36. package/dist/utils/struct-member-docs.test.js.map +1 -0
  37. package/dist/validate/data.d.ts +1 -1
  38. package/dist/validate/data.d.ts.map +1 -1
  39. package/dist/validate/data.js +1 -1
  40. package/dist/validate/run.d.ts +1 -1
  41. package/dist/validate/run.d.ts.map +1 -1
  42. package/dist/validate/run.js +22 -2
  43. package/dist/validate/run.js.map +1 -1
  44. package/package.json +3 -3
  45. package/src/cli/validate/validate-upgrade-safety.test.ts +35 -0
  46. package/src/cli/validate/validate-upgrade-safety.test.ts.md +10 -0
  47. package/src/cli/validate/validate-upgrade-safety.test.ts.snap +0 -0
  48. package/src/storage/compare.ts +3 -4
  49. package/src/storage/extract.ts +55 -18
  50. package/src/storage/namespace.ts +10 -3
  51. package/src/storage/report-rename-retype.test.ts +41 -0
  52. package/src/storage/report.ts +9 -1
  53. package/src/storage-namespaced-renamed-retyped.test.ts +338 -0
  54. package/src/storage-namespaced-renamed-retyped.test.ts.md +183 -0
  55. package/src/storage-namespaced-renamed-retyped.test.ts.snap +0 -0
  56. package/src/storage-struct-member-renamed-retyped.test.ts +299 -0
  57. package/src/storage-struct-member-renamed-retyped.test.ts.md +260 -0
  58. package/src/storage-struct-member-renamed-retyped.test.ts.snap +0 -0
  59. package/src/utils/annotations.ts +4 -4
  60. package/src/utils/struct-member-docs.test.ts +351 -0
  61. package/src/utils/struct-member-docs.ts +293 -0
  62. package/src/validate/data.ts +2 -2
  63. package/src/validate/run.ts +23 -1
@@ -0,0 +1,52 @@
1
+ import { StructDefinition } from 'solidity-ast';
2
+ import { SolcInput, SolcOutput } from '../solc-api';
3
+ import { SrcDecoder } from '../src-decoder';
4
+ /**
5
+ * Resolves the NatSpec documentation of the members of a struct, keyed by member name. Members without documentation
6
+ * are not included. Returns undefined if the documentation of the struct's members is not available.
7
+ */
8
+ export type StructDocsResolver = (structDef: StructDefinition) => Map<string, string> | undefined;
9
+ /**
10
+ * Thrown when the source text of a struct does not have the shape implied by its AST, so that the documentation of its
11
+ * members cannot be located. This happens with syntax that the scanner does not know about.
12
+ */
13
+ export declare class UnexpectedStructSourceError extends Error {
14
+ readonly position: number;
15
+ constructor(message: string, position: number);
16
+ }
17
+ /**
18
+ * Builds a resolver for the member documentation of the structs in a compilation.
19
+ *
20
+ * Solidity does not include the NatSpec of struct members in its AST, so it is read from the source text in the
21
+ * compiler input, between the source offsets of the members. The struct given to the resolver may come from the
22
+ * namespaced compilation of the same sources, whose source text and AST ids differ from the original, so it is first
23
+ * mapped to the original definition by source id and canonical name, which are the same in both compilations.
24
+ *
25
+ * @param solcInput The compiler input, or undefined if it is not available, in which case no documentation is resolved.
26
+ * @param solcOutput The compiler output of the original compilation.
27
+ * @param decodeSrc Source decoder for the original source code.
28
+ * @returns The resolver, which throws an UpgradesError if the member documentation of a struct that contains rename or
29
+ * retype annotations cannot be read, and an Error if the struct is not part of the original compilation.
30
+ */
31
+ export declare function makeStructDocsResolver(solcInput: SolcInput | undefined, solcOutput: SolcOutput, decodeSrc: SrcDecoder): StructDocsResolver;
32
+ /**
33
+ * Reads the NatSpec documentation of the members of a struct from the source text of its definition, located with the
34
+ * source offsets in the AST, which are byte offsets into the UTF-8 encoded source. The result is keyed by member
35
+ * name, and members without documentation are not included.
36
+ *
37
+ * A member is documented like a state variable preceded by the same comments would be: its documentation is the last
38
+ * `/**` block or run of consecutive `///` lines between the end of the previous member and the start of its
39
+ * declaration, with the comment markers removed as in `getDocumentationBefore`. Comments in the struct header, inside
40
+ * a member's declaration, between a member's name and its `;`, or after the last member document nothing.
41
+ *
42
+ * @throws UnexpectedStructSourceError if the source text of the struct does not have the shape implied by its AST.
43
+ */
44
+ export declare function getStructMemberDocumentation(structDef: StructDefinition, source: Buffer): Map<string, string>;
45
+ /**
46
+ * Returns the documentation that solc attaches to a declaration starting at byte `end` of the source when the previous
47
+ * token ends at byte `start`, or undefined if there is none. The bytes in between may only be whitespace and comments.
48
+ *
49
+ * @throws UnexpectedStructSourceError if there is anything else between `start` and `end`.
50
+ */
51
+ export declare function getDocumentationBefore(source: Buffer, start: number, end: number): string | undefined;
52
+ //# sourceMappingURL=struct-member-docs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"struct-member-docs.d.ts","sourceRoot":"","sources":["../../src/utils/struct-member-docs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAIhD,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAI5C;;;GAGG;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,SAAS,EAAE,gBAAgB,KAAK,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAAC;AAElG;;;GAGG;AACH,qBAAa,2BAA4B,SAAQ,KAAK;IAGlD,QAAQ,CAAC,QAAQ,EAAE,MAAM;gBADzB,OAAO,EAAE,MAAM,EACN,QAAQ,EAAE,MAAM;CAI5B;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,sBAAsB,CACpC,SAAS,EAAE,SAAS,GAAG,SAAS,EAChC,UAAU,EAAE,UAAU,EACtB,SAAS,EAAE,UAAU,GACpB,kBAAkB,CA8DpB;AAwBD;;;;;;;;;;;GAWG;AACH,wBAAgB,4BAA4B,CAAC,SAAS,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAuB7G;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAMrG"}
@@ -0,0 +1,264 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.UnexpectedStructSourceError = void 0;
7
+ exports.makeStructDocsResolver = makeStructDocsResolver;
8
+ exports.getStructMemberDocumentation = getStructMemberDocumentation;
9
+ exports.getDocumentationBefore = getDocumentationBefore;
10
+ const utils_1 = require("solidity-ast/utils");
11
+ const error_1 = require("../error");
12
+ const debug_1 = __importDefault(require("./debug"));
13
+ /**
14
+ * Thrown when the source text of a struct does not have the shape implied by its AST, so that the documentation of its
15
+ * members cannot be located. This happens with syntax that the scanner does not know about.
16
+ */
17
+ class UnexpectedStructSourceError extends Error {
18
+ constructor(message, position) {
19
+ super(`${message} at byte ${position}`);
20
+ this.position = position;
21
+ }
22
+ }
23
+ exports.UnexpectedStructSourceError = UnexpectedStructSourceError;
24
+ /**
25
+ * Builds a resolver for the member documentation of the structs in a compilation.
26
+ *
27
+ * Solidity does not include the NatSpec of struct members in its AST, so it is read from the source text in the
28
+ * compiler input, between the source offsets of the members. The struct given to the resolver may come from the
29
+ * namespaced compilation of the same sources, whose source text and AST ids differ from the original, so it is first
30
+ * mapped to the original definition by source id and canonical name, which are the same in both compilations.
31
+ *
32
+ * @param solcInput The compiler input, or undefined if it is not available, in which case no documentation is resolved.
33
+ * @param solcOutput The compiler output of the original compilation.
34
+ * @param decodeSrc Source decoder for the original source code.
35
+ * @returns The resolver, which throws an UpgradesError if the member documentation of a struct that contains rename or
36
+ * retype annotations cannot be read, and an Error if the struct is not part of the original compilation.
37
+ */
38
+ function makeStructDocsResolver(solcInput, solcOutput, decodeSrc) {
39
+ const sourcePaths = new Map();
40
+ const originalStructs = new Map();
41
+ for (const [sourcePath, { ast, id }] of Object.entries(solcOutput.sources)) {
42
+ sourcePaths.set(id, sourcePath);
43
+ for (const structDef of (0, utils_1.findAll)('StructDefinition', ast)) {
44
+ originalStructs.set(getStructKey(structDef), structDef);
45
+ }
46
+ }
47
+ const sources = new Map();
48
+ const docs = new Map();
49
+ function getSource(sourceId) {
50
+ if (!sources.has(sourceId)) {
51
+ const sourcePath = sourcePaths.get(sourceId);
52
+ const content = sourcePath === undefined ? undefined : solcInput?.sources[sourcePath]?.content;
53
+ if (content === undefined) {
54
+ (0, debug_1.default)(`Source content of ${sourcePath} is not available, annotations on its struct members are not read`);
55
+ }
56
+ sources.set(sourceId, content === undefined ? undefined : Buffer.from(content, 'utf8'));
57
+ }
58
+ return sources.get(sourceId);
59
+ }
60
+ function getDocs(structDef) {
61
+ const source = getSource(getSourceId(structDef));
62
+ if (source === undefined) {
63
+ return undefined;
64
+ }
65
+ try {
66
+ return getStructMemberDocumentation(structDef, source);
67
+ }
68
+ catch (e) {
69
+ if (!(e instanceof UnexpectedStructSourceError)) {
70
+ throw e;
71
+ }
72
+ const { start, end } = getPositions(structDef);
73
+ if (/@custom:oz-(renamed|retyped)-from/.test(source.toString('utf8', start, end))) {
74
+ throw new error_1.UpgradesError(`${decodeSrc(structDef)}: Could not read storage annotations on members of struct \`${structDef.canonicalName}\``, () => 'Please report this at https://zpl.in/upgrades/report and include the struct definition from your contract.');
75
+ }
76
+ (0, debug_1.default)(`${decodeSrc(structDef)}: Could not read member documentation of struct ${structDef.canonicalName}: ${e.message}`);
77
+ return undefined;
78
+ }
79
+ }
80
+ return structDef => {
81
+ const key = getStructKey(structDef);
82
+ const original = originalStructs.get(key);
83
+ if (original === undefined) {
84
+ throw new Error(`Broken invariant: struct ${structDef.canonicalName} not found in the original compilation`);
85
+ }
86
+ if (!docs.has(key)) {
87
+ docs.set(key, getDocs(original));
88
+ }
89
+ return docs.get(key);
90
+ };
91
+ }
92
+ function getStructKey(structDef) {
93
+ return `${getSourceId(structDef)}:${structDef.canonicalName}`;
94
+ }
95
+ function getSourceId(node) {
96
+ return Number(node.src.split(':')[2]);
97
+ }
98
+ function getPositions(node) {
99
+ const [start, length] = node.src.split(':').map(Number);
100
+ return { start, end: start + length };
101
+ }
102
+ // Byte values of the ASCII characters that delimit whitespace and comments. Any other byte, including the bytes of
103
+ // multi-byte UTF-8 sequences, is only accepted inside a comment, where it is kept as it is.
104
+ const TAB = 0x09;
105
+ const LF = 0x0a;
106
+ const CR = 0x0d;
107
+ const SPACE = 0x20;
108
+ const STAR = 0x2a; // *
109
+ const SLASH = 0x2f; // /
110
+ /**
111
+ * Reads the NatSpec documentation of the members of a struct from the source text of its definition, located with the
112
+ * source offsets in the AST, which are byte offsets into the UTF-8 encoded source. The result is keyed by member
113
+ * name, and members without documentation are not included.
114
+ *
115
+ * A member is documented like a state variable preceded by the same comments would be: its documentation is the last
116
+ * `/**` block or run of consecutive `///` lines between the end of the previous member and the start of its
117
+ * declaration, with the comment markers removed as in `getDocumentationBefore`. Comments in the struct header, inside
118
+ * a member's declaration, between a member's name and its `;`, or after the last member document nothing.
119
+ *
120
+ * @throws UnexpectedStructSourceError if the source text of the struct does not have the shape implied by its AST.
121
+ */
122
+ function getStructMemberDocumentation(structDef, source) {
123
+ const docs = new Map();
124
+ const { start, end } = getPositions(structDef);
125
+ let pos = expectText(source, start, end, 'struct');
126
+ pos = expectText(source, skipTrivia(source, pos, end), end, structDef.name);
127
+ pos = expectText(source, skipTrivia(source, pos, end), end, '{');
128
+ for (const member of structDef.members) {
129
+ const memberPos = getPositions(member);
130
+ if (memberPos.start < pos || memberPos.end > end) {
131
+ throw new UnexpectedStructSourceError(`Member ${member.name} is outside the expected range`, memberPos.start);
132
+ }
133
+ const doc = getDocumentationBefore(source, pos, memberPos.start);
134
+ if (doc !== undefined) {
135
+ docs.set(member.name, doc);
136
+ }
137
+ // The source range of a member ends at its name and does not include the `;`
138
+ pos = expectText(source, skipTrivia(source, memberPos.end, end), end, ';');
139
+ }
140
+ pos = expectText(source, skipTrivia(source, pos, end), end, '}');
141
+ if (pos !== end) {
142
+ throw new UnexpectedStructSourceError('Expected the end of the struct', pos);
143
+ }
144
+ return docs;
145
+ }
146
+ /**
147
+ * Returns the documentation that solc attaches to a declaration starting at byte `end` of the source when the previous
148
+ * token ends at byte `start`, or undefined if there is none. The bytes in between may only be whitespace and comments.
149
+ *
150
+ * @throws UnexpectedStructSourceError if there is anything else between `start` and `end`.
151
+ */
152
+ function getDocumentationBefore(source, start, end) {
153
+ const { pos, doc } = scanTrivia(source, start, end);
154
+ if (pos !== end) {
155
+ throw new UnexpectedStructSourceError('Unexpected text', pos);
156
+ }
157
+ return doc;
158
+ }
159
+ function skipTrivia(source, start, end) {
160
+ return scanTrivia(source, start, end).pos;
161
+ }
162
+ function expectText(source, pos, end, text) {
163
+ const next = pos + text.length;
164
+ if (next > end || !source.subarray(pos, next).equals(Buffer.from(text))) {
165
+ throw new UnexpectedStructSourceError(`Expected \`${text}\``, pos);
166
+ }
167
+ return next;
168
+ }
169
+ /**
170
+ * Scans the whitespace and comments starting at byte `start` of the source, stopping at `end` or at the first byte that
171
+ * is neither, and returns that position together with the text of the documentation found: the last `/**` block or
172
+ * run of consecutive `///` lines, or undefined if there is none or its text is empty.
173
+ *
174
+ * Whitespace is space, tab, CR and LF. A line comment is documentation if it starts with exactly three slashes, and a
175
+ * block comment if its `/**` is followed by neither `*` nor `/`. A run of `///` lines continues through the next `///`
176
+ * line only when exactly one line break and otherwise only spaces and tabs separate them: a blank line or any other
177
+ * comment, even on the same line, ends the run.
178
+ *
179
+ * @throws UnexpectedStructSourceError at a block comment that is not closed before `end`.
180
+ */
181
+ function scanTrivia(source, start, end) {
182
+ const byteAt = (i) => (i < end ? source[i] : undefined);
183
+ let doc;
184
+ let runOpen = false;
185
+ let lineBreaks = 0;
186
+ let pos = start;
187
+ while (pos < end) {
188
+ const byte = source[pos];
189
+ if (byte === SPACE || byte === TAB) {
190
+ pos += 1;
191
+ }
192
+ else if (byte === LF || byte === CR) {
193
+ lineBreaks += 1;
194
+ pos += byte === CR && byteAt(pos + 1) === LF ? 2 : 1;
195
+ }
196
+ else if (byte === SLASH && byteAt(pos + 1) === SLASH) {
197
+ let lineEnd = pos + 2;
198
+ while (lineEnd < end && source[lineEnd] !== LF && source[lineEnd] !== CR) {
199
+ lineEnd += 1;
200
+ }
201
+ if (byteAt(pos + 2) === SLASH && byteAt(pos + 3) !== SLASH) {
202
+ const line = source.toString('utf8', pos + 3, lineEnd);
203
+ if (doc !== undefined && runOpen && lineBreaks === 1) {
204
+ doc.lines.push(line);
205
+ }
206
+ else {
207
+ doc = { block: false, lines: [line] };
208
+ }
209
+ runOpen = true;
210
+ }
211
+ else {
212
+ runOpen = false;
213
+ }
214
+ lineBreaks = 0;
215
+ pos = lineEnd;
216
+ }
217
+ else if (byte === SLASH && byteAt(pos + 1) === STAR) {
218
+ const close = source.indexOf('*/', pos + 2);
219
+ if (close < 0 || close + 2 > end) {
220
+ throw new UnexpectedStructSourceError('Unterminated block comment', pos);
221
+ }
222
+ if (byteAt(pos + 2) === STAR && byteAt(pos + 3) !== STAR && byteAt(pos + 3) !== SLASH) {
223
+ doc = { block: true, lines: source.toString('utf8', pos + 3, close).split(/\r\n|\r|\n/) };
224
+ }
225
+ runOpen = false;
226
+ lineBreaks = 0;
227
+ pos = close + 2;
228
+ }
229
+ else {
230
+ break;
231
+ }
232
+ }
233
+ return { pos, doc: doc === undefined ? undefined : getDocText(doc) };
234
+ }
235
+ /**
236
+ * Joins the lines of a documentation comment into the text that solc produces for the same comment on a state
237
+ * variable. Leading spaces and tabs are dropped from the first line and from every line of a block, then a single `*`
238
+ * at the start of a block line is dropped too, since it is a decoration. A block line that starts with `**` instead
239
+ * (counting the star that closes the comment for the last line) is kept whole and appended to the previous line
240
+ * without a line break. Lines that are left empty are dropped, and the rest are joined with `\n`.
241
+ *
242
+ * The text of a `///` run whose first line is blank starts with a line break in solc; here that line is dropped like
243
+ * any other blank line, which makes no difference to the annotations parsed from the text.
244
+ */
245
+ function getDocText({ block, lines }) {
246
+ let text = '';
247
+ for (const [i, line] of lines.entries()) {
248
+ let content = i === 0 || block ? line.replace(/^[ \t]+/, '') : line;
249
+ let glued = false;
250
+ if (block && i > 0) {
251
+ if (content.startsWith('**') || (i === lines.length - 1 && content === '*')) {
252
+ glued = true;
253
+ }
254
+ else if (content.startsWith('*')) {
255
+ content = content.slice(1);
256
+ }
257
+ }
258
+ if (content.length > 0) {
259
+ text += text.length > 0 && !glued ? `\n${content}` : content;
260
+ }
261
+ }
262
+ return text.length > 0 ? text : undefined;
263
+ }
264
+ //# sourceMappingURL=struct-member-docs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"struct-member-docs.js","sourceRoot":"","sources":["../../src/utils/struct-member-docs.ts"],"names":[],"mappings":";;;;;;AA0CA,wDAkEC;AAoCD,oEAuBC;AAQD,wDAMC;AAnLD,8CAA6C;AAI7C,oCAAyC;AACzC,oDAA4B;AAQ5B;;;GAGG;AACH,MAAa,2BAA4B,SAAQ,KAAK;IACpD,YACE,OAAe,EACN,QAAgB;QAEzB,KAAK,CAAC,GAAG,OAAO,YAAY,QAAQ,EAAE,CAAC,CAAC;QAF/B,aAAQ,GAAR,QAAQ,CAAQ;IAG3B,CAAC;CACF;AAPD,kEAOC;AAED;;;;;;;;;;;;;GAaG;AACH,SAAgB,sBAAsB,CACpC,SAAgC,EAChC,UAAsB,EACtB,SAAqB;IAErB,MAAM,WAAW,GAAG,IAAI,GAAG,EAAkB,CAAC;IAC9C,MAAM,eAAe,GAAG,IAAI,GAAG,EAA4B,CAAC;IAC5D,KAAK,MAAM,CAAC,UAAU,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;QAC3E,WAAW,CAAC,GAAG,CAAC,EAAE,EAAE,UAAU,CAAC,CAAC;QAChC,KAAK,MAAM,SAAS,IAAI,IAAA,eAAO,EAAC,kBAAkB,EAAE,GAAG,CAAC,EAAE,CAAC;YACzD,eAAe,CAAC,GAAG,CAAC,YAAY,CAAC,SAAS,CAAC,EAAE,SAAS,CAAC,CAAC;QAC1D,CAAC;IACH,CAAC;IAED,MAAM,OAAO,GAAG,IAAI,GAAG,EAA8B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AC;YACnB,IAAI,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,KAAK,KAAK,CAAC,MAAM,GAAG,CAAC,IAAI,OAAO,KAAK,GAAG,CAAC,EAAE,CAAC;gBAC5E,KAAK,GAAG,IAAI,CAAC;YACf,CAAC;iBAAM,IAAI,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;gBACnC,OAAO,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YAC7B,CAAC;QACH,CAAC;QACD,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACvB,IAAI,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,OAAO,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC;QAC/D,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;AAC5C,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=struct-member-docs.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"struct-member-docs.test.d.ts","sourceRoot":"","sources":["../../src/utils/struct-member-docs.test.ts"],"names":[],"mappings":""}