Files
threshold-ui/addons/api/addon/transforms/string-array.js
T

20 lines
420 B
JavaScript
Raw Normal View History

/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1
*/
2025-04-03 09:32:44 -07:00
export default class StringArrayTransform {
deserialize(serialized) {
const stringValues = serialized || [];
return stringValues.map((value) => ({ value }));
}
serialize(deserialized) {
const strings = deserialized || [];
return strings.map(({ value }) => value);
}
2025-04-03 09:32:44 -07:00
static create() {
return new this();
}
}