misc: addressed review comments

This commit is contained in:
Sheen Capadngan
2024-12-13 13:39:23 +08:00
parent a7b25f3bd8
commit c35657ed49
10 changed files with 48 additions and 18 deletions
@@ -1,4 +1,9 @@
import picomatch from "picomatch";
export const doesFieldValueMatchJwtPolicy = (fieldValue: string, policyValue: string) =>
policyValue === fieldValue || picomatch.isMatch(fieldValue, policyValue);
export const doesFieldValueMatchJwtPolicy = (fieldValue: string | boolean, policyValue: string) => {
if (typeof fieldValue === "boolean") {
return fieldValue === (policyValue === "true");
}
return policyValue === fieldValue || picomatch.isMatch(fieldValue, policyValue);
};