@0xtorch/csv 0.0.59 → 0.0.61
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/_cjs/parseRowsToActions/parse.js +1 -1
- package/_cjs/parseRowsToActions/parse.js.map +1 -1
- package/_cjs/schemas/formatterTypes.js +6 -5
- package/_cjs/schemas/formatterTypes.js.map +1 -1
- package/_cjs/schemas/parser.js +1 -0
- package/_cjs/schemas/parser.js.map +1 -1
- package/_esm/parseRowsToActions/parse.js +1 -1
- package/_esm/parseRowsToActions/parse.js.map +1 -1
- package/_esm/schemas/formatterTypes.js +6 -5
- package/_esm/schemas/formatterTypes.js.map +1 -1
- package/_esm/schemas/parser.js +2 -1
- package/_esm/schemas/parser.js.map +1 -1
- package/_types/schemas/format.d.ts +9 -0
- package/_types/schemas/format.d.ts.map +1 -1
- package/_types/schemas/formatterTypes.d.ts.map +1 -1
- package/_types/schemas/parser.d.ts +12 -0
- package/_types/schemas/parser.d.ts.map +1 -1
- package/package.json +2 -2
- package/parseRowsToActions/parse.ts +1 -1
- package/schemas/formatterTypes.ts +8 -5
- package/schemas/parser.ts +2 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@0xtorch/csv",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.61",
|
|
4
4
|
"description": "Cryptorch CSV extension",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cryptorch",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
],
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@0xtorch/big-decimal": "^0.0.13",
|
|
38
|
-
"@0xtorch/core": "^0.0.
|
|
38
|
+
"@0xtorch/core": "^0.0.61",
|
|
39
39
|
"encoding-japanese": "^2.1.0",
|
|
40
40
|
"papaparse": "^5.4.1",
|
|
41
41
|
"xlsx": "^0.18.5",
|
|
@@ -52,23 +52,26 @@ export const iso8601JpTextSchema = z
|
|
|
52
52
|
export const datetimeJpTextSchema = z
|
|
53
53
|
.string()
|
|
54
54
|
.regex(
|
|
55
|
-
/^\d{1,4}\/\d{1,2}\/\d{1,4}( \d{1,2}:\d{1,2}(:\d{1,2})?(\.\d{1,3})?)?$/,
|
|
55
|
+
/^\d{1,4}\/\d{1,2}\/\d{1,4}( \d{1,2}:\d{1,2}(:\d{1,2})?(\.\d{1,3})?)?( JST)?$/,
|
|
56
56
|
)
|
|
57
57
|
.transform((v) => {
|
|
58
|
-
const [datePart,
|
|
58
|
+
const [datePart, ...otherParts] = v.split(' ')
|
|
59
|
+
const otherPart = otherParts.join(' ')
|
|
59
60
|
|
|
60
61
|
// Only date
|
|
61
|
-
if (
|
|
62
|
+
if (otherPart === '') {
|
|
62
63
|
return new Date(`${datePart} 00:00+09:00`).getTime()
|
|
63
64
|
}
|
|
64
65
|
|
|
65
66
|
const [a, b, c] = datePart.split('/')
|
|
66
67
|
// Rakuten wallet date format
|
|
67
68
|
if (a.length === 2 && c.length === 2 && Number(a) > 12) {
|
|
68
|
-
return new Date(
|
|
69
|
+
return new Date(
|
|
70
|
+
`20${a}/${b}/${c} ${otherPart.replace(' JST', '')}+09:00`,
|
|
71
|
+
).getTime()
|
|
69
72
|
}
|
|
70
73
|
|
|
71
|
-
return new Date(`${v}+09:00`).getTime()
|
|
74
|
+
return new Date(`${v.replace(' JST', '')}+09:00`).getTime()
|
|
72
75
|
})
|
|
73
76
|
|
|
74
77
|
export const formatterValueSchema = z.union([
|
package/schemas/parser.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
actionCrossTypeUnionSchema,
|
|
3
|
+
actionEvidenceUnionSchema,
|
|
3
4
|
actionTypeUnionSchema,
|
|
4
5
|
} from '@0xtorch/core'
|
|
5
6
|
import { z } from 'zod'
|
|
@@ -193,6 +194,7 @@ export const transferComponentSchema = z.object({
|
|
|
193
194
|
const generatorSchema = z.object({
|
|
194
195
|
type: actionTypeUnionSchema,
|
|
195
196
|
source: allValueSchema,
|
|
197
|
+
evidence: actionEvidenceUnionSchema.optional(),
|
|
196
198
|
timestamp: cellValueSchema,
|
|
197
199
|
comment: allValueSchema.optional(),
|
|
198
200
|
app: allValueSchema.optional(),
|