{"ast":null,"code":"import { TransformOperationExecutor } from './TransformOperationExecutor';\nimport { TransformationType } from './enums';\nimport { defaultOptions } from './constants/default-options.constant';\nexport class ClassTransformer {\n  instanceToPlain(object, options) {\n    const executor = new TransformOperationExecutor(TransformationType.CLASS_TO_PLAIN, {\n      ...defaultOptions,\n      ...options\n    });\n    return executor.transform(undefined, object, undefined, undefined, undefined, undefined);\n  }\n  classToPlainFromExist(object, plainObject, options) {\n    const executor = new TransformOperationExecutor(TransformationType.CLASS_TO_PLAIN, {\n      ...defaultOptions,\n      ...options\n    });\n    return executor.transform(plainObject, object, undefined, undefined, undefined, undefined);\n  }\n  plainToInstance(cls, plain, options) {\n    const executor = new TransformOperationExecutor(TransformationType.PLAIN_TO_CLASS, {\n      ...defaultOptions,\n      ...options\n    });\n    return executor.transform(undefined, plain, cls, undefined, undefined, undefined);\n  }\n  plainToClassFromExist(clsObject, plain, options) {\n    const executor = new TransformOperationExecutor(TransformationType.PLAIN_TO_CLASS, {\n      ...defaultOptions,\n      ...options\n    });\n    return executor.transform(clsObject, plain, undefined, undefined, undefined, undefined);\n  }\n  instanceToInstance(object, options) {\n    const executor = new TransformOperationExecutor(TransformationType.CLASS_TO_CLASS, {\n      ...defaultOptions,\n      ...options\n    });\n    return executor.transform(undefined, object, undefined, undefined, undefined, undefined);\n  }\n  classToClassFromExist(object, fromObject, options) {\n    const executor = new TransformOperationExecutor(TransformationType.CLASS_TO_CLASS, {\n      ...defaultOptions,\n      ...options\n    });\n    return executor.transform(fromObject, object, undefined, undefined, undefined, undefined);\n  }\n  serialize(object, options) {\n    return JSON.stringify(this.instanceToPlain(object, options));\n  }\n  /**\n   * Deserializes given JSON string to a object of the given class.\n   */\n  deserialize(cls, json, options) {\n    const jsonObject = JSON.parse(json);\n    return this.plainToInstance(cls, jsonObject, options);\n  }\n  /**\n   * Deserializes given JSON string to an array of objects of the given class.\n   */\n  deserializeArray(cls, json, options) {\n    const jsonObject = JSON.parse(json);\n    return this.plainToInstance(cls, jsonObject, options);\n  }\n}\n//# sourceMappingURL=ClassTransformer.js.map","map":null,"metadata":{},"sourceType":"module","externalDependencies":[]}