data-validator-js
Version:
Validation Methods for all types of Data
34 lines (33 loc) • 1.02 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
var stringUtils_1 = require("./stringUtils");
var ScriptUtilities = /** @class */ (function () {
function ScriptUtilities() {
}
/**
* Checks object is null or undefined.
* @param obj Object for which we need to check
*/
ScriptUtilities.IsNullOrUndefined = function (obj) {
return obj === null || obj === undefined;
};
/**
* Returns true if machine is a mac machine.
*/
ScriptUtilities.IsMacMachine = function () {
return navigator.platform.indexOf('Mac') !== -1;
};
/**
* Returns a numeric value
* @param value value of attribute
*/
ScriptUtilities.getNumericValue = function (value, radix) {
if (radix === void 0) { radix = 10; }
if (!stringUtils_1.default.IsNullOrEmpty(value)) {
return parseInt(value, radix);
}
return null;
};
return ScriptUtilities;
}());
exports.default = ScriptUtilities;