@171h/utils
Advanced tools
Comparing version 0.4.6 to 0.4.7
@@ -377,2 +377,45 @@ /** | ||
export { BusinessHours, BusinessHoursMap, Calendar, CalendarConfig, DD, DateTimeString, DayUnit, DurationUnit, HolidayDetail, Hour, HourUnit, MM, Minute, MinuteMaps, MinuteUnit, MonthUnit, Readonly, Second, SecondUnit, Time, WeekDay, WeekMinute, WeekUnit, Writable, YYYY, YearUnit, addBusinessMinutes, assert, basetime, businessHoursMap, businessMinuteMap, businessTimeToDate, calendar24Hours, calendarNight, calendarStd, calendarWeek5, dayUnits, daysBetween, daysNameMaps, daysNames, diffBusinessMinutes, getBusinessTime, getDateFromMatch, getTypeName, holidays, hourUnits, isArray, isArrayOfObject, isBoolean, isBrowser, isDate, isDayUnit, isDef, isFunction, isHourUnit, isMinuteUnit, isMonthUnit, isNull, isNumber, isObject, isRegExp, isSecondUnit, isString, isUndefined, isUrlHttp, isValid, isWeekUnit, isWindow, isYearUnit, maxDate, minDate, minuteUnits, monthUnits, noop, numToTime, numToWeekMinute, secondUnits, sumBusinessMinutes, timeToNum, toString, units, weekMinuteToNum, weekUnits, yearUnits }; | ||
interface List { | ||
[key: string]: any; | ||
} | ||
interface Tree { | ||
children?: Tree[]; | ||
[key: string]: any; | ||
} | ||
interface Options { | ||
idField?: string; | ||
parentIdField?: string; | ||
childrenField?: string; | ||
} | ||
/** | ||
* 将 list 转换为 tree | ||
* @param list // 原始 list | ||
* @param parentId // 起始 id | ||
* @param options // 配置 field 项 | ||
* @returns | ||
*/ | ||
declare function buildTree(list: List[], parentId?: number, options?: Options): Tree[]; | ||
interface OptionsParent { | ||
idField?: string; | ||
parentIdField?: string; | ||
levelField?: string; | ||
} | ||
/** | ||
* 将 list 转换为 parentList | ||
* @param list // 原始 list | ||
* @param options // 配置 field 项 | ||
* @returns | ||
*/ | ||
declare function _buildParentList(list: List[], options?: OptionsParent): { | ||
[x: string]: any; | ||
}[]; | ||
/** | ||
* 将 level 格式的 list 转换为 tree | ||
* @param list // 原始 list | ||
* @param parentId // 起始 id | ||
* @param options // 配置 field 项 | ||
* @returns | ||
*/ | ||
declare function buildTreeFromLevelList(list: List[], parentId?: number, options?: Partial<Options & OptionsParent>): Tree[]; | ||
export { BusinessHours, BusinessHoursMap, Calendar, CalendarConfig, DD, DateTimeString, DayUnit, DurationUnit, HolidayDetail, Hour, HourUnit, MM, Minute, MinuteMaps, MinuteUnit, MonthUnit, Readonly, Second, SecondUnit, Time, WeekDay, WeekMinute, WeekUnit, Writable, YYYY, YearUnit, _buildParentList, addBusinessMinutes, assert, basetime, buildTree, buildTreeFromLevelList, businessHoursMap, businessMinuteMap, businessTimeToDate, calendar24Hours, calendarNight, calendarStd, calendarWeek5, dayUnits, daysBetween, daysNameMaps, daysNames, diffBusinessMinutes, getBusinessTime, getDateFromMatch, getTypeName, holidays, hourUnits, isArray, isArrayOfObject, isBoolean, isBrowser, isDate, isDayUnit, isDef, isFunction, isHourUnit, isMinuteUnit, isMonthUnit, isNull, isNumber, isObject, isRegExp, isSecondUnit, isString, isUndefined, isUrlHttp, isValid, isWeekUnit, isWindow, isYearUnit, maxDate, minDate, minuteUnits, monthUnits, noop, numToTime, numToWeekMinute, secondUnits, sumBusinessMinutes, timeToNum, toString, units, weekMinuteToNum, weekUnits, yearUnits }; |
{ | ||
"name": "@171h/utils", | ||
"type": "module", | ||
"version": "0.4.6", | ||
"version": "0.4.7", | ||
"packageManager": "pnpm@8.1.1", | ||
@@ -6,0 +6,0 @@ "description": "", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
38853
489