MCPcopy Create free account
hub / github.com/adcontextprotocol/adcp / stripGeneratedMetadata

Function stripGeneratedMetadata

scripts/check-generated-artifact-diff.cjs:35–44  ·  view source on GitHub ↗
(value)

Source from the content-addressed store, hash-verified

33const GENERATED_KEYS = new Set(['generated_at', 'generatedAt', '_generatedAt']);
34
35function stripGeneratedMetadata(value) {
36 if (Array.isArray(value)) return value.map(stripGeneratedMetadata);
37 if (!value || typeof value !== 'object') return value;
38 const copy = {};
39 for (const [key, child] of Object.entries(value)) {
40 if (GENERATED_KEYS.has(key)) continue;
41 copy[key] = stripGeneratedMetadata(child);
42 }
43 return copy;
44}
45
46function normalize(file, content) {
47 if (file.endsWith('.json')) {

Callers 1

normalizeFunction · 0.85

Calls 1

hasMethod · 0.80

Tested by

no test coverage detected