Skip to content

Commit bb77026

Browse files
Merge pull request #331 from technote-space/release/next-v4.2.5
release: v4.2.6
2 parents 20f547a + 29e62cc commit bb77026

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

__tests__/utils1.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@ describe('normalizeVersion', () => {
219219
expect(normalizeVersion('', {fallback: ''})).toBe('');
220220
expect(normalizeVersion('', {fallback: null})).toBe(null);
221221
expect(normalizeVersion('', {fallback: 'abc'})).toBe('abc');
222+
expect(normalizeVersion('', {fallback: 123})).toBe(123);
222223
});
223224
});
224225

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@technote-space/github-action-helper",
3-
"version": "4.2.5",
3+
"version": "4.2.6",
44
"description": "Helper for GitHub Action.",
55
"keywords": [
66
"github",

src/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export const parseVersion = (version: string, options?: { fill?: boolean; cut?:
6363
};
6464
};
6565

66-
export const normalizeVersion = (version: string, options?: { fill?: boolean; cut?: boolean; slice?: number; length?: number; onlyCore?: boolean; fallback?: string | null }): string | undefined | null => {
66+
export const normalizeVersion = <T>(version: string, options?: { fill?: boolean; cut?: boolean; slice?: number; length?: number; onlyCore?: boolean; fallback?: T; }): string | T | undefined => {
6767
const parsed = parseVersion(version, options);
6868
if (!parsed) {
6969
return options?.fallback;

0 commit comments

Comments
 (0)