import Transform from 'ember-data/transform';

export default Transform.extend({
  deserialize(serialized) {
    var ret;
    try{
      ret = new URL(serialized);
    }catch(e){
      return;
    }
    return ret;
  },

  serialize(deserialized) {
    if(!deserialized || !deserialized.href)
      return;
    return String(deserialized);
  }
});

import Tsygan from './tsygan';

export default Tsygan.extend({
  _deserializer(serialized) {
    var ret;
    try{
      ret = new URL(serialized);
    }catch(e){
      return;
    }
    return ret;
  },

  _serializer(deserialized) {
    if(!deserialized || !deserialized.href)
      return;
    return String(deserialized);
  }
});

Fix URL type to extend Tsygan
Fix URL type to extend Tsygan

Signed-off-by: dubo-dubon-duponey <c7a63b10c8d959c614e8acfe1ebf734c28aed595@pm.me>