open-vault/ui/app/transforms/array.js
Matthew Irish d509588cd2
Ember update (#5386)
Ember update - update ember-cli, ember-data, and ember to 3.4 series
2018-09-25 11:28:26 -05:00

24 lines
429 B
JavaScript

import { isArray, A } from '@ember/array';
import DS from 'ember-data';
/*
This should go inside a globally available place for all apps
DS.attr('array')
*/
export default DS.Transform.extend({
deserialize(value) {
if (isArray(value)) {
return A(value);
} else {
return A();
}
},
serialize(value) {
if (isArray(value)) {
return A(value);
} else {
return A();
}
},
});