File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed
Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import moment from 'moment'
44export const nowDate = moment ( ) . format ( 'YYYY-MM-DD' )
55
66// 当前时间的前n天
7- export function beforeDay ( n ) {
7+ export function beforeDay ( n : number | string ) {
88 return moment ( ) . subtract ( n , 'days' ) . format ( 'YYYY-MM-DD' )
99}
1010
Original file line number Diff line number Diff line change @@ -66,13 +66,13 @@ export function isAllPropertiesEmpty(obj: object) {
6666}
6767
6868// 数组对象中某一属性值的集合
69- export function getAttrsArray ( array , attr ) {
69+ export function getAttrsArray ( array : Array < any > , attr : string ) {
7070 return array . map ( ( item ) => {
7171 return item [ attr ]
7272 } )
7373}
7474
7575// 求和
76- export function getSum ( array ) {
76+ export function getSum ( array : Array < any > ) {
7777 return array . reduce ( ( totol , item ) => totol + item , 0 )
7878}
You can’t perform that action at this time.
0 commit comments