import test from './test' ; import jsArray from './js/js-array' ; import css from './css/css' ; import jsDate from './js/js-date' ; import jsMath from './js/js-math' ; import jsNumber from './js/js-number' ; import jsObject from './js/js-object' ; import jsString from './js/js-string' ; import jsMapSet from './js/js-map-set' ; import jsPromise from './js/js-promise' ; import jsGlobal from './js/js-global' ; import jsWords from './js/js-words' ; import jsWebGL from './js/js-WebGL' ; function splitRow ( data ) { let result = [ ] , row = [ ] , len = 0 ; data . forEach ( ( word , i ) => { row . push ( word ) ; len += ( word . text ?. length + 1 ) ; if ( len >= 90 ) { const item = row . pop ( ) ; result . push ( row ) ; row = [ item ] ; len = item . text . length + 1 ; } } ) ; return result ; } function getLength ( data ) { return data . reduce ( ( prev , curr ) => { return prev + curr . text . length + 1 ; } , 0 ) ; } export const testData = splitRow ( test ) ; export const jsArrayData = splitRow ( jsArray ) ; export const cssData = splitRow ( css ) ; export const jsDateData = splitRow ( jsDate ) ; export const jsMathData = splitRow ( jsMath ) ; export const jsNumberData = splitRow ( jsNumber ) ; export const jsObjectData = splitRow ( jsObject ) ; export const jsStringData = splitRow ( jsString ) ; export const jsMapSetData = splitRow ( jsMapSet ) ; export const jsPromiseData = splitRow ( jsPromise ) ; export const jsGlobalData = splitRow ( jsGlobal ) ; export const jsWordsData = splitRow ( jsWords ) ; export const jsWebGLData = splitRow ( jsWebGL ) ; export const jsAllData = splitRow ( jsArray . concat ( jsDate , jsMath , jsNumber , jsObject , jsString , jsMapSet , jsPromise , jsGlobal , jsWebGLData ) ) ;