Skip to content

Commit

Permalink
fix: revert unnecessary changes
Browse files Browse the repository at this point in the history
  • Loading branch information
stepan662 committed Oct 15, 2024
1 parent e850f91 commit decedfb
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions packages/web/src/package/observers/invisible/secret.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ function padToWholeBytes(binary: string) {
}

export function encodeMessage(text: string) {
// insert a message end character
// so we can distinguish two secret messages right next to each other
const bytes = toBytes(text).map(Number);
const binary = bytes
.map((byte) => padToWholeBytes(byte.toString(2)) + '0')
Expand Down Expand Up @@ -58,12 +56,7 @@ export function decodeFromText(text: string) {
const invisibleMessages = text
.match(INVISIBLE_REGEX)
?.filter((m) => m.length > 8);
const result = [];
invisibleMessages?.map(decodeMessage).forEach((message) => {
result.push(message);
});

return result;
return invisibleMessages?.map(decodeMessage) || [];
}

export function removeSecrets(text: string) {
Expand Down

0 comments on commit decedfb

Please sign in to comment.