UNPKG
mdsf
Version:
latest (1.1.1)
1.1.1
1.1.0
1.0.2
1.0.1
1.0.0
0.0.0
Metarhia Data Serialization Format
github.com/metarhia/mdsf
metarhia/mdsf
mdsf
/
lib
/
common.js
17 lines
(14 loc)
•
296 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
'use strict'
;
// Try to require `moduleName` and return the exported object if the module is
// found or null otherwise.
//
const
safeRequire
= moduleName => {
try
{
return
[
null
,
require
(moduleName)]; }
catch
(err) {
return
[err,
null
]; } };
module
.
exports
= { safeRequire, };