Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/svelte.dev/scripts/sync-docs/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import fs from 'node:fs';
import ts from 'typescript';
import glob from 'tiny-glob/sync';
import { fileURLToPath } from 'node:url';
import { clone_repo, migrate_meta_json, replace_strings, strip_origin } from './utils';
import { clone_repo, migrate_meta_json, strip_origin } from './utils';
import { get_types, read_d_ts_file, read_types } from './types';
import type { Modules } from '@sveltejs/site-kit/markdown';

Expand Down
10 changes: 0 additions & 10 deletions apps/svelte.dev/scripts/sync-docs/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,6 @@ export function invoke(cmd: string, args: string[], opts: SpawnOptions) {
});
}

export function replace_strings(obj: any, replace: (str: string) => string) {
for (let key in obj) {
if (typeof obj[key] === 'object') {
replace_strings(obj[key], replace);
} else if (typeof obj[key] === 'string') {
obj[key] = replace(obj[key]);
}
}
}

/** Older versions of the documentation did use meta.json instead of index.md */
export function migrate_meta_json(path: string) {
const files = glob(`${path}/**/meta.json`);
Expand Down
Loading