VulpesOS/gaia/apps/calendar/js/common/probably_parse_int.js
OverSu b38dea0597 Publish Vulpes Preview 15 sources for desktop, Android and Tundra
Share Gaia assets and adapters, keep private profiles and development documents local, and update both public READMEs.
2026-09-30 23:13:03 +02:00

20 lines
390 B
JavaScript
Executable file

define(function(require, exports, module) {
'use strict';
var NUMERIC = /^[0-9]+$/;
/**
* @param {number|string} id Some id.
*/
module.exports = function(id) {
// by an unfortunate decision we have both
// string ids and number ids.. based on the
// input we run parseInt
if (typeof id === 'string' && id.match(NUMERIC)) {
return parseInt(id, 10);
}
return id;
};
});