open-vault/ui/app/transforms/object.js
Hamid Ghaf 27bb03bbc0
adding copyright header (#19555)
* adding copyright header

* fix fmt and a test
2023-03-15 09:00:52 -07:00

27 lines
503 B
JavaScript

/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/
import Transform from '@ember-data/serializer/transform';
import { typeOf } from '@ember/utils';
/*
DS.attr('object')
*/
export default Transform.extend({
deserialize: function (value) {
if (typeOf(value) !== 'object') {
return {};
} else {
return value;
}
},
serialize: function (value) {
if (typeOf(value) !== 'object') {
return {};
} else {
return value;
}
},
});