fix: LFS API expects object size to be a number
This commit is contained in:
parent
1113d58651
commit
d14ac3b7f3
1 changed files with 3 additions and 3 deletions
|
@ -3,7 +3,7 @@ import path from 'path';
|
||||||
|
|
||||||
interface PointerInfo {
|
interface PointerInfo {
|
||||||
oid: string;
|
oid: string;
|
||||||
size: string;
|
size: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface Pointer {
|
export interface Pointer {
|
||||||
|
@ -14,7 +14,7 @@ export interface Pointer {
|
||||||
}
|
}
|
||||||
|
|
||||||
function isValidPointerInfo(val: Record<string, any>): val is PointerInfo {
|
function isValidPointerInfo(val: Record<string, any>): val is PointerInfo {
|
||||||
return val.oid.trim !== undefined && val.size.trim !== undefined;
|
return val.oid.trim !== undefined && typeof val.size === 'number';
|
||||||
}
|
}
|
||||||
|
|
||||||
interface PointerRequest {
|
interface PointerRequest {
|
||||||
|
@ -30,7 +30,7 @@ export function readPointer({ dir, gitdir = path.join(dir, '.git'), content }: P
|
||||||
if (k === 'oid') {
|
if (k === 'oid') {
|
||||||
accum[k] = v.split(':', 2)[1];
|
accum[k] = v.split(':', 2)[1];
|
||||||
} else if (k === 'size') {
|
} else if (k === 'size') {
|
||||||
accum[k] = v;
|
accum[k] = parseInt(v, 10);
|
||||||
}
|
}
|
||||||
return accum;
|
return accum;
|
||||||
}, {} as Record<string, any>);
|
}, {} as Record<string, any>);
|
||||||
|
|
Loading…
Reference in a new issue