( m = Math, d = Date, h = 16, s = (x) => m.floor(x).toString(h) )
| 128 | }; |
| 129 | |
| 130 | export const generateObjectIdString = ( |
| 131 | m = Math, |
| 132 | d = Date, |
| 133 | h = 16, |
| 134 | s = (x) => m.floor(x).toString(h) |
| 135 | ) => { |
| 136 | return ( |
| 137 | s(d.now() / 1000) + ' '.repeat(h).replace(/./g, () => s(m.random() * h)) |
| 138 | ); |
| 139 | }; |
| 140 | |
| 141 | export function getIdFromTheDate(order: Order): string { |
| 142 | if (!order['createdAt'] || !order.orderNumber) { |
no test coverage detected