@adobe/pdfservices-node-sdk
Version:
The Adobe PDF Services Node.js SDK provides APIs for creating, combining, exporting and manipulating PDFs.
37 lines • 1.37 kB
JavaScript
;
/*
* Copyright 2024 Adobe
* All Rights Reserved.
*
* NOTICE: Adobe permits you to use, modify, and distribute this file in
* accordance with the terms of the Adobe license agreement accompanying
* it. If you have received this file from a source other than Adobe,
* then your use, modification, or distribution of it requires the prior
* written permission of Adobe.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.StringUtil = void 0;
const CustomErrorMessages_1 = require("../constants/CustomErrorMessages");
class StringUtil {
static isNotBlank(stringToCheck) {
return !this.isBlank(stringToCheck);
}
static isBlank(stringToCheck) {
return stringToCheck === undefined || stringToCheck === null || stringToCheck.trim() === "";
}
static requireNonBlank(stringToCheck, message) {
if (this.isBlank(stringToCheck)) {
throw new TypeError(`${message} ${CustomErrorMessages_1.CustomErrorMessages.GENERIC_CAN_NOT_BE_NULL_OR_EMPTY}`);
}
}
static isPositiveInteger(value) {
const num = parseInt(value, 10);
return !isNaN(num) && num > 0;
}
static isNonNegativeInteger(value) {
const num = parseInt(value, 10);
return !isNaN(num) && num >= 0;
}
}
exports.StringUtil = StringUtil;
//# sourceMappingURL=StringUtil.js.map