Open
Description
Description
In the previous version it was possible to access to the defaultMetadataStorage which was useful to create custom transformer.
for example :
Minimal code-snippet showcasing the problem
import { TransformOptions } from 'class-transformer';
import { defaultMetadataStorage } from 'class-transformer/storage/'; <== cannot find module anymore
export function doSplit(separator: string | RegExp = ' ') {
return (value: any) => {
return value !== undefined && value !== null
? String(value).split(separator)
: [];
};
}
export function Split(
separator: string | RegExp,
options: TransformOptions = {},
): PropertyDecorator {
const transformFn = doSplit(separator);
return function (target: any, propertyName: string | symbol): void {
defaultMetadataStorage.addTransformMetadata({
target: target.constructor,
propertyName: propertyName as string,
transformFn,
options,
});
};
}
Expected behavior
Get the defaultMetadataStorage !
Actual behavior
"Cannot find module 'class-transformer/storage' or its corresponding type declarations."