Skip to content

Commit

Permalink
feat
Browse files Browse the repository at this point in the history
Signed-off-by: Jan Kowalleck <[email protected]>
  • Loading branch information
jkowalleck committed Oct 30, 2024
1 parent a9e5615 commit d80368c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/builders/fromPath.node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Copyright (c) OWASP Foundation. All Rights Reserved.
*/

import {readdirSync} from "fs";
import {join, relative, resolve} from "path";
import {join, relative} from "path";

import type * as Factories from "../factories/index.node";
import {NamedLicense} from "../models/license";
Expand All @@ -49,6 +49,9 @@ export class LicenseEvidenceBuilder {
* Returns undefined if it appears to bes no known text file.
* Throws error, if license attachment content could not be fetched.
*
* If `relativeFrom` is given, the file is displayed relative from there,
* else the full file name is displayed.
*
* @param file - path to file
* @param relativeFrom - relative path reference for file display
*/
Expand Down Expand Up @@ -77,6 +80,10 @@ export class LicenseEvidenceBuilder {
*
* @param dir - path to inspect
* @param relativeFrom - relative path reference for file display
*
* @remarks
*
* Utilizes {@link fromFile}.
*/
public * fromDir(dir: string, relativeFrom: string | undefined = undefined): Generator<NamedLicense> {
// may throw if `readdirSync()` fails
Expand Down

0 comments on commit d80368c

Please sign in to comment.