Skip to content

Commit e645720

Browse files
Strum355claude
andauthored
refactor: consolidate TOML parsers to smol-toml (#507)
Replace fast-toml (TOML 0.5, unmaintained) with smol-toml (TOML 1.0, actively maintained) in the Gradle provider, unifying the codebase on a single TOML library. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 76e1fef commit e645720

3 files changed

Lines changed: 2 additions & 10 deletions

File tree

package-lock.json

Lines changed: 0 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@
5151
"@cyclonedx/cyclonedx-library": "^6.13.0",
5252
"eslint-import-resolver-typescript": "^4.4.4",
5353
"fast-glob": "^3.3.3",
54-
"fast-toml": "^0.5.4",
5554
"fast-xml-parser": "^5.3.4",
5655
"help": "^3.0.2",
5756
"https-proxy-agent": "^7.0.6",

src/providers/java_gradle.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import os from 'node:os'
44
import path from 'node:path'
55
import { EOL } from 'os'
66

7-
import TOML from 'fast-toml'
7+
import { parse as parseToml } from 'smol-toml'
88

99
import { readLicenseFile } from '../license/license_utils.js'
1010
import Sbom from '../sbom.js'
@@ -422,7 +422,7 @@ export default class Java_gradle extends Base_java {
422422
// Read and parse the TOML file
423423
let pathOfToml = path.join(path.dirname(manifestPath),"gradle","libs.versions.toml");
424424
const tomlString = fs.readFileSync(pathOfToml).toString()
425-
let tomlObject = TOML.parse(tomlString)
425+
let tomlObject = parseToml(tomlString)
426426
let groupPlusArtifactObject = tomlObject.libraries[alias]
427427
let parts = groupPlusArtifactObject.module.split(":");
428428
let groupId = parts[0]

0 commit comments

Comments
 (0)