/** * Simple utility functions * @module util * * @example * const { isNil } = require('@cumulus/common/util'); * * isNil(undefined); // => true */ /// /** * Mark a piece of code as deprecated. * * Each deprecation notice for a given name and version combination will * only be printed once. * * @param {string} name - the name of the function / method / class to deprecate * @param {string} version - the version after which the code will be marked * as deprecated * @param {string} [alternative] - the function / method / class to use instead * of this deprecated code * * @alias module:util */ export declare const deprecate: (name: string, version: string, alternative?: string | undefined) => void; /** * Wait for the defined number of milliseconds * * @param {number} waitPeriodMs - number of milliseconds to wait * @returns {Promise.} promise resolves after a given time period * * @deprecated * * @alias module:util */ export declare const sleep: (waitPeriodMs: number) => Promise; /** * Synchronously makes a temporary directory, smoothing over the differences between * mkdtempSync in node.js for various platforms and versions * * @param {string} name - A base name for the temp dir, to be uniquified for the final name * @returns {string} The absolute path to the created dir * * @private * * @deprecated */ export declare const mkdtempSync: (name: string) => string; /** * Does nothing. Used where a callback is required but not used. * * @returns {undefined} undefined * * @alias module:util * * @deprecated */ export declare const noop: () => void; /** * Replacement for lodash.omit returns a shallow copy of input object * with keys removed. * (lodash.omit will be removed in v5.0.0) * https://github.com/lodash/lodash/wiki/Roadmap#v500-2019 * * @param {Object} objectIn - input object * @param {(string|string[])} keys - key or list of keys to remove from object * @returns {Object} copy of objectIn without keys attached. * * @alias module:util * * @deprecated */ export declare const omit: (objectIn: any, keys: any) => any; /** * Creates a function that returns the opposite of the predicate function. * * @param {Function} predicate - the predicate to negate * @returns {Function} the new negated function * * @alias module:util * * @deprecated * * @example * const isEven = (x) => x % 2 === 0; * const isOdd = negate(isEven); * * isOdd(2); // => false * isOdd(3); // => true */ export declare const negate: boolean>(predicate: T) => (...args: Parameters) => boolean; /** * Test if a value is null * * @param {*} x - value to check * @returns {boolean} * * @deprecated * * @alias module:util */ export declare const isNull: (x: unknown) => boolean; /** * Test if a value is undefined * * @param {*} x value to check * @returns {boolean} * * @deprecated * * @alias module:util */ export declare const isUndefined: (x: unknown) => boolean; /** * Test if a value is null or undefined * * @param {*} x value to check * @returns {boolean} * * @deprecated * * @alias module:util */ export declare const isNil: (x: unknown) => boolean; /** * Rename an object property * * @param {string} from - old property name * @param {string} to - new property name * @param {Object} obj - object to update * @returns {Object} a shallow clone of the object with updated property name * * @deprecated * * @alias module:util */ export declare const renameProperty: (from: keyof T, to: string, obj: T) => T & { [x: string]: T[keyof T]; }; /** * Remove properties whose values are `null` or `undefined` * * @param {Object} obj - object to update * @returns {Object} a shallow clone of the object with `null` and `undefined` * properties removed * * @alias module:util */ export declare const removeNilProperties: (obj: T) => Partial; /** * Return mime-type based on input url or filename * * @param {string} key * @returns {string} mimeType or null * * @deprecated * * @alias module:util */ export declare const lookupMimeType: (key: string) => string | null; /** * Test if a value is included in a list of items * * This is a curried function - https://lodash.com/docs/4.17.11#curry * * @param {Array} collection - the list of items to check against * @param {Object} val - the item to check for in the collection * @returns {boolean} * * @alias module:util * @kind function */ export declare const isOneOf: import("lodash").CurriedFunction2; /** * Pass a value through a pipeline of functions and return the result * * @param {*} value - the value to be passed through the pipeline of functions * @param {...Function} fns - the functions to be invoked * @returns {*} the result of passing the value through the functions: * - If no functions are provided, the value is returned. * - Functions should expect a single argument * * @deprecated * * @alias module:util */ export declare const thread: (value: any, ...fns: any[]) => any; //# sourceMappingURL=util.d.ts.map