import ApiResource from "~/models/ApiResource"; /** * Decorates an ApiResource's property to signal it as a field that is provided * as an IRI or an array of IRI by the API * * If the property is decorated, the HydraNormalizer will parse the IRI when de-normalizing * to get the id(s), then re-encode it as IRI(s) when re-normalizing. */ export function IriEncoded ( apiResource: typeof ApiResource ): PropertyDecorator { return (target: Object, propertyKey: string | symbol) => { //@ts-ignore const self = target.$self() //@ts-ignore self.addIriEncodedField(propertyKey, apiResource) } }