const isString = (str) => typeof str === 'string';
const notEmpty = (str) => str.length > 0;
export const normalizeUrlFactory = ({ markupParser: parser }) => (url) => {
    if (isString(url)) {
        url = url.trim();
        if (notEmpty(url)) {
            url = parser.normalizeLink(url);
            if (parser.validateLink(url)) {
                return {
                    url,
                    text: parser.normalizeLinkText(url),
                };
            }
        }
    }
    return null;
};
//# sourceMappingURL=utils.js.map
