+1
-1
| { | ||
| "name": "fly-imba", | ||
| "version": "2.0.0", | ||
| "version": "2.0.1", | ||
| "description": "Compile Imba files with Fly.", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
-46
| 'use strict'; | ||
| const format = require('path').format; | ||
| const imba = require('imba/compiler'); | ||
| module.exports = function () { | ||
| this.plugin('imba', {}, function * (file, opts) { | ||
| opts = Object.assign({bare: false, sourceMap: false}, opts); | ||
| // modify options for source mapping | ||
| if (opts.sourceMap) { | ||
| opts.sourcePath = format(file); | ||
| } | ||
| // update file type | ||
| file.base = file.base.replace('.imba', '.js'); | ||
| // compile data | ||
| const out = imba.compile(file.data.toString(), opts); | ||
| // if had sourcemap content | ||
| if (out.sourcemap) { | ||
| let add; | ||
| const map = new Buffer(JSON.stringify(out.sourcemap)); | ||
| // if was `inline` | ||
| if (opts.sourceMapInline) { | ||
| add = `data:application/json;base64,${map.toString('base64')}`; | ||
| } else { | ||
| add = file.base.concat('.map'); | ||
| // add to `fly._.files` | ||
| this._.files.push({ | ||
| base: add, | ||
| dir: file.dir, | ||
| data: map | ||
| }); | ||
| } | ||
| // add sourcemap reference to output | ||
| out.js += `\n//# sourceMappingURL=${add}`; | ||
| } | ||
| // set data | ||
| file.data = new Buffer(out.js); | ||
| }); | ||
| }; |
Empty package
Supply chain riskPackage does not contain any code. It may be removed, is name squatting, or the result of a faulty package publish.
Found 1 instance in 1 package
2969
-26.07%3
-25%0
-100%1
Infinity%