This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Lint, Test, Push, Release | |
on: | |
push: | |
branches: | |
- master | |
- main | |
tags: | |
- 'v*' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export type NestedObject<TValue> = {[key: string]: (TValue | NestedObject<TValue>)} | |
export type NestedList<TValue> = Array<TValue | NestedList<TValue>>; | |
/** | |
* Turns a nested object (e.g. {a: 1, b:2, c: {d: undefined, e: 4}} into lists and removes undefined (e.g. [1, 2, [4]]) | |
* @param o The nested object | |
* @param pred A predicate that verifies the entries type (e.g. x => typeof x === "number"). This must work with all entries except the nesting ones. | |
*/ | |
nestedObjectToNestedList<TValue extends unknown>(o: NestedObject<TValue | undefined>, pred: (o: any) => o is TValue): NestedList<TValue> { | |
return Object.values(o).filter((v): v is NestedObject<TValue | undefined> => typeof v !== "undefined").map(v => pred(v) ? v : Tools.nestedObjectToNestedList(v, pred)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
Description: | |
Renames all files in a directory according to the earliest timestamp that can be found on the file. | |
This can be useful, if images from different devices and with different naming conventions are collected. | |
The timestamp is evaluated with the DateTimeOriginal CreateDate and ModifyDate metadates, which should be present on most images and videos. | |
IMPORTANT: | |
To use this script exiftool (exiftool.org) must be installed or present in the same directory as this file. | |
Usage: |