Skip to content

Commit b278f33

Browse files
committed
wip
Signed-off-by: Jan Kowalleck <[email protected]>
1 parent 566f49f commit b278f33

File tree

4 files changed

+7
-8
lines changed

4 files changed

+7
-8
lines changed

src/_helpers/iterable.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ SPDX-License-Identifier: Apache-2.0
1717
Copyright (c) OWASP Foundation. All Rights Reserved.
1818
*/
1919

20-
export function * chainI<T = any> (...iterables: Array<Iterable<T>>): Generator<T> {
20+
export function * chainI<T> (...iterables: Array<Iterable<T>>): Generator<T> {
2121
for (const iterable of iterables) {
2222
for (const item of iterable) {
2323
yield item

src/models/tool.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ Copyright (c) OWASP Foundation. All Rights Reserved.
1919

2020
import type { Comparable } from '../_helpers/sortable'
2121
import { SortableComparables } from '../_helpers/sortable'
22+
import {type Component, ComponentRepository} from "./component";
2223
import { ExternalReferenceRepository } from './externalReference'
2324
import { HashDictionary } from './hash'
24-
import {type Component, ComponentRepository} from "./component";
2525

2626
export interface OptionalToolProperties {
2727
vendor?: Tool['vendor']

src/serialize/json/normalize.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,24 +17,23 @@ SPDX-License-Identifier: Apache-2.0
1717
Copyright (c) OWASP Foundation. All Rights Reserved.
1818
*/
1919

20+
import { chainI } from "../../_helpers/iterable";
2021
import { isNotUndefined } from '../../_helpers/notUndefined'
2122
import type { SortableIterable } from '../../_helpers/sortable'
2223
import type { Stringable } from '../../_helpers/stringable'
2324
import { treeIteratorSymbol } from '../../_helpers/tree'
2425
import { escapeUri } from '../../_helpers/uri'
2526
import type * as Models from '../../models'
26-
import { ToolRepository } from '../../models/tool'
2727
import { LicenseExpression, NamedLicense, SpdxLicense } from '../../models/license'
2828
import { NamedLifecycle } from '../../models/lifecycle'
29+
import { Tool, ToolRepository } from '../../models/tool'
2930
import { AffectedSingleVersion, AffectedVersionRange } from '../../models/vulnerability/affect'
3031
import { isSupportedSpdxId } from '../../spdx'
3132
import type { _SpecProtocol as Spec } from '../../spec/_protocol'
3233
import { Version as SpecVersion } from '../../spec/enums'
3334
import type { NormalizerOptions } from '../types'
3435
import type { Normalized } from './types'
3536
import { JsonSchema } from './types'
36-
import { chainI} from "../../_helpers/iterable";
37-
import {Tool} from "../../models";
3837

3938
export class Factory {
4039
readonly #spec: Spec

src/serialize/xml/normalize.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,14 @@ SPDX-License-Identifier: Apache-2.0
1717
Copyright (c) OWASP Foundation. All Rights Reserved.
1818
*/
1919

20+
import { chainI } from "../../_helpers/iterable";
2021
import { isNotUndefined } from '../../_helpers/notUndefined'
2122
import type { SortableIterable } from '../../_helpers/sortable'
2223
import type { Stringable } from '../../_helpers/stringable'
2324
import { treeIteratorSymbol } from '../../_helpers/tree'
2425
import { escapeUri } from '../../_helpers/uri'
2526
import type * as Models from '../../models'
27+
import { Tool, ToolRepository } from "../../models";
2628
import { LicenseExpression, NamedLicense, SpdxLicense } from '../../models/license'
2729
import { NamedLifecycle } from '../../models/lifecycle'
2830
import { AffectedSingleVersion, AffectedVersionRange } from '../../models/vulnerability/affect'
@@ -33,8 +35,6 @@ import type { NormalizerOptions } from '../types'
3335
import { normalizedString, token} from './_xsd'
3436
import type { SimpleXml } from './types'
3537
import { XmlSchema } from './types'
36-
import {Tool, ToolRepository} from "../../models";
37-
import {chainI} from "../../_helpers/iterable";
3838

3939
export class Factory {
4040
readonly #spec: Spec
@@ -378,7 +378,7 @@ export class ToolsNormalizer extends BaseXmlNormalizer<Models.Tools> {
378378
let children: SimpleXml.Element[]
379379
if (data.tools.size > 0 || !this._factory.spec.supportsToolsComponentsServices) {
380380
children = this._factory.makeForTool().normalizeIterable(
381-
new ToolRepository(chainI<Models.Tool>(
381+
new ToolRepository(chainI(
382382
Array.from(data.components, Tool.fromComponent),
383383
// TODO services
384384
data.tools,

0 commit comments

Comments
 (0)