Skip to content

Commit 43cefb4

Browse files
committed
split helpers
Signed-off-by: Jan Kowalleck <[email protected]>
1 parent 7047935 commit 43cefb4

File tree

5 files changed

+27
-7
lines changed

5 files changed

+27
-7
lines changed

src/helpers/types.ts renamed to src/helpers/notUndefined.ts

-4
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,3 @@ export type NotUndefined<T> = T extends undefined ? never : T
2222
export function isNotUndefined<T> (value: T | undefined): value is NotUndefined<T> {
2323
return value !== undefined
2424
}
25-
26-
export interface Stringable {
27-
toString: () => string
28-
}

src/helpers/stringable.ts

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/*!
2+
This file is part of CycloneDX JavaScript Library.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
16+
SPDX-License-Identifier: Apache-2.0
17+
Copyright (c) OWASP Foundation. All Rights Reserved.
18+
*/
19+
20+
export interface Stringable {
21+
toString: () => string
22+
}

src/serialize/json/normalize.ts

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

20-
import { isNotUndefined, Stringable } from '../../helpers/types'
20+
import { isNotUndefined } from '../../helpers/notUndefined'
21+
import { Stringable } from '../../helpers/stringable'
2122
import * as Models from '../../models'
2223
import { Protocol as Spec, Version as SpecVersion } from '../../spec'
2324
import { NormalizerOptions } from '../types'

src/serialize/xml/normalize.ts

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

20-
import { isNotUndefined, Stringable } from '../../helpers/types'
20+
import { isNotUndefined } from '../../helpers/notUndefined'
21+
import { Stringable } from '../../helpers/stringable'
2122
import * as Models from '../../models'
2223
import { Protocol as Spec, Version as SpecVersion } from '../../spec'
2324
import { NormalizerOptions } from '../types'

src/serialize/xmlSerializer.web.ts

+1-1
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-
import { isNotUndefined } from '../helpers/types'
20+
import { isNotUndefined } from '../helpers/notUndefined'
2121
import { SerializerOptions } from './types'
2222
import { XmlBaseSerializer } from './xmlBaseSerializer'
2323
import { SimpleXml } from './xml/types'

0 commit comments

Comments
 (0)