@forgeax/engine-rhi-debug 0.0.0-dev.8d955ade1c79
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/LICENSE +202 -0
- package/README.md +178 -0
- package/dist/.tsbuildinfo +1 -0
- package/dist/__tests__/bootstrap-integration.test.d.ts +2 -0
- package/dist/__tests__/bootstrap-integration.test.d.ts.map +1 -0
- package/dist/__tests__/consumer-inventory.unit.test.d.ts +2 -0
- package/dist/__tests__/consumer-inventory.unit.test.d.ts.map +1 -0
- package/dist/__tests__/copy-src-usage-validity.dawn.test.d.ts +15 -0
- package/dist/__tests__/copy-src-usage-validity.dawn.test.d.ts.map +1 -0
- package/dist/__tests__/coverage-invariant.test-d.d.ts +2 -0
- package/dist/__tests__/coverage-invariant.test-d.d.ts.map +1 -0
- package/dist/__tests__/coverage-invariant.unit.test.d.ts +2 -0
- package/dist/__tests__/coverage-invariant.unit.test.d.ts.map +1 -0
- package/dist/__tests__/e2e.browser.test.d.ts +2 -0
- package/dist/__tests__/e2e.browser.test.d.ts.map +1 -0
- package/dist/__tests__/error-code-narrowing.test-d.d.ts +2 -0
- package/dist/__tests__/error-code-narrowing.test-d.d.ts.map +1 -0
- package/dist/__tests__/errors-v7.test-d.d.ts +2 -0
- package/dist/__tests__/errors-v7.test-d.d.ts.map +1 -0
- package/dist/__tests__/errors-v7.unit.test.d.ts +2 -0
- package/dist/__tests__/errors-v7.unit.test.d.ts.map +1 -0
- package/dist/__tests__/errors.unit.test.d.ts +2 -0
- package/dist/__tests__/errors.unit.test.d.ts.map +1 -0
- package/dist/__tests__/event-semantics-coverage.unit.test.d.ts +2 -0
- package/dist/__tests__/event-semantics-coverage.unit.test.d.ts.map +1 -0
- package/dist/__tests__/format-info.unit.test.d.ts +2 -0
- package/dist/__tests__/format-info.unit.test.d.ts.map +1 -0
- package/dist/__tests__/frame-model-parity.test-d.d.ts +2 -0
- package/dist/__tests__/frame-model-parity.test-d.d.ts.map +1 -0
- package/dist/__tests__/frame-model-parity.unit.test.d.ts +2 -0
- package/dist/__tests__/frame-model-parity.unit.test.d.ts.map +1 -0
- package/dist/__tests__/guard-gates.test.d.ts +2 -0
- package/dist/__tests__/guard-gates.test.d.ts.map +1 -0
- package/dist/__tests__/public-surface.integration.test.d.ts +2 -0
- package/dist/__tests__/public-surface.integration.test.d.ts.map +1 -0
- package/dist/__tests__/readback-fault-cleanup.unit.test.d.ts +2 -0
- package/dist/__tests__/readback-fault-cleanup.unit.test.d.ts.map +1 -0
- package/dist/__tests__/readback-format-matrix.dawn.test.d.ts +2 -0
- package/dist/__tests__/readback-format-matrix.dawn.test.d.ts.map +1 -0
- package/dist/__tests__/readback-format-matrix.unit.test.d.ts +2 -0
- package/dist/__tests__/readback-format-matrix.unit.test.d.ts.map +1 -0
- package/dist/__tests__/readback-matrix-fixture.d.ts +32 -0
- package/dist/__tests__/readback-matrix-fixture.d.ts.map +1 -0
- package/dist/__tests__/recorder-bootstrap.unit.test.d.ts +2 -0
- package/dist/__tests__/recorder-bootstrap.unit.test.d.ts.map +1 -0
- package/dist/__tests__/recorder-budget.unit.test.d.ts +2 -0
- package/dist/__tests__/recorder-budget.unit.test.d.ts.map +1 -0
- package/dist/__tests__/recorder-fail-fast.unit.test.d.ts +2 -0
- package/dist/__tests__/recorder-fail-fast.unit.test.d.ts.map +1 -0
- package/dist/__tests__/recorder-lifecycle.unit.test.d.ts +2 -0
- package/dist/__tests__/recorder-lifecycle.unit.test.d.ts.map +1 -0
- package/dist/__tests__/recorder-push-event.unit.test.d.ts +2 -0
- package/dist/__tests__/recorder-push-event.unit.test.d.ts.map +1 -0
- package/dist/__tests__/recorder-session.integration.test.d.ts +2 -0
- package/dist/__tests__/recorder-session.integration.test.d.ts.map +1 -0
- package/dist/__tests__/recorder-session.unit.test.d.ts +2 -0
- package/dist/__tests__/recorder-session.unit.test.d.ts.map +1 -0
- package/dist/__tests__/recorder-steady-frame.dawn.test.d.ts +2 -0
- package/dist/__tests__/recorder-steady-frame.dawn.test.d.ts.map +1 -0
- package/dist/__tests__/replay-fail-fast.unit.test.d.ts +2 -0
- package/dist/__tests__/replay-fail-fast.unit.test.d.ts.map +1 -0
- package/dist/__tests__/replay-session.dawn.test.d.ts +2 -0
- package/dist/__tests__/replay-session.dawn.test.d.ts.map +1 -0
- package/dist/__tests__/replay-session.test-d.d.ts +2 -0
- package/dist/__tests__/replay-session.test-d.d.ts.map +1 -0
- package/dist/__tests__/replay-session.unit.test.d.ts +2 -0
- package/dist/__tests__/replay-session.unit.test.d.ts.map +1 -0
- package/dist/__tests__/resolve-texture-descriptor.unit.test.d.ts +2 -0
- package/dist/__tests__/resolve-texture-descriptor.unit.test.d.ts.map +1 -0
- package/dist/__tests__/resource-lifecycle.unit.test.d.ts +2 -0
- package/dist/__tests__/resource-lifecycle.unit.test.d.ts.map +1 -0
- package/dist/__tests__/rhi-debug-fresh-replay.dawn.test.d.ts +2 -0
- package/dist/__tests__/rhi-debug-fresh-replay.dawn.test.d.ts.map +1 -0
- package/dist/__tests__/tape-index.unit.test.d.ts +2 -0
- package/dist/__tests__/tape-index.unit.test.d.ts.map +1 -0
- package/dist/__tests__/tape-v7-invalid.unit.test.d.ts +2 -0
- package/dist/__tests__/tape-v7-invalid.unit.test.d.ts.map +1 -0
- package/dist/__tests__/tape-v7-roundtrip.unit.test.d.ts +2 -0
- package/dist/__tests__/tape-v7-roundtrip.unit.test.d.ts.map +1 -0
- package/dist/__tests__/tape-v7-version.unit.test.d.ts +2 -0
- package/dist/__tests__/tape-v7-version.unit.test.d.ts.map +1 -0
- package/dist/__tests__/tree-shake.unit.test.d.ts +2 -0
- package/dist/__tests__/tree-shake.unit.test.d.ts.map +1 -0
- package/dist/__tests__/types.test.d.ts +2 -0
- package/dist/__tests__/types.test.d.ts.map +1 -0
- package/dist/browser.d.ts +45 -0
- package/dist/browser.d.ts.map +1 -0
- package/dist/browser.mjs +83 -0
- package/dist/browser.mjs.map +1 -0
- package/dist/errors.d.ts +85 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/frame-model.d.ts +158 -0
- package/dist/frame-model.d.ts.map +1 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.mjs +10415 -0
- package/dist/index.mjs.map +1 -0
- package/dist/protocol/codec.d.ts +6 -0
- package/dist/protocol/codec.d.ts.map +1 -0
- package/dist/protocol/event-semantics.d.ts +15 -0
- package/dist/protocol/event-semantics.d.ts.map +1 -0
- package/dist/protocol/tape-index.d.ts +30 -0
- package/dist/protocol/tape-index.d.ts.map +1 -0
- package/dist/protocol/types.d.ts +44 -0
- package/dist/protocol/types.d.ts.map +1 -0
- package/dist/protocol/validation.d.ts +7 -0
- package/dist/protocol/validation.d.ts.map +1 -0
- package/dist/readback.d.ts +156 -0
- package/dist/readback.d.ts.map +1 -0
- package/dist/recorder/assemble.d.ts +11 -0
- package/dist/recorder/assemble.d.ts.map +1 -0
- package/dist/recorder/closure.d.ts +39 -0
- package/dist/recorder/closure.d.ts.map +1 -0
- package/dist/recorder/core.d.ts +296 -0
- package/dist/recorder/core.d.ts.map +1 -0
- package/dist/recorder/device.d.ts +4 -0
- package/dist/recorder/device.d.ts.map +1 -0
- package/dist/recorder/encoder.d.ts +5 -0
- package/dist/recorder/encoder.d.ts.map +1 -0
- package/dist/recorder/lifecycle.d.ts +20 -0
- package/dist/recorder/lifecycle.d.ts.map +1 -0
- package/dist/recorder/pass.d.ts +6 -0
- package/dist/recorder/pass.d.ts.map +1 -0
- package/dist/recorder/proxy.d.ts +19 -0
- package/dist/recorder/proxy.d.ts.map +1 -0
- package/dist/recorder/queue.d.ts +4 -0
- package/dist/recorder/queue.d.ts.map +1 -0
- package/dist/recorder/resource-registry.d.ts +15 -0
- package/dist/recorder/resource-registry.d.ts.map +1 -0
- package/dist/recorder/session.d.ts +25 -0
- package/dist/recorder/session.d.ts.map +1 -0
- package/dist/recorder/shader.d.ts +3 -0
- package/dist/recorder/shader.d.ts.map +1 -0
- package/dist/recorder/snapshot.d.ts +10 -0
- package/dist/recorder/snapshot.d.ts.map +1 -0
- package/dist/recorder/wrap.d.ts +4 -0
- package/dist/recorder/wrap.d.ts.map +1 -0
- package/dist/recorder.d.ts +7 -0
- package/dist/recorder.d.ts.map +1 -0
- package/dist/replay/device-request.d.ts +8 -0
- package/dist/replay/device-request.d.ts.map +1 -0
- package/dist/replay/execute-support.d.ts +33 -0
- package/dist/replay/execute-support.d.ts.map +1 -0
- package/dist/replay/execute.d.ts +18 -0
- package/dist/replay/execute.d.ts.map +1 -0
- package/dist/replay/readback.d.ts +32 -0
- package/dist/replay/readback.d.ts.map +1 -0
- package/dist/replay/resources.d.ts +57 -0
- package/dist/replay/resources.d.ts.map +1 -0
- package/dist/replay/session.d.ts +49 -0
- package/dist/replay/session.d.ts.map +1 -0
- package/dist/replay/texture-format.d.ts +21 -0
- package/dist/replay/texture-format.d.ts.map +1 -0
- package/dist/texel-decode.d.ts +35 -0
- package/dist/texel-decode.d.ts.map +1 -0
- package/dist/texel-layout.d.ts +76 -0
- package/dist/texel-layout.d.ts.map +1 -0
- package/dist/types.d.ts +722 -0
- package/dist/types.d.ts.map +1 -0
- package/package.json +72 -0
- package/src/__tests__/bootstrap-integration.test.ts +268 -0
- package/src/__tests__/consumer-inventory.unit.test.ts +154 -0
- package/src/__tests__/copy-src-usage-validity.dawn.test.ts +117 -0
- package/src/__tests__/coverage-invariant.test-d.ts +115 -0
- package/src/__tests__/coverage-invariant.unit.test.ts +45 -0
- package/src/__tests__/e2e.browser.test.ts +239 -0
- package/src/__tests__/error-code-narrowing.test-d.ts +32 -0
- package/src/__tests__/errors-v7.test-d.ts +19 -0
- package/src/__tests__/errors-v7.unit.test.ts +15 -0
- package/src/__tests__/errors.unit.test.ts +83 -0
- package/src/__tests__/event-semantics-coverage.unit.test.ts +22 -0
- package/src/__tests__/format-info.unit.test.ts +85 -0
- package/src/__tests__/frame-model-parity.test-d.ts +20 -0
- package/src/__tests__/frame-model-parity.unit.test.ts +285 -0
- package/src/__tests__/guard-gates.test.ts +317 -0
- package/src/__tests__/public-surface.integration.test.ts +38 -0
- package/src/__tests__/readback-fault-cleanup.unit.test.ts +66 -0
- package/src/__tests__/readback-format-matrix.dawn.test.ts +378 -0
- package/src/__tests__/readback-format-matrix.unit.test.ts +120 -0
- package/src/__tests__/readback-matrix-fixture.ts +20 -0
- package/src/__tests__/recorder-bootstrap.unit.test.ts +302 -0
- package/src/__tests__/recorder-budget.unit.test.ts +42 -0
- package/src/__tests__/recorder-fail-fast.unit.test.ts +434 -0
- package/src/__tests__/recorder-lifecycle.unit.test.ts +42 -0
- package/src/__tests__/recorder-push-event.unit.test.ts +573 -0
- package/src/__tests__/recorder-session.integration.test.ts +32 -0
- package/src/__tests__/recorder-session.unit.test.ts +63 -0
- package/src/__tests__/recorder-steady-frame.dawn.test.ts +52 -0
- package/src/__tests__/replay-fail-fast.unit.test.ts +155 -0
- package/src/__tests__/replay-session.dawn.test.ts +220 -0
- package/src/__tests__/replay-session.test-d.ts +27 -0
- package/src/__tests__/replay-session.unit.test.ts +171 -0
- package/src/__tests__/resolve-texture-descriptor.unit.test.ts +144 -0
- package/src/__tests__/resource-lifecycle.unit.test.ts +114 -0
- package/src/__tests__/rhi-debug-fresh-replay.dawn.test.ts +178 -0
- package/src/__tests__/tape-index.unit.test.ts +56 -0
- package/src/__tests__/tape-v7-invalid.unit.test.ts +45 -0
- package/src/__tests__/tape-v7-roundtrip.unit.test.ts +66 -0
- package/src/__tests__/tape-v7-version.unit.test.ts +13 -0
- package/src/__tests__/tree-shake.unit.test.ts +151 -0
- package/src/__tests__/types.test.ts +257 -0
- package/src/browser.ts +146 -0
- package/src/errors.ts +173 -0
- package/src/frame-model.ts +753 -0
- package/src/index.ts +92 -0
- package/src/pako.d.ts +8 -0
- package/src/protocol/codec.ts +220 -0
- package/src/protocol/event-semantics.ts +180 -0
- package/src/protocol/tape-index.ts +120 -0
- package/src/protocol/types.ts +60 -0
- package/src/protocol/validation.ts +173 -0
- package/src/readback.ts +804 -0
- package/src/recorder/assemble.ts +192 -0
- package/src/recorder/closure.ts +408 -0
- package/src/recorder/core.ts +587 -0
- package/src/recorder/device.ts +474 -0
- package/src/recorder/encoder.ts +251 -0
- package/src/recorder/lifecycle.ts +847 -0
- package/src/recorder/pass.ts +241 -0
- package/src/recorder/proxy.ts +59 -0
- package/src/recorder/queue.ts +109 -0
- package/src/recorder/resource-registry.ts +53 -0
- package/src/recorder/session.ts +152 -0
- package/src/recorder/shader.ts +47 -0
- package/src/recorder/snapshot.ts +38 -0
- package/src/recorder/wrap.ts +157 -0
- package/src/recorder.ts +15 -0
- package/src/replay/device-request.ts +38 -0
- package/src/replay/execute-support.ts +243 -0
- package/src/replay/execute.ts +870 -0
- package/src/replay/readback.ts +671 -0
- package/src/replay/resources.ts +154 -0
- package/src/replay/session.ts +509 -0
- package/src/replay/texture-format.ts +99 -0
- package/src/texel-decode.ts +289 -0
- package/src/texel-layout.ts +324 -0
- package/src/types.ts +888 -0
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import { err, ok, type Result } from '@forgeax/engine-types';
|
|
2
|
+
import { createRhiDebugError } from '../errors';
|
|
3
|
+
import { eventKinds } from './event-semantics';
|
|
4
|
+
import { type ResourceKind, type RhiCallEvent, TAPE_FORMAT_VERSION, type Tape } from './types';
|
|
5
|
+
|
|
6
|
+
type TapeValidation = ReturnType<typeof createRhiDebugError<'tape-invalid'>>;
|
|
7
|
+
|
|
8
|
+
export function validateTape(tape: Tape): Result<Tape, TapeValidation> {
|
|
9
|
+
if (tape.header.formatVersion !== TAPE_FORMAT_VERSION)
|
|
10
|
+
return err(
|
|
11
|
+
createRhiDebugError('tape-invalid', { stage: 'validate', cause: 'format version is not 7' }),
|
|
12
|
+
);
|
|
13
|
+
if (tape.header.eventCount !== tape.events.length || tape.header.blobCount !== tape.blobs.length)
|
|
14
|
+
return err(
|
|
15
|
+
createRhiDebugError('tape-invalid', {
|
|
16
|
+
stage: 'validate',
|
|
17
|
+
cause: 'header counts do not match payload counts',
|
|
18
|
+
}),
|
|
19
|
+
);
|
|
20
|
+
const declared = new Set<string>();
|
|
21
|
+
for (const resource of tape.bootstrap) {
|
|
22
|
+
if (declared.has(resource.handleId))
|
|
23
|
+
return err(
|
|
24
|
+
createRhiDebugError('tape-invalid', {
|
|
25
|
+
stage: 'validate',
|
|
26
|
+
cause: `duplicate bootstrap handle ${resource.handleId}`,
|
|
27
|
+
}),
|
|
28
|
+
);
|
|
29
|
+
if (!isResourceKind(resource.kind))
|
|
30
|
+
return err(
|
|
31
|
+
createRhiDebugError('tape-invalid', {
|
|
32
|
+
stage: 'validate',
|
|
33
|
+
cause: `unknown resource kind ${resource.kind}`,
|
|
34
|
+
}),
|
|
35
|
+
);
|
|
36
|
+
declared.add(resource.handleId);
|
|
37
|
+
}
|
|
38
|
+
const hashes = new Set<string>();
|
|
39
|
+
for (const blob of tape.blobs) {
|
|
40
|
+
if (hashes.has(blob.hash))
|
|
41
|
+
return err(
|
|
42
|
+
createRhiDebugError('tape-invalid', {
|
|
43
|
+
stage: 'validate',
|
|
44
|
+
cause: `duplicate blob hash ${blob.hash}`,
|
|
45
|
+
}),
|
|
46
|
+
);
|
|
47
|
+
hashes.add(blob.hash);
|
|
48
|
+
}
|
|
49
|
+
for (let eventIndex = 0; eventIndex < tape.events.length; eventIndex++) {
|
|
50
|
+
const event = tape.events[eventIndex];
|
|
51
|
+
if (!event || !eventKinds.includes(event.kind))
|
|
52
|
+
return err(
|
|
53
|
+
createRhiDebugError('tape-invalid', {
|
|
54
|
+
stage: 'validate',
|
|
55
|
+
cause: `unknown event kind at ${eventIndex}`,
|
|
56
|
+
}),
|
|
57
|
+
);
|
|
58
|
+
const semantics = eventResources(event);
|
|
59
|
+
for (const created of semantics.created) {
|
|
60
|
+
if (declared.has(created))
|
|
61
|
+
return err(
|
|
62
|
+
createRhiDebugError('tape-invalid', {
|
|
63
|
+
stage: 'validate',
|
|
64
|
+
cause: `duplicate handle ${created}`,
|
|
65
|
+
}),
|
|
66
|
+
);
|
|
67
|
+
declared.add(created);
|
|
68
|
+
}
|
|
69
|
+
for (const read of semantics.reads) {
|
|
70
|
+
if (!declared.has(read))
|
|
71
|
+
return err(
|
|
72
|
+
createRhiDebugError('tape-invalid', {
|
|
73
|
+
stage: 'validate',
|
|
74
|
+
cause: `create-before-use violated for ${read} at ${eventIndex}`,
|
|
75
|
+
}),
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
for (const destroyed of semantics.destroyed) {
|
|
79
|
+
if (!declared.has(destroyed))
|
|
80
|
+
return err(
|
|
81
|
+
createRhiDebugError('tape-invalid', {
|
|
82
|
+
stage: 'validate',
|
|
83
|
+
cause: `destroy-before-use violated for ${destroyed} at ${eventIndex}`,
|
|
84
|
+
}),
|
|
85
|
+
);
|
|
86
|
+
declared.delete(destroyed);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
return ok(tape);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
function isResourceKind(value: string): value is ResourceKind {
|
|
93
|
+
return [
|
|
94
|
+
'buffer',
|
|
95
|
+
'texture',
|
|
96
|
+
'texture-view',
|
|
97
|
+
'sampler',
|
|
98
|
+
'shader-module',
|
|
99
|
+
'pipeline',
|
|
100
|
+
'binding',
|
|
101
|
+
'encoder',
|
|
102
|
+
].includes(value);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
interface EventResources {
|
|
106
|
+
readonly created: readonly string[];
|
|
107
|
+
readonly reads: readonly string[];
|
|
108
|
+
readonly destroyed: readonly string[];
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
function eventResources(event: RhiCallEvent): EventResources {
|
|
112
|
+
switch (event.kind) {
|
|
113
|
+
case 'createBuffer':
|
|
114
|
+
case 'createTexture':
|
|
115
|
+
case 'createSampler':
|
|
116
|
+
case 'createBindGroupLayout':
|
|
117
|
+
case 'createBindGroup':
|
|
118
|
+
case 'createPipelineLayout':
|
|
119
|
+
case 'createRenderPipeline':
|
|
120
|
+
case 'createComputePipeline':
|
|
121
|
+
case 'createShaderModule':
|
|
122
|
+
return {
|
|
123
|
+
created: [event.handleId],
|
|
124
|
+
reads: handleRefs(event, [
|
|
125
|
+
'layoutHandleId',
|
|
126
|
+
'vertexShaderModuleHandleId',
|
|
127
|
+
'fragmentShaderModuleHandleId',
|
|
128
|
+
'computeShaderModuleHandleId',
|
|
129
|
+
]),
|
|
130
|
+
destroyed: [],
|
|
131
|
+
};
|
|
132
|
+
case 'createTextureView':
|
|
133
|
+
return { created: [event.resultHandleId], reads: [event.sourceHandleId], destroyed: [] };
|
|
134
|
+
case 'createCommandEncoder':
|
|
135
|
+
return { created: [event.cmdHandleId], reads: [], destroyed: [] };
|
|
136
|
+
case 'destroyBuffer':
|
|
137
|
+
case 'destroyTexture':
|
|
138
|
+
return { created: [], reads: [event.handleId], destroyed: [event.handleId] };
|
|
139
|
+
case 'writeBuffer':
|
|
140
|
+
case 'writeTexture':
|
|
141
|
+
return { created: [], reads: handleRefs(event, ['handleId', 'destination']), destroyed: [] };
|
|
142
|
+
case 'copyBufferToBuffer':
|
|
143
|
+
case 'copyBufferToTexture':
|
|
144
|
+
case 'copyTextureToBuffer':
|
|
145
|
+
case 'copyTextureToTexture':
|
|
146
|
+
case 'clearBuffer':
|
|
147
|
+
return {
|
|
148
|
+
created: [],
|
|
149
|
+
reads: handleRefs(event, [
|
|
150
|
+
'source',
|
|
151
|
+
'destination',
|
|
152
|
+
'sourceHandleId',
|
|
153
|
+
'destinationHandleId',
|
|
154
|
+
'bufferHandleId',
|
|
155
|
+
'textureHandleId',
|
|
156
|
+
]),
|
|
157
|
+
destroyed: [],
|
|
158
|
+
};
|
|
159
|
+
default:
|
|
160
|
+
return { created: [], reads: [], destroyed: [] };
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
function handleRefs(event: object, keys: readonly string[]): string[] {
|
|
165
|
+
const refs: string[] = [];
|
|
166
|
+
for (const key of keys) {
|
|
167
|
+
const value = (event as Record<string, unknown>)[key];
|
|
168
|
+
if (typeof value === 'string') refs.push(value);
|
|
169
|
+
if (Array.isArray(value))
|
|
170
|
+
refs.push(...value.filter((item): item is string => typeof item === 'string'));
|
|
171
|
+
}
|
|
172
|
+
return refs;
|
|
173
|
+
}
|