fix: test if type is undefined in js InitTimeline