import { ICommonFileExtensionsSettings } from './commonFileExtensions.js'; /** * @name commonVideoFileExtensions * @namespace shared.extension * @type Function * @platform node * @platform js * @status stable * * This function allows you to get an array of common text file extensions with or without the dot * * @param {Boolean} withDot If true, the dot will be added to the extension * @return {Array} The array of extensions * * @snippet __commonVideoFileExtensions() * * @example js * import { __commonVideoFileExtensions } from '@lotsof/sugar/extension'; * const extensions = __commonVideoFileExtensions(); * * @since 1.0.0 * @author Olivier Bossel (https://lotsof.dev) */ export default function __commonVideoFileExtensions( settings: Partial = {}, ): string[] { const finalSettings: ICommonFileExtensionsSettings = { dot: false, exclude: [], ...settings, }; return [ '3g2', '3gp', 'avi', 'flv', 'h264', 'm4v', 'mkv', 'mov', 'mp4', 'mpg', 'mpeg', 'rm', 'swf', 'vob', 'wmv', ] .filter((ext) => !finalSettings.exclude.includes(ext)) .map((ext) => (finalSettings.dot ? `.${ext}` : ext)); }