async function importGlob() {
    for (let name of candidates) {
        try {
            let globModule = await import(name);

            if (typeof globModule.default !== 'function') {
                throw new TypeError(`Expected ${name} to be a function`);
            }

            /**
             * Wrap the function to ensure
             * a common pattern.
             */
            switch (name) {
                case 'tiny-glob':
                    /** [1][5] */
                    return createArrayableGlob(
                        /** [6] */
                        createPresetGlob(globModule.default, {
                            filesOnly: true
                        })
                    );

                case 'globby':
                    /** [2][5] - If `patterns` is a string, wraps into an array. */
                    return (patterns, options) => globModule.default([].concat(patterns), options);

                case 'glob':
                    /** [1][5] */
                    return createArrayableGlob(
                        /** [4] */
                        promisify(globModule.default)
                    );

                default:
                    return globModule.default;
            }
        } catch (err) {
            // swallow this error; skip to the next candidate.
        }
    }

    throw new TypeError(
        `No glob library was found, expected one of: ${candidates.join(', ')}`
    );
}
Imports the first available glob function.

@throws {TypeError} If no glob library was found.

@returns {GlobFn}