blob: c926fa8b44498973032c0e5bdf452e2f34c42977 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
|
// A file extension! Or the default, if provided when calling this.
import {isFileExtension} from '#validators';
// TODO: Not templateCompositeFrom.
export default function(defaultFileExtension = null) {
return {
flags: {update: true, expose: true},
update: {validate: isFileExtension},
expose: {transform: (value) => value ?? defaultFileExtension},
};
}
|