Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it(`should make ${name} require\'able`, (done) => {
resolve(name, {basedir: cwd}, (err, res) => {
assert.ifError(err)
assert.notEqual(res.indexOf(cwd), -1)
require(res)
done()
})
})
})
it(`should make ${target} require\'able`, (done) => {
resolve(target, {basedir: cwd}, (err, res) => {
assert.ifError(err)
assert.notEqual(res.indexOf(cwd), -1)
require(res)
done()
})
})
})
new Promise((fulfil, reject) =>
resolveId(file, opts, (err, contents) => (err ? reject(err) : fulfil(contents)))
);
return new Promise((resolve, reject) =>
resolveAsync(name, options, (err, result) => {
if (err) {
reject(err);
} else {
resolve(result);
}
})
);
const resolveIdAsync = (file, opts) => new Promise((fulfil, reject) => resolveId(file, opts, (err, contents) => err ? reject(err) : fulfil(contents)));
return new Promise((resolve, reject) => {
requireResolve(request, options, (err, result) => {
if (err) {
reject(err);
} else {
resolve(result);
}
});
});
}
return new Promise((resolve, reject) => {
resolveBase(packageName, {basedir: baseDirectory}, (err, resolution) => {
if (err) {
reject(err);
} else {
resolve(resolution);
}
});
});
}
return new Promise((resolve, reject) =>
nodeResolveWithCallback(importPath, options, (error, result) => {
if (error) {
reject(error);
} else {
resolve(result);
}
}),
);