magic-structure 1.0.4 → 1.0.6

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.
@@ -0,0 +1,19 @@
1
+ export interface Mapper<Record extends object = any> {
2
+ from?: (field: any, record: Record) => any;
3
+ to?: (field: any, record: Record) => any;
4
+ }
5
+ export interface SkipMapper {
6
+ <Record>(field: any, record: Record): boolean;
7
+ }
8
+ export interface FieldOptions<Record extends object = any> {
9
+ skip?: boolean | SkipMapper;
10
+ value?: any;
11
+ mapper?: Mapper<Record>;
12
+ fieldName?: string;
13
+ isArray?: boolean;
14
+ reconstruct?: boolean;
15
+ schema?: new () => object;
16
+ }
17
+ export interface MetaInfo {
18
+ [p: string]: FieldOptions;
19
+ }
File without changes
package/index.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  export { field, fieldName, schema, mapper, value, skip, skipIf } from './lib/decorators'
2
- export { fromJson, toJson } from './lib/mappers'
2
+ export { fromJson, toJson } from './lib/mappers'
package/package.json CHANGED
@@ -1,19 +1,20 @@
1
1
  {
2
2
  "name": "magic-structure",
3
- "version": "1.0.4",
3
+ "version": "1.0.6",
4
4
  "author": "Vlad Kramarukha",
5
5
  "description": "TS lib for mapping data",
6
6
  "keywords": ["TS", "mapper", "structure", "json", "magic"],
7
7
  "private": false,
8
8
  "module": "dist/index.js",
9
9
  "type": "module",
10
- "main": "index.ts",
11
- "types": "dist/index.d.ts",
10
+ "main": "dist/index.js",
11
+ "types": "dist/lib/types.d.ts",
12
12
  "files": ["README.md", "LICENSE", "lib/*", "dist/*", "index.ts"],
13
13
  "license": "Apache-2.0",
14
14
  "exports": {
15
15
  ".": {
16
- "default": "./dist/index.js"
16
+ "default": "./dist/index.js",
17
+ "types": "./dist/lib/types.d.ts"
17
18
  }
18
19
  },
19
20
  "devDependencies": {
File without changes