fix(editor): Improve error messages around pinned data (#9632)
This commit is contained in:
committed by
GitHub
parent
37531cdb7d
commit
a8bb53f4e3
@@ -63,6 +63,11 @@ export function stringSizeInBytes(input: string | IDataObject | IDataObject[] |
|
||||
return new Blob([typeof input === 'string' ? input : JSON.stringify(input)]).size;
|
||||
}
|
||||
|
||||
export function toMegaBytes(bytes: number, decimalPlaces: number = 2): number {
|
||||
const megabytes = bytes / 1024 / 1024;
|
||||
return parseFloat(megabytes.toFixed(decimalPlaces));
|
||||
}
|
||||
|
||||
export function shorten(s: string, limit: number, keep: number) {
|
||||
if (s.length <= limit) {
|
||||
return s;
|
||||
|
||||
Reference in New Issue
Block a user