(key: string)
| 6 | |
| 7 | /* exported getSettings */ |
| 8 | export const getSettings = (key: string) => { |
| 9 | const schema = Gio.SettingsSchemaSource.new_from_directory( |
| 10 | Me.instance.metadata.dir.get_child('schemas').get_path()!, |
| 11 | Gio.SettingsSchemaSource.get_default(), |
| 12 | false |
| 13 | ).lookup(Me.instance.metadata[key], true); |
| 14 | |
| 15 | if (schema !== null) { |
| 16 | return new Gio.Settings({ |
| 17 | settings_schema: schema, |
| 18 | }); |
| 19 | } else { |
| 20 | throw Error('Cannot find schema'); |
| 21 | } |
| 22 | }; |
no test coverage detected