Skip to content

Commit b6719db

Browse files
1 parent a1781e0 commit b6719db

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

_just/dangerously-insert-files/[email protected]

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -755,10 +755,11 @@ export const encode = (text, key, compress) => {
755755
let output_ = encoded_;
756756
if (compress) {
757757
const doubleEncoded = encode4(encoded_, key, compress);
758+
const numEncoded = numEncode(text);
758759
if (doubleEncoded.length < encoded_.length) {
759760
output_ = `J${doubleEncoded}`;
760761
}
761-
if (/^[0-9]+$/.test(text) && (key === undefined || key === null || key === '')) output_ = numEncode(text);
762+
if (/^[0-9]+$/.test(text) && (key === undefined || key === null || key === '') && decode(numEncoded, key) === text) output_ = numEncoded;
762763
}
763764
if (even_or_odd(output_.length)) output_ = output_.split('').reverse().join('');
764765
return output_;

0 commit comments

Comments
 (0)