tsonik
Version:
A TypeScript client library for the Iconik API based on Swagger documentation
19 lines • 636 B
JavaScript
;
/**
* Utility functions for the Tsonik client
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.cleanParams = void 0;
/**
* Cleans parameters by removing undefined and null values
* @param params - The parameters object to clean
* @returns A new object with undefined and null values filtered out
*/
function cleanParams(params) {
if (!params || typeof params !== 'object') {
return {};
}
return Object.fromEntries(Object.entries(params).filter(([_, value]) => value !== undefined && value !== null));
}
exports.cleanParams = cleanParams;
//# sourceMappingURL=utils.js.map