From 0916d2420a7b528784444fd373da8e224ce0e016 Mon Sep 17 00:00:00 2001 From: Denis Pushkarev Date: Sun, 19 Sep 2021 23:23:44 +0700 Subject: [PATCH] some stylistic changes --- scripts/check-compat-data-modules-by-versions.mjs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/check-compat-data-modules-by-versions.mjs b/scripts/check-compat-data-modules-by-versions.mjs index 95884fc325d1..be5ca4dcf8ed 100644 --- a/scripts/check-compat-data-modules-by-versions.mjs +++ b/scripts/check-compat-data-modules-by-versions.mjs @@ -1,15 +1,15 @@ import semver from 'semver'; -const { version } = require('../package'); -const modulesByVersions = require('../packages/core-js-compat/modules-by-versions'); +const { version } = await fs.readJson('package.json'); const { major, minor, patch } = semver.coerce(version); let ok = true; if (minor || patch) { // ignore for pre-releases const zero = `${ major }.0`; - const result = await fetch(`https://unpkg.com/core-js-compat@${ major }/modules-by-versions.json`); - const prev = await result.json(); - const set = new Set(prev[zero]); + const modulesByVersions = await fs.readJson('packages/core-js-compat/modules-by-versions.json'); + const response = await fetch(`https://unpkg.com/core-js-compat@${ major }/modules-by-versions.json`); + const zeroVersionData = await response.json(); + const set = new Set(zeroVersionData[zero]); for (const mod of modulesByVersions[zero]) { if (!set.has(mod)) { ok = false;