Skip to content

Commit 914373e

Browse files
committed
chore(release): bump to v5.17.0
1 parent 4dd9da6 commit 914373e

4 files changed

Lines changed: 18 additions & 7 deletions

File tree

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,17 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [5.17.0](https://github.com/SocketDev/socket-lib/releases/tag/v5.17.0) - 2026-04-14
9+
10+
### Added — paths
11+
12+
- `isUnixPath()` — detect MSYS/Git Bash drive letter notation (`/c/...`)
13+
14+
### Changed — paths
15+
16+
- `normalizePath()` now converts MSYS drive letters on Windows (`/c/path``C:/path`)
17+
- `fromUnixPath()` now produces native Windows paths with backslashes (`/c/path``C:\path`), making it the true inverse of `toUnixPath()`
18+
819
## [5.16.0](https://github.com/SocketDev/socket-lib/releases/tag/v5.16.0) - 2026-04-14
920

1021
### Added — paths

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@socketsecurity/lib",
3-
"version": "5.16.0",
3+
"version": "5.17.0",
44
"packageManager": "pnpm@11.0.0-rc.0",
55
"license": "MIT",
66
"description": "Core utilities and infrastructure for Socket.dev security tools",

src/paths/normalize.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ export function isRelative(pathLike: string | Buffer | URL): boolean {
380380
* Detection rules:
381381
* - Must start with `/` followed by a single ASCII letter (a-z, A-Z)
382382
* - The letter must be followed by `/` or be at the end of the string
383-
* - Examples: `/c/Users/name`, `/d/projects`, `/c`
383+
* - Examples: `/c/tools/bin`, `/d/projects`, `/c`
384384
* - Non-matches: `/tmp`, `/usr/local`, `C:/Windows`
385385
*
386386
* @param {string | Buffer | URL} pathLike - The path to check
@@ -389,7 +389,7 @@ export function isRelative(pathLike: string | Buffer | URL): boolean {
389389
* @example
390390
* ```typescript
391391
* // MSYS drive letter paths
392-
* isUnixPath('/c/Users/name') // true
392+
* isUnixPath('/c/tools/bin') // true
393393
* isUnixPath('/d/projects/app') // true
394394
* isUnixPath('/c') // true
395395
* isUnixPath('/C/Windows') // true
@@ -492,7 +492,7 @@ export function fromUnixPath(pathLike: string | Buffer | URL): string {
492492
*
493493
* // MSYS drive letters (Windows only)
494494
* normalizePath('/c/projects/app') // 'C:/projects/app' (on Windows)
495-
* normalizePath('/d/Users/name') // 'D:/Users/name' (on Windows)
495+
* normalizePath('/d/tools/bin') // 'D:/tools/bin' (on Windows)
496496
*
497497
* // UNC paths
498498
* normalizePath('\\\\server\\share\\file') // '//server/share/file'

test/unit/paths/normalize.test.mts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ describe('paths/normalize', () => {
9292
'should convert MSYS drive letter paths on Windows',
9393
() => {
9494
expect(normalizePath('/c/projects/app')).toBe('C:/projects/app')
95-
expect(normalizePath('/d/Users/name')).toBe('D:/Users/name')
95+
expect(normalizePath('/d/tools/bin')).toBe('D:/tools/bin')
9696
expect(normalizePath('/z/path')).toBe('Z:/path')
9797
},
9898
)
@@ -106,7 +106,7 @@ describe('paths/normalize', () => {
106106

107107
it.skipIf(isWindows)('should not convert MSYS-like paths on Unix', () => {
108108
expect(normalizePath('/c/projects/app')).toBe('/c/projects/app')
109-
expect(normalizePath('/d/Users/name')).toBe('/d/Users/name')
109+
expect(normalizePath('/d/tools/bin')).toBe('/d/tools/bin')
110110
})
111111

112112
it.skipIf(!isWindows)(
@@ -294,7 +294,7 @@ describe('paths/normalize', () => {
294294

295295
describe('isUnixPath', () => {
296296
it('should detect MSYS drive letter paths', () => {
297-
expect(isUnixPath('/c/Users/name')).toBe(true)
297+
expect(isUnixPath('/c/tools/bin')).toBe(true)
298298
expect(isUnixPath('/d/projects/app')).toBe(true)
299299
expect(isUnixPath('/z/path')).toBe(true)
300300
expect(isUnixPath('/C/Windows')).toBe(true)

0 commit comments

Comments
 (0)