/** * is a utility function that checks if all elements in an array have unique values for a specific key. This is useful when you want to ensure that there are no duplicate values for a specific attribute in a collection of objects. * ::: tip When to use * You should use `uniqueArrayValues` when you have an array of objects and you want to ensure that all objects have a unique value for a specific key. This can be useful in scenarios like validating user input, checking data integrity before performing operations, etc. * ::: * ::: warning When not to use * The `uniqueArrayValues` function is versatile and can be used with arrays of primitive values like numbers or strings. It can also be used with arrays of objects when you need to ensure the uniqueness of certain attributes. However, avoid using it when the uniqueness of the elements or attributes is not a concern for your use case. * ::: * @param array - The array to check for unique values. * @param key - The key to use for comparison. * @returns True if all values are unique, false otherwise. * @example * ```vue ``` * */ export declare function uniqueArrayValues(array: T[], key: K): boolean; /** * Takes any input and guarantees an array back. * - Converts array-like objects (e.g. `arguments`, `Set`) to a real array. * - Converts `undefined` to an empty array. * - Converts any another other, singular value (including `null`, objects and iterables other than `Set`) into an array containing that value. * - Ignores input which is already an array. * @example * ```ts * arrayify(undefined) * // returns [] * * arrayify(null) * // returns [ null ] * * arrayify(0) * // returns [ 0 ] * * arrayify([ 1, 2 ]) * // returns [ 1, 2 ] * * arrayify(new Set([ 1, 2 ])) * // returns [ 1, 2 ] * * function f(){ return arrayify(arguments); } * f(1,2,3) * // returns [ 1, 2, 3 ] * ``` * @param {*} - The input value to convert to an array * @returns {Array} */ export declare function arrayify(input: any): any[]; /** * Converts the given argument into an array. * @param arg - The argument to be converted. * @returns An array containing the argument or the argument itself if it is already an array. If the argument is null, an empty array is returned. * @template T - The type of the argument. */ export declare function toArray(arg: T | T[] | null): T[]; declare const _default: { toArray: typeof toArray; uniqueArrayValues: typeof uniqueArrayValues; arrayify: typeof arrayify; }; export default _default;