Skip to content

Commit 24c1dcc

Browse files
fix
1 parent 7ce0638 commit 24c1dcc

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -756,10 +756,17 @@ function encode5 (text, key, compress) {
756756
if (compress) {
757757
const doubleEncoded = encode4(encoded_, key, compress);
758758
const numEncoded = numEncode(text);
759+
const customDecode5 = (text) => {
760+
try {
761+
return decode5(text);
762+
} catch {
763+
return false;
764+
}
765+
}
759766
if (doubleEncoded.length < encoded_.length) {
760767
output_ = `J${doubleEncoded}`;
761768
}
762-
if (/^[0-9]+$/.test(text) && (key === undefined || key === null || key === '') && decode5(numEncoded) === text) {output_ = numEncoded}
769+
if (/^[0-9]+$/.test(text) && (key === undefined || key === null || key === '') && customDecode5(numEncoded) === text) {output_ = numEncoded}
763770
}
764771
if (even_or_odd(output_.length)) output_ = output_.split('').reverse().join('');
765772
return output_;

0 commit comments

Comments
 (0)