You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
 
 
 

27 lines
498 B

export default class Completions {
constructor(groups) {
this.g = groups;
}
get groups() {
return this.g;
}
serialize() {
return this.groups.map(group => ({
name: group.name,
items: group.items.map(item => ({
caption: item.caption,
content: item.content,
url: item.url,
icon: item.icon,
})),
}));
}
static EMPTY_COMPLETIONS = new Completions([]);
static empty() {
return Completions.EMPTY_COMPLETIONS;
}
}