mirror of
https://github.com/selfxyz/self.git
synced 2026-04-05 03:00:53 -04:00
add check that value of field is not empty in revealBitmap.ts
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
import { attributeToPosition } from "../constants/constants";
|
||||
|
||||
export function revealBitmapFromMapping(attributeToReveal: { [key: string]: boolean }): string[] {
|
||||
export function revealBitmapFromMapping(attributeToReveal: { [key: string]: string }): string[] {
|
||||
const reveal_bitmap = Array(90).fill('0');
|
||||
|
||||
Object.entries(attributeToReveal).forEach(([attribute, reveal]) => {
|
||||
if (reveal) {
|
||||
if (reveal !== "") {
|
||||
const [start, end] = attributeToPosition[attribute as keyof typeof attributeToPosition];
|
||||
reveal_bitmap.fill('1', start, end + 1);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user