This repository was archived by the owner on Dec 21, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +18
-38
lines changed Expand file tree Collapse file tree 3 files changed +18
-38
lines changed Original file line number Diff line number Diff line change 1- import { getEndpointUrl , FieldDetector } from '../utils'
1+ import { getEndpointUrl } from '../utils'
22import authFetch from '../rest/authFetch'
33
44import StorageNode from './StorageNode'
@@ -136,8 +136,22 @@ export default class Stream {
136136
137137 if ( receivedMsgs . length > 0 ) {
138138 const lastMessage = receivedMsgs [ 0 ]
139- const fd = new FieldDetector ( lastMessage )
140- const fields = fd . detect ( )
139+ const fields = [ ]
140+
141+ Object . keys ( lastMessage ) . forEach ( ( key ) => {
142+ let type
143+ if ( Array . isArray ( lastMessage [ key ] ) ) {
144+ type = 'list'
145+ } else if ( ( typeof lastMessage [ key ] ) === 'object' ) {
146+ type = 'map'
147+ } else {
148+ type = typeof lastMessage [ key ]
149+ }
150+ fields . push ( {
151+ name : key ,
152+ type,
153+ } )
154+ } )
141155
142156 // Save field config back to the stream
143157 this . config . fields = fields
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -11,9 +11,8 @@ import pkg from '../../package.json'
1111
1212import AggregatedError from './AggregatedError'
1313import Scaffold from './Scaffold'
14- import FieldDetector from './FieldDetector'
1514
16- export { AggregatedError , Scaffold , FieldDetector }
15+ export { AggregatedError , Scaffold }
1716
1817const UUID = uuidv4 ( )
1918
You can’t perform that action at this time.
0 commit comments