import type { PickerDateModel } from '../components/WheelPicker/index.types' ; param { string } prefix export function prefixClassName ( prefix ) { /**
     * Classname with returns itself with a prefix value
     */ return ( className ) => `${ prefix }-${ className }` ; } private example export function generateAnArrayOfNumbers ( length ) { return new Array ( length ) . fill ( 1 ) . map ( ( _ , index ) => index + 1 ) ; } private example export function generateArrayInRangeOfNumbers ( start , end ) { const inRangeArray = [ ] ; for ( let i = start ; i >= start && i <= end ; i ++ ) { inRangeArray . push ( i ) ; } return inRangeArray ; } private example export function convertSelectedDateToObject ( selectedDate ) { const result = { } as PickerDateModel ; selectedDate . forEach ( ( v ) => { const [ type , value ] = v . split ( '-' ) ; result [ type ] = Number ( value ) ; } ) ; return result ; } private example export function convertSelectedDateObjectToArray ( selectedDate ) { const columnsSortOrder = { year : 1 , month : 2 , day : 3 , hour : 4 , minute : 5 , second : 6 , } ; const result = Object . keys ( selectedDate ) . map ( ( type ) => ( { type , value : selectedDate [ type ] , } ) ) ; const sortedColumnsOrder = result . sort ( ( columnA , columnB ) => columnsSortOrder [ columnA . type ] > columnsSortOrder [ columnB . type ] ? 1 : 0 ) ; return sortedColumnsOrder . map ( ( v ) => `${ v . type }-${ v . value }` ) ; } param obj export function isObjectEmpty ( obj ) { return obj ?. constructor === Object && Object . keys ( obj ) . length === 0 ; } private example export function toPositive ( n ) { return n < 0 ? n * - 1 : n ; }