Updates
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
import { TurboSyncFileObject } from "../types";
|
||||
|
||||
export default function fldFileToStrArr(
|
||||
srces?: (string | TurboSyncFileObject)[]
|
||||
) {
|
||||
if (!srces) return undefined;
|
||||
|
||||
let arr: string[] = [];
|
||||
|
||||
for (let i = 0; i < srces.length; i++) {
|
||||
const src = srces[i];
|
||||
const srcStr = fldFileToStr(src);
|
||||
if (srcStr) {
|
||||
arr.push(srcStr);
|
||||
}
|
||||
}
|
||||
|
||||
return arr;
|
||||
}
|
||||
|
||||
export function fldFileToStr(src?: string | TurboSyncFileObject) {
|
||||
if (!src) return undefined;
|
||||
|
||||
if (typeof src == "string") {
|
||||
return src;
|
||||
} else if (typeof src == "object" && src.path) {
|
||||
return src.path;
|
||||
}
|
||||
|
||||
return undefined;
|
||||
}
|
||||
Reference in New Issue
Block a user