-
Notifications
You must be signed in to change notification settings - Fork 66.8k
Expand file tree
/
Copy pathfeatures.ts
More file actions
32 lines (27 loc) · 887 Bytes
/
features.ts
File metadata and controls
32 lines (27 loc) · 887 Bytes
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
import { schema } from '@/frame/lib/frontmatter'
interface FeatureVersionsProperties {
type?: string | string[]
properties?: Record<string, unknown>
additionalProperties?: boolean
[key: string]: unknown
}
interface FeatureVersionsSchema {
type: 'object'
properties: {
versions: FeatureVersionsProperties
}
additionalProperties: false
}
// Copy the properties from the frontmatter schema.
const featureVersions: FeatureVersionsSchema = {
type: 'object',
properties: {
versions: Object.assign({}, schema.properties.versions) as FeatureVersionsProperties,
},
additionalProperties: false,
}
// Remove the feature versions properties.
// We don't want to allow features within features! We just want pure versioning.
delete (featureVersions.properties.versions.properties as Record<string, unknown> | undefined)
?.feature
export default featureVersions