How to use the @hint/utils-string.normalizeIncludes function in @hint/utils-string

To help you get started, we’ve selected a few @hint/utils-string examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github webhintio / hint / packages / utils / src / packages / load-resource.ts View on Github external
if (res && isSource) {
            isValid = true;
            resource = res;
            loadedSource = source;

            return true;
        }

        if (res && !isSource) { // Paths to sources might not have packages and versioning doesn't apply
            debug(`${name} found in ${source}`);

            if (source === currentProcessDir) {
                try {
                    const packageConfig = loadPackage(source);

                    if (!normalizeIncludes(packageConfig.name, packageName)) {
                        return false;
                    }
                } catch (e) {
                    return false;
                }
            }

            if (verifyVersion && !isVersionValid(source)) {
                debug(`Resource ${name} isn't compatible with current hint version`);

                isValid = false;

                return false;
            }

            isValid = true;