-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix data mate import copy #3727
Conversation
bump: (patch) terafoundation@1.2.3, ts-transforms@1.0.3
packages/data-mate/src/index.ts
Outdated
|
||
FieldTransform.repository.extract = extractConfig; | ||
FieldTransform.extract = extract; | ||
const tmpFieldTransform = {}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are creating an empty object and trying to force a type on it, hence all the type additions which would be burdensome to mantain or know to add to it when we add another function.
This should be a simple
const FieldTransforms = {
...FTransfom
}
This copies the types over for you and still maintains the types
packages/data-mate/src/interfaces.ts
Outdated
decodeHex: typeof FieldTransform.decodeHex; | ||
decodeURL: typeof FieldTransform.decodeURL; | ||
encodeBase64: typeof FieldTransform.encodeBase64; | ||
encodeHex: typeof FieldTransform.encodeHex; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should not be needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This PR makes the following changes:
packages/data-mate/src/index.ts
to copy each property from theFTransform
andRTransform
imports to a new object instead of usingcloneDeep
. This avoids a type error that occurs whenteraslice-cli assets build
tries to build an ESM asset that importsdata-mate
See here for details: #3725