Skip to content

Latest commit

 

History

History
42 lines (37 loc) · 721 Bytes

README.md

File metadata and controls

42 lines (37 loc) · 721 Bytes

hasha

Install

$ npm install @wrule/prober

Usage

Code

const path = require('path');
const { Prober } = require('@wrule/prober');

const obj = {
  a: [{name: 'kim'}, {name: 'jim'}]
};
const dstPath = path.join(__dirname, 'output');

const prober = new Prober();
const type = prober.Update(obj, 'test', dstPath);
console.log(type.TypeDesc);

Output

Console

ITest_08890C26

Generated code

import { IA_ArrayItem_31B51A0F } from './a_ArrayItem_31B51A0F';

export interface ITest_08890C26 {
  'a': IA_ArrayItem_31B51A0F[];
}
export interface IA_ArrayItem_31B51A0F {
  'name': string;
}