Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@web/config-loader

Package Overview
Dependencies
Maintainers
6
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@web/config-loader - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

src/index.js

6

CHANGELOG.md
# @web/config-loader
## 0.0.4
### Patch Changes
- 4112c2b: feat(config-loader): add jsdoc type checking
## 0.0.3

@@ -4,0 +10,0 @@

9

package.json
{
"name": "@web/config-loader",
"version": "0.0.3",
"version": "0.0.4",
"publishConfig": {

@@ -16,3 +16,3 @@ "access": "public"

"homepage": "https://github.com/modernweb-dev/web/tree/master/packages/config-loader",
"main": "dist/index.js",
"main": "src/index.js",
"engines": {

@@ -23,3 +23,3 @@ "node": ">=10.0.0"

"build": "tsc",
"test": "mocha test/**/*.test.js --require ts-node/register --reporter progress",
"test": "mocha test/**/*.test.js --reporter progress",
"test:ci": "yarn test",

@@ -43,3 +43,4 @@ "test:watch": "mocha test/**/*.test.js --watch --watch-files .,src,test --reporter progress"

"semver": "^7.3.2"
}
},
"types": "dist/index.d.ts"
}

@@ -11,3 +11,3 @@ const fs = require('fs').promises;

*/
module.exports = async function getPackageType(basedir) {
async function getPackageType(basedir) {
let currentPath = basedir;

@@ -30,2 +30,4 @@ try {

return 'commonjs';
};
}
module.exports = getPackageType;
const semver = require('semver');
const { pathToFileURL} = require('url')
const { pathToFileURL } = require('url');
const ConfigLoaderError = require('./ConfigLoaderError');

@@ -15,3 +15,6 @@

module.exports = async function importConfig(path) {
/**
* @param {string} path
*/
async function importConfig(path) {
if (!supportsEsm) {

@@ -26,3 +29,3 @@ throw new ConfigLoaderError(

try {
const config = await import(pathToFileURL(path));
const config = await import(pathToFileURL(path).href);

@@ -46,2 +49,4 @@ if (typeof config.default !== 'object') {

}
};
}
module.exports = importConfig;

@@ -5,2 +5,5 @@ const getPackageType = require('./getPackageType');

/**
* @param {string} configPath
*/
function importConfig(configPath) {

@@ -13,3 +16,7 @@ // Conditionally requires importConfig function to avoid logging a warning on node v12

module.exports = async function importOrRequireConfig(configPath, basedir) {
/**
* @param {string} configPath
* @param {string} basedir
*/
async function importOrRequireConfig(configPath, basedir) {
const packageType = await getPackageType(basedir);

@@ -26,2 +33,4 @@ const ext = path.extname(configPath);

}
};
}
module.exports = importOrRequireConfig;

@@ -10,3 +10,6 @@ const ConfigLoaderError = require('./ConfigLoaderError');

module.exports = function requireConfig(path) {
/**
* @param {string} path
*/
function requireConfig(path) {
try {

@@ -24,2 +27,4 @@ return require(path);

}
};
}
module.exports = requireConfig;
const fs = require('fs').promises;
/**
* @param {string} path
*/
async function fileExists(path) {

@@ -4,0 +7,0 @@ try {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc