Socket
Socket
Sign inDemoInstall

lilconfig

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lilconfig - npm Package Compare versions

Comparing version 3.1.1 to 3.1.2

10

package.json
{
"name": "lilconfig",
"version": "3.1.1",
"version": "3.1.2",
"description": "A zero-dependency alternative to cosmiconfig",

@@ -9,3 +9,3 @@ "main": "src/index.js",

"test": "NODE_OPTIONS=--experimental-vm-modules ./node_modules/.bin/jest --coverage",
"lint": "eslint ./src",
"lint": "biome ci ./src",
"types": "tsc"

@@ -30,10 +30,8 @@ },

"devDependencies": {
"@biomejs/biome": "^1.6.0",
"@types/jest": "^29.5.12",
"@types/node": "^14.18.63",
"@types/webpack-env": "^1.18.5",
"cosmiconfig": "^8.3.6",
"eslint": "^8.56.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.1.3",
"jest": "^29.7.0",
"prettier": "^3.2.5",
"typescript": "^5.3.3",

@@ -40,0 +38,0 @@ "uvu": "^0.5.6"

12

src/index.js

@@ -42,7 +42,9 @@ // @ts-check

const jsonLoader = (_, content) => JSON.parse(content);
// Use plain require in webpack context for dynamic import
const requireFunc = typeof __webpack_require__ === "function" ? __non_webpack_require__ : require;
/** @type {import('./index').LoadersSync} */
const defaultLoadersSync = Object.freeze({
'.js': require,
'.json': require,
'.cjs': require,
'.js': requireFunc,
'.json': requireFunc,
'.cjs': requireFunc,
noExt: jsonLoader,

@@ -55,3 +57,3 @@ });

try {
const mod = await import(id);
const mod = await import(/* webpackIgnore: true */ id);

@@ -61,3 +63,3 @@ return mod.default;

try {
return require(id);
return requireFunc(id);
} catch (/** @type {any} */ requireE) {

@@ -64,0 +66,0 @@ if (

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc