/** * @file Utilities - extRegex * @module ext-regex/utils/extRegex */ import type { Options } from '../interfaces/index.mjs'; /** * Creates a regular expression matching the given file extension, `ext`. * * If the given file extension does not begin with a dot character (`'.'`), it * will be formatted before being converted to a regular expression pattern. The * resulting regular expression will match the formatted file extension instead. * * Throws `ERR_INVALID_ARG_TYPE` if the given file extension is not a string. * * @see {@linkcode errnode.ERR_INVALID_ARG_TYPE} * * @param {string} ext - File extension to evaluate * @param {Options?} [options] - Regular expression options * @return {RegExp} Regular expression matching `ext` * @throws {errnode.NodeError} If `ext` is not a string */ declare const extRegex: (ext: string, options?: Options) => RegExp; export default extRegex;