const token = document.querySelector('meta[name="csrf_token"]').content;

// @see DIR-9810
export default function withCsrfToken(path) {
    if (typeof path !== 'string') {
        return path;
    }

    return `${path}${path.includes('?') ? '&' : '?'}_csrf=${token}`;
}
