/* eslint-disable @typescript-eslint/no-explicit-any */
/**
 * Stringify an object and convert all typed arrays to arrays
 * @param object - object to stringify.
 * @param replacer - optional replacer function.
 * @param space - optional indentation.
 * @returns JSON string.
 */
export function stringify(object, replacer, space) {
    const internalReplacer = (key, value) => {
        if (ArrayBuffer.isView(value)) {
            value = Array.from(value);
        }
        if (replacer) {
            return replacer(key, value);
        }
        return value;
    };
    return JSON.stringify(object, internalReplacer, space);
}
//# sourceMappingURL=stringify.js.map