UNPKG

@cyclonedx/cyclonedx-esbuild

Version:

Creates CycloneDX Software Bill of Materials (SBoM) from esbuild projects

42 lines (37 loc) 1.95 kB
/*! This file is part of CycloneDX generator for esbuild. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. SPDX-License-Identifier: Apache-2.0 Copyright (c) OWASP Foundation. All Rights Reserved. */ import * as CDX from "@cyclonedx/cyclonedx-library"; import normalizePackageData from 'normalize-package-data'; export declare function loadJsonFile(path: string): any; export declare function writeAllSync(fd: number, data: string): Promise<number>; export declare function isString(v: any): v is string; export declare function normalizePackageManifest(data: any, warn?: normalizePackageData.WarnFn): asserts data is normalizePackageData.Package; export declare function isNonNullable<T>(value: T): value is NonNullable<T>; export interface ValidPackageJSON { name: string; version: string; } export interface PackageDescription<PJ = any> { path: string; packageJson: NonNullable<PJ>; } export declare function makeToolCs(selfCTyp: CDX.Enums.ComponentType, builder: CDX.Builders.FromNodePackageJson.ComponentBuilder, logger: Console): Generator<CDX.Models.Component>; export declare class ValidationError extends Error { readonly details: any; constructor(message: string, details: any); } export declare const PACKAGE_MANIFEST_FILENAME = "package.json"; export declare function getPackageDescription(ppath: string): PackageDescription<ValidPackageJSON> | undefined; export declare function isValidPackageJSON(pkg: any): pkg is ValidPackageJSON;