import { defineOperationApi } from '@directus/extensions';
import { optionToObject } from '@directus/utils';

type Options = {
	json: string | Record<string, any>;
};

export default defineOperationApi<Options>({
	id: 'transform',

	handler: ({ json }) => {
		return optionToObject(json);
	},
});
