Please enable JavaScript to use RhodeCode Enterprise
Commit Description:
move datatable to yarn
Commit Description:
move datatable to yarn
var codegen = require ( 'escodegen' )
var esprima = require ( 'esprima' )
var through = require ( 'through' )
module . exports = astTransform
function astTransform ( transform , opts ) {
opts = opts || {}
return function ( file ) {
var stream = through ( write , flush )
var tr = transform ( file )
var buffer = []
if ( ! tr ) return through ()
return stream
function write ( data ) { buffer . push ( data ) }
function flush () {
buffer = buffer . join ( '' )
try {
var ast = esprima . parse ( buffer , opts )
} catch ( e ) {
return stream . emit ( 'error' , e )
}
tr ( ast , function ( err , updated ) {
if ( err ) return stream . emit ( 'error' , err )
try {
var code = codegen . generate ( updated || ast )
} catch ( e ) {
return stream . emit ( 'error' , e )
}
stream . queue ( code . code || code )
stream . queue ( null )
})
}
}
}
Site-wide shortcuts
/
Use quick search box
g h
Goto home page
g g
Goto my private gists page
g G
Goto my public gists page
n r
New repository page
n g
New gist page
Repositories
g s
Goto summary page
g c
Goto changelog page
g f
Goto files page
g F
Goto files page with file search activated
g p
Goto pull requests page
g o
Goto repository settings
g O
Goto repository permissions settings