@ledvance/base 1.0.5 → 1.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,5 @@
1
1
  export declare const loopText: (loop: any) => string;
2
+ export declare const toFixed: (str: any, count: any) => string;
2
3
  export declare function getArray(arr: any, size: any): string[];
3
4
  export declare function getWeek(weekString: any): number[];
4
5
  /**
@@ -15,6 +15,10 @@ export const loopText = (loop) => {
15
15
  return loopStrArray.length == 7 ? I18n.getLang('motion_detection_time_schedule_notifications_field_weekdays_text4') : (loopStrArray.join(' ') || I18n.getLang('motion_detection_time_schedule_notifications_field_weekdays_text2'))
16
16
  }
17
17
 
18
+ export const toFixed = (str, count) => {
19
+ return `${"0".repeat(count)}${str}`.slice(-1 * count);
20
+ };
21
+
18
22
  export function getArray(arr, size) { // size=5,要分割的长度
19
23
  const arrNum = Math.ceil(arr.length / size) // Math.ceil()向上取整的方法,用来计算拆分后数组的长度
20
24
  let index = 0 // 定义初始索引