fix: Text utils null value when reading module (#24291)

This commit is contained in:
Michael S. Molina 2023-06-05 13:16:16 -03:00 committed by GitHub
parent cab34c2dbf
commit 6a1f365d9b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 7 deletions

View File

@ -15,17 +15,13 @@
* specific language governing permissions and limitations
* under the License.
*/
/* eslint-disable global-require */
const loadModule = () => {
let module;
try {
// @ts-ignore
module = require('../../../superset_text'); // eslint-disable-line import/no-unresolved
// eslint-disable-next-line global-require
return require('../../../superset_text.yml') || {};
} catch (e) {
module = {};
return {};
}
return module;
};
const supersetText = loadModule();