This repository has been archived by the owner on Mar 2, 2022. It is now read-only.
generated from electrovir/base-vir
-
Notifications
You must be signed in to change notification settings - Fork 0
/
migrate-library.ts
62 lines (58 loc) · 1.79 KB
/
migrate-library.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
import {defaultOptions, MigrationApiInput, MigrationOutput} from '../api/api-types';
import {makeNewLibrary} from './make-new-library';
import {outputLibrary} from './output-library';
import {ParsedLibrary} from './reading/parsed-types';
import {readLibraryFile} from './reading/read-library';
export function migrateLibrary({
libraryFilePath,
replacePaths,
outputType,
options: rawOptions,
extraTrackProcessing,
}: MigrationApiInput<MigrationOutput.JsonObject>): ParsedLibrary;
export function migrateLibrary({
libraryFilePath,
replacePaths,
outputType,
options: rawOptions,
extraTrackProcessing,
}: MigrationApiInput<MigrationOutput.WriteToFile>): {filePath: string};
export function migrateLibrary({
libraryFilePath,
replacePaths,
outputType,
options: rawOptions,
extraTrackProcessing,
}: MigrationApiInput<MigrationOutput.PlistString>): {plist: string};
export function migrateLibrary({
libraryFilePath,
replacePaths,
outputType,
options: rawOptions,
extraTrackProcessing,
}: MigrationApiInput): {filePath: string} | {plist: string} | ParsedLibrary;
export function migrateLibrary({
libraryFilePath,
replacePaths,
outputType = MigrationOutput.WriteToFile,
options: rawOptions = defaultOptions,
extraTrackProcessing,
}: MigrationApiInput): {filePath: string} | {plist: string} | ParsedLibrary {
const options = {...defaultOptions, ...rawOptions};
const oldLibrary = readLibraryFile({
libraryFilePath: libraryFilePath,
...options,
});
const newLibrary = makeNewLibrary({
oldLibrary,
replacePaths,
extraTrackProcessing,
...options,
});
return outputLibrary({
libraryFilePath,
newLibrary,
outputType,
...options,
});
}