Skip to content

Commit a493cbd

Browse files
committed
Fix error TS2365 reported by TypeScript
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
1 parent 8000b01 commit a493cbd

File tree

6 files changed

+6
-8
lines changed

6 files changed

+6
-8
lines changed

js/src/makegrid.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1128,12 +1128,12 @@ const makeGrid = function (t, enableResize = undefined, enableReorder = undefine
11281128
var showMicrosec = false;
11291129
var timeFormat = 'HH:mm:ss';
11301130
// check for decimal places of seconds
1131-
if (($td.attr('data-decimals') > 0) && ($td.attr('data-type').indexOf('time') !== -1)) {
1131+
if ((Number($td.attr('data-decimals')) > 0) && ($td.attr('data-type').indexOf('time') !== -1)) {
11321132
if (datetimeValue && datetimeValue.indexOf('.') === false) {
11331133
datetimeValue += '.';
11341134
}
11351135

1136-
if ($td.attr('data-decimals') > 3) {
1136+
if (Number($td.attr('data-decimals')) > 3) {
11371137
showMillisec = true;
11381138
showMicrosec = true;
11391139
timeFormat = 'HH:mm:ss.lc';

js/src/modules/functions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ function addDateTimePicker () {
166166
}
167167

168168
$('input.timefield, input.datefield, input.datetimefield').each(function () {
169-
var decimals = $(this).parent().attr('data-decimals');
169+
var decimals = Number($(this).parent().attr('data-decimals'));
170170
var type = $(this).parent().attr('data-type');
171171

172172
var showMillisec = false;

js/src/modules/indexes.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -584,7 +584,7 @@ function on () {
584584
*/
585585
var $currRow = $anchor.parents('tr');
586586
/** @var {number} rows Number of columns in the key */
587-
var rows = $anchor.parents('td').attr('rowspan') || 1;
587+
var rows = Number($anchor.parents('td').attr('rowspan')) || 1;
588588
/** @var {number} $rowsToHide Rows that should be hidden */
589589
var $rowsToHide = $currRow;
590590
for (var i = 1, $lastRow = $currRow.next(); i < rows; i++, $lastRow = $lastRow.next()) {

js/src/table/change.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -670,7 +670,7 @@ function addNewContinueInsertionFields (event) {
670670
/**
671671
* @var target_rows Number of rows the user wants
672672
*/
673-
var targetRows = $('#insert_rows').val();
673+
var targetRows = Number($('#insert_rows').val());
674674

675675
// remove all datepickers
676676
$('input.datefield, input.datetimefield').each(function () {

js/src/table/structure.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,7 @@ AJAX.registerOnload('table/structure.js', function () {
7575
* @var form object referring to the export form
7676
*/
7777
var $form = $(this);
78-
var fieldCnt = $form.find('input[name=orig_num_fields]').val();
79-
78+
var fieldCnt = Number($form.find('input[name=orig_num_fields]').val());
8079

8180
function submitForm () {
8281
var $msg = ajaxShowMessage(window.Messages.strProcessingRequest);

webpack.config.cjs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ const publicPath = path.resolve(__dirname, 'public');
1212
const typeScriptErrorsToIgnore = [
1313
2322, // TS2322: Type '%s' is not assignable to type '%s'.
1414
2345, // TS2345: Argument of type '%s' is not assignable to parameter of type '%s'.
15-
2365, // TS2365: Operator '%s' cannot be applied to types '%s' and '%s'.
1615
2367, // TS2367: This comparison appears to be unintentional because the types '%s' and '%s' have no overlap.
1716
2405, // TS2405: The left-hand side of a 'for...in' statement must be of type 'string' or 'any'.
1817
2538, // TS2538: Type '%s' cannot be used as an index type.

0 commit comments

Comments
 (0)