@decidables/decidables-elements
Version:
decidables-elements: Basic UI Web Components for the decidables project
16 lines (13 loc) • 322 B
JavaScript
/*
Attribute: Space-separated sequence of strings
Property: Set of strings
*/
const DecidablesConverterSet = {
fromAttribute: (value) => {
return new Set(value.split(/\s+/));
},
toAttribute: (value) => {
return (value.size) ? [...value].join(' ') : null;
},
};
export default DecidablesConverterSet;