function apply_preset(options) {

    const preset = /** @type string */is_string(options) ? options : options.preset;

    if (preset) {
        options = /** @type IndexOptions */Object.assign({}, presets[preset], /** @type {Object} */options);
    }

    return (/** @type IndexOptions */options
    );
}
@param {IndexOptions|string} options
@return {IndexOptions}