main
Last change
on this file since 79a0317 was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 2 weeks ago |
F4 Finalna Verzija
|
-
Property mode
set to
100644
|
File size:
448 bytes
|
Line | |
---|
1 | 'use strict';
|
---|
2 | var globalThis = require('../internals/global-this');
|
---|
3 | var IS_NODE = require('../internals/environment-is-node');
|
---|
4 |
|
---|
5 | module.exports = function (name) {
|
---|
6 | if (IS_NODE) {
|
---|
7 | try {
|
---|
8 | return globalThis.process.getBuiltinModule(name);
|
---|
9 | } catch (error) { /* empty */ }
|
---|
10 | try {
|
---|
11 | // eslint-disable-next-line no-new-func -- safe
|
---|
12 | return Function('return require("' + name + '")')();
|
---|
13 | } catch (error) { /* empty */ }
|
---|
14 | }
|
---|
15 | };
|
---|
Note:
See
TracBrowser
for help on using the repository browser.