-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
71 lines (59 loc) · 2.81 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
/**
*
* Package:
* Author: Ganesh B
* Description: JS functions to check if the file is a ES Module or a CJS/ JS Module or Script
* Install: npm i check-esm --save
* Github: https://github.com/ganeshkbhat/isesm
* npmjs Link:
* File: index.js
* File Description:
*
*/
/* eslint no-console: 0 */
'use strict';
const path = require('path');
const fs = require('fs');
const {
_getRoot, _getPackageJsonRoot, _checkModuleImports, _requiresObject,
_requireRegex, _importRegex, _importESRegex, _importRegexExtended,
_isESMFileExtension, _isESMCodeBase, _isCJSCodeBase, _isESCode, _isModuleInPackageJson,
_checkRequireModuleImports, _isCJSFileExtension, _isNodeCompatibleFileExtension,
getRoot, getPackageJsonRoot, checkModuleImports, requiresObject,
requireRegex, importRegex, importESRegex, importRegexExtended,
isESMFileExtension, isESMCodeBase, isCJSCodeBase, isESCode, isModuleInPackageJson,
checkRequireModuleImports, isCJSFileExtension, isNodeCompatibleFileExtension
} = require("get-imported");
module.exports._getRoot = _getRoot;
module.exports._getPackageJsonRoot = _getPackageJsonRoot;
module.exports._checkModuleImports = _checkModuleImports;
module.exports._requiresObject = _requiresObject;
module.exports._requireRegex = _requireRegex;
module.exports._importRegex = _importRegex;
module.exports._importESRegex = _importESRegex;
module.exports._importRegexExtended = _importRegexExtended;
module.exports._isCJSFileExtension = _isCJSFileExtension;
module.exports._isESMFileExtension = _isESMFileExtension;
module.exports._isESMCodeBase = _isESMCodeBase;
module.exports._isCJSCodeBase = _isCJSCodeBase;
module.exports._isESCode = _isESCode;
module.exports._isModuleInPackageJson = _isModuleInPackageJson;
module.exports._checkRequireModuleImports = _checkRequireModuleImports;
module.exports._isNodeCompatibleFileExtension = _isNodeCompatibleFileExtension;
module.exports.getRoot = _getRoot;
module.exports.getPackageJsonRoot = _getPackageJsonRoot;
module.exports.checkModuleImports = _checkModuleImports;
module.exports.requiresObject = _requiresObject;
module.exports.requireRegex = _requireRegex;
module.exports.importRegex = _importRegex;
module.exports.importESRegex = _importESRegex;
module.exports.importRegexExtended = _importRegexExtended;
module.exports.isCJSFileExtension = _isCJSFileExtension;
module.exports.isESMFileExtension = _isESMFileExtension;
module.exports.isESMCodeBase = _isESMCodeBase;
module.exports.isCJSCodeBase = _isCJSCodeBase;
module.exports.isESCode = _isESCode;
module.exports.isModuleInPackageJson = _isModuleInPackageJson;
module.exports.checkRequireModuleImports = _checkRequireModuleImports;
module.exports.isNodeCompatibleFileExtension = _isNodeCompatibleFileExtension;
module.exports.default = _isESCode;