From 122bb64be2f4fcf927fd264d4b2c9ea622611c58 Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Fri, 14 Apr 2023 09:11:41 -0700 Subject: [PATCH] [Refactor] deprecated `lib/core.js` now uses data from `is-core-module` also --- lib/core.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/core.js b/lib/core.js index 57b048f..671c310 100644 --- a/lib/core.js +++ b/lib/core.js @@ -1,7 +1,9 @@ 'use strict'; var isCoreModule = require('is-core-module'); -var data = require('./core.json'); +var path = require('path'); +var fs = require('fs'); +var data = JSON.parse(String(fs.readFileSync(path.join(path.dirname(require.resolve('is-core-module/package.json')), 'core.json')))); var core = {}; for (var mod in data) { // eslint-disable-line no-restricted-syntax