Skip to content

Commit

Permalink
add support for bigInt numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
jcubic committed Nov 25, 2023
1 parent 01fa515 commit 8e3b5e3
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 12 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,7 @@
## 2.38.0
### Features
* add support for bigInt numbers

## 2.37.2
### Bugfix
* fix for TypeScript from [Antoine](https://github.com/antoineol) ([#896](https://github.com/jcubic/jquery.terminal/pull/896)) and [KiddoV](https://github.com/KiddoV) ([#901](https://github.com/jcubic/jquery.terminal/pull/901))
Expand Down
17 changes: 14 additions & 3 deletions js/jquery.terminal-2.37.2.js
Expand Up @@ -41,7 +41,7 @@
*
* broken image by Sophia Bai from the Noun Project (CC-BY)
*
* Date: Fri, 20 Oct 2023 12:55:07 +0000
* Date: Sat, 25 Nov 2023 14:19:12 +0000
*/
/* global define, Map */
/* eslint-disable */
Expand Down Expand Up @@ -5278,7 +5278,7 @@
// -------------------------------------------------------------------------
$.terminal = {
version: 'DEV',
date: 'Fri, 20 Oct 2023 12:55:07 +0000',
date: 'Sat, 25 Nov 2023 14:19:12 +0000',
// colors from https://www.w3.org/wiki/CSS/Properties/color/keywords
color_names: [
'transparent', 'currentcolor', 'black', 'silver', 'gray', 'white',
Expand Down Expand Up @@ -6491,7 +6491,10 @@
return new RegExp(regex[1], regex[2]);
} else if (arg.match(/['"`]/)) {
return parse_string(arg);
} else if (arg.match(/^-?[0-9]+$/)) {
} else if (arg.match(/^-?[0-9]+n?$/)) {
if (arg.match(/n$/)) {
return BigInt(arg.replace(/n$/, ''));
}
return parseInt(arg, 10);
} else if (arg.match(float_re)) {
return parseFloat(arg);
Expand Down Expand Up @@ -7306,6 +7309,10 @@
return is_object(object) && is_function(object.then || object.done);
}
// -----------------------------------------------------------------------
function is_big_int(object) {
return typeof object === 'bigint';
}
// -----------------------------------------------------------------------
function is_deferred(object) {
return is_promise(object) && is_function(object.promise);
}
Expand Down Expand Up @@ -11704,7 +11711,11 @@
} else if (is_array(value)) {
value = $.terminal.columns(value, self.cols(), settings.tabs);
} else {
var need_suffix = is_big_int(value);
value = String(value);
if (need_suffix) {
value += 'n';
}
}
}
return value;
Expand Down
4 changes: 2 additions & 2 deletions js/jquery.terminal-2.37.2.min.js

Large diffs are not rendered by default.

13 changes: 12 additions & 1 deletion js/jquery.terminal-src.js
Expand Up @@ -6491,7 +6491,10 @@
return new RegExp(regex[1], regex[2]);
} else if (arg.match(/['"`]/)) {
return parse_string(arg);
} else if (arg.match(/^-?[0-9]+$/)) {
} else if (arg.match(/^-?[0-9]+n?$/)) {
if (arg.match(/n$/)) {
return BigInt(arg.replace(/n$/, ''));

Check failure on line 6496 in js/jquery.terminal-src.js

View workflow job for this annotation

GitHub Actions / build

'BigInt' is not defined
}
return parseInt(arg, 10);
} else if (arg.match(float_re)) {
return parseFloat(arg);
Expand Down Expand Up @@ -7306,6 +7309,10 @@
return is_object(object) && is_function(object.then || object.done);
}
// -----------------------------------------------------------------------
function is_big_int(object) {
return typeof object === 'bigint';
}
// -----------------------------------------------------------------------
function is_deferred(object) {
return is_promise(object) && is_function(object.promise);
}
Expand Down Expand Up @@ -11704,7 +11711,11 @@
} else if (is_array(value)) {
value = $.terminal.columns(value, self.cols(), settings.tabs);
} else {
var need_suffix = is_big_int(value);
value = String(value);
if (need_suffix) {
value += 'n';
}
}
}
return value;
Expand Down
17 changes: 14 additions & 3 deletions js/jquery.terminal.js
Expand Up @@ -41,7 +41,7 @@
*
* broken image by Sophia Bai from the Noun Project (CC-BY)
*
* Date: Fri, 20 Oct 2023 12:55:07 +0000
* Date: Sat, 25 Nov 2023 14:19:12 +0000
*/
/* global define, Map */
/* eslint-disable */
Expand Down Expand Up @@ -5278,7 +5278,7 @@
// -------------------------------------------------------------------------
$.terminal = {
version: 'DEV',
date: 'Fri, 20 Oct 2023 12:55:07 +0000',
date: 'Sat, 25 Nov 2023 14:19:12 +0000',
// colors from https://www.w3.org/wiki/CSS/Properties/color/keywords
color_names: [
'transparent', 'currentcolor', 'black', 'silver', 'gray', 'white',
Expand Down Expand Up @@ -6491,7 +6491,10 @@
return new RegExp(regex[1], regex[2]);
} else if (arg.match(/['"`]/)) {
return parse_string(arg);
} else if (arg.match(/^-?[0-9]+$/)) {
} else if (arg.match(/^-?[0-9]+n?$/)) {
if (arg.match(/n$/)) {
return BigInt(arg.replace(/n$/, ''));
}
return parseInt(arg, 10);
} else if (arg.match(float_re)) {
return parseFloat(arg);
Expand Down Expand Up @@ -7306,6 +7309,10 @@
return is_object(object) && is_function(object.then || object.done);
}
// -----------------------------------------------------------------------
function is_big_int(object) {
return typeof object === 'bigint';
}
// -----------------------------------------------------------------------
function is_deferred(object) {
return is_promise(object) && is_function(object.promise);
}
Expand Down Expand Up @@ -11704,7 +11711,11 @@
} else if (is_array(value)) {
value = $.terminal.columns(value, self.cols(), settings.tabs);
} else {
var need_suffix = is_big_int(value);
value = String(value);
if (need_suffix) {
value += 'n';
}
}
}
return value;
Expand Down
4 changes: 2 additions & 2 deletions js/jquery.terminal.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/jquery.terminal.min.js.map

Large diffs are not rendered by default.

0 comments on commit 8e3b5e3

Please sign in to comment.