Skip to content
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

Break out tcf URLs and dataRetention into their own codecs #96

Merged
merged 4 commits into from
Sep 15, 2023

Conversation

linh-transcend
Copy link
Member

Related Issues

  • [none]

Security Implications

[none]

System Availability

[none]

@linh-transcend linh-transcend requested review from a team and MadDataScience September 15, 2023 14:52
MadDataScience
MadDataScience previously approved these changes Sep 15, 2023
Copy link
Contributor

@MadDataScience MadDataScience left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a minor suggestion. (Then in createTCFVendors.ts you could put

urls: decodeCodec(t.array(TcfGvlV3Url), urls);

for instance.

src/iab.ts Outdated
Comment on lines 130 to 137
export const TcfGvlV3Urls = t.array(
t.intersection([
t.type({ langId: t.string, privacy: t.string }),
t.partial({
legIntClaim: t.string,
}),
]),
);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I find

Suggested change
export const TcfGvlV3Urls = t.array(
t.intersection([
t.type({ langId: t.string, privacy: t.string }),
t.partial({
legIntClaim: t.string,
}),
]),
);
export const TcfGvlV3Url = t.intersection([
t.type({ langId: t.string, privacy: t.string }),
t.partial({
legIntClaim: t.string,
}),
]);

a little more flexible. It's easier to wrap a type in t.array than to unravel it if you need.

src/iab.ts Outdated
]),
),
dataRetention: TcfGvlV3DataRetention,
urls: TcfGvlV3Urls,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
urls: TcfGvlV3Urls,
urls: t.array(TcfGvlV3Url),

following the above suggestion.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahhh it much more flexible now! I made the change and it should be ready for re-review! Thanks!

Copy link
Contributor

@MadDataScience MadDataScience left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👌🏼

@linh-transcend linh-transcend merged commit 749dec9 into main Sep 15, 2023
10 checks passed
@delete-merged-branch delete-merged-branch bot deleted the linh-transcend/make-codecs-tcf-urls branch September 15, 2023 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants