mirror of
https://github.com/Spengreb/sync.git
synced 2026-05-14 03:32:06 +00:00
28 lines
561 B
JavaScript
28 lines
561 B
JavaScript
|
|
import clone from 'clone';
|
||
|
|
|
||
|
|
export default class WebConfiguration {
|
||
|
|
constructor(config) {
|
||
|
|
this.config = config;
|
||
|
|
}
|
||
|
|
|
||
|
|
getEmailContacts() {
|
||
|
|
return clone(this.config.contacts);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
WebConfiguration.fromOldConfig = function (oldConfig) {
|
||
|
|
const config = {
|
||
|
|
contacts: []
|
||
|
|
};
|
||
|
|
|
||
|
|
oldConfig.get('contacts').forEach(contact => {
|
||
|
|
config.contacts.push({
|
||
|
|
name: contact.name,
|
||
|
|
email: contact.email,
|
||
|
|
title: contact.title
|
||
|
|
});
|
||
|
|
});
|
||
|
|
|
||
|
|
return new WebConfiguration(config);
|
||
|
|
};
|