Use String.padStart(), as SE3 version 3.3 now supports it

This commit is contained in:
Adam Goldsmith 2022-06-05 21:29:08 -04:00
parent 7a3d1d2ec5
commit d3cbf1de9c
1 changed files with 1 additions and 5 deletions

View File

@ -100,10 +100,6 @@ function int_or_null(inp) {
}
}
function leftPad(str, len, fill) {
return fill.repeat(Math.max(len - str.length, 0)) + str;
}
function replaceAll(str, search, replace) {
return str.split(search).join(replace);
}
@ -122,7 +118,7 @@ function build_card(component, pack_code, cycle_prefix, copies) {
}
function common_data() {
const code = cycle_prefix + leftPad(String(component.settings.get('CollectionNumber')), 3, '0');
const code = cycle_prefix + String(component.settings.get('CollectionNumber')).padStart(3, '0');
return {
name: substitute_tags(String(component.getName())),