@calipsa/camera-reports-to-csv
Advanced tools
Comparing version 2.0.2 to 2.0.3
@@ -62,2 +62,3 @@ "use strict"; | ||
label: 'Reduction', | ||
transform: utils_1.formatNumber, | ||
}, | ||
@@ -64,0 +65,0 @@ { |
@@ -5,3 +5,4 @@ declare type FilterFlags<T, U> = { | ||
export declare const sumBy: <T extends {}>(arr: T[], prop: FilterFlags<T, number>[keyof T]) => number; | ||
export declare const formatNumber: (num: number) => string; | ||
export declare const formatDate: (dateStr: any) => string; | ||
export {}; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.sumBy = (arr, prop) => arr.reduce((acc, item) => item[prop] + acc, 0); | ||
exports.formatNumber = (num) => Number.isNaN(num) | ||
? num.toString() | ||
: ''; | ||
exports.formatDate = (dateStr) => dateStr | ||
@@ -5,0 +8,0 @@ ? new Date(dateStr).toLocaleString() |
{ | ||
"name": "@calipsa/camera-reports-to-csv", | ||
"version": "2.0.2", | ||
"version": "2.0.3", | ||
"description": "Convert camera reports to CSV", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -5,2 +5,3 @@ import arrayToCsv from '@calipsa/array-to-csv' | ||
sumBy, | ||
formatNumber, | ||
formatDate, | ||
@@ -83,2 +84,3 @@ } from './utils' | ||
label: 'Reduction', | ||
transform: formatNumber, | ||
}, | ||
@@ -85,0 +87,0 @@ { |
@@ -12,2 +12,7 @@ type FilterFlags<T, U> = { | ||
export const formatNumber = (num: number) => | ||
Number.isNaN(num) | ||
? num.toString() | ||
: '' | ||
export const formatDate = (dateStr: any) => | ||
@@ -14,0 +19,0 @@ dateStr |
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
10787
303