onecore 0.6.1 → 0.6.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "onecore",
3
- "version": "0.6.1",
3
+ "version": "0.6.2",
4
4
  "description": "onecore",
5
5
  "main": "./lib/index.js",
6
6
  "types": "./src/index.ts",
package/src/formatter.ts CHANGED
@@ -24,8 +24,8 @@ export interface LocaleStringFormatter<T> {
24
24
  format(obj: T, locale: Locale): string;
25
25
  }
26
26
 
27
- export interface Formatter<T> {
28
- format(obj: T): T;
27
+ export interface Formatter<T, S> {
28
+ format(obj: T): S;
29
29
  }
30
30
  export interface LocaleFormatter<T> {
31
31
  format(obj: T, locale: Locale): T;
package/src/io.ts CHANGED
@@ -7,10 +7,15 @@ export interface Transformer<T, S> {
7
7
  transform: (data: S) => Promise<T>
8
8
  }
9
9
 
10
- export interface ICSVFieldParser<T> {
10
+ export interface CSVFieldParser<T> {
11
11
  name: string
12
12
  toString(data: T, key: string, v: string): void
13
13
  }
14
+ export interface FixedLengthFieldParser<T> {
15
+ name: string
16
+ length: number
17
+ parse(data: T, key: string, v: string): void
18
+ }
14
19
 
15
20
  export interface Writer<T> {
16
21
  write: (obj: T) => Promise<number>