You're Invited:Meet the Socket Team at RSAC and BSidesSF 2026, March 23–26.RSVP
Socket
Book a DemoSign in
Socket

wsl-utils

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

wsl-utils - npm Package Compare versions

Comparing version
0.3.0
to
0.3.1
+19
utilities.js
export function parseMountPointFromConfig(content) {
for (const line of content.split('\n')) {
// Skip comment lines
if (/^\s*#/.test(line)) {
continue;
}
// Match root at start of line (after optional whitespace)
const match = /^\s*root\s*=\s*(?<mountPoint>"[^"]*"|'[^']*'|[^#]*)/.exec(line);
if (!match) {
continue;
}
return match.groups.mountPoint
.trim()
// Strip surrounding quotes
.replaceAll(/^["']|["']$/g, '');
}
}
+4
-3

@@ -6,2 +6,3 @@ import {promisify} from 'node:util';

import {powerShellPath as windowsPowerShellPath, executePowerShell} from 'powershell-utils';
import {parseMountPointFromConfig} from './utilities.js';

@@ -36,9 +37,9 @@ const execFile = promisify(childProcess.execFile);

const configContent = await fs.readFile(configFilePath, {encoding: 'utf8'});
const configMountPoint = /(?<!#.*)root\s*=\s*(?<mountPoint>.*)/g.exec(configContent);
const parsedMountPoint = parseMountPointFromConfig(configContent);
if (!configMountPoint) {
if (parsedMountPoint === undefined) {
return defaultMountPoint;
}
mountPoint = configMountPoint.groups.mountPoint.trim();
mountPoint = parsedMountPoint;
mountPoint = mountPoint.endsWith('/') ? mountPoint : `${mountPoint}/`;

@@ -45,0 +46,0 @@

{
"name": "wsl-utils",
"version": "0.3.0",
"version": "0.3.1",
"description": "Utilities for working with Windows Subsystem for Linux (WSL)",

@@ -27,3 +27,4 @@ "license": "MIT",

"index.js",
"index.d.ts"
"index.d.ts",
"utilities.js"
],

@@ -30,0 +31,0 @@ "keywords": [