Latest Threat Research:SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains.Details
Socket
Book a DemoInstallSign in
Socket

fly-imba

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fly-imba - npm Package Compare versions

Comparing version
2.0.0
to
2.0.1
+1
-1
package.json
{
"name": "fly-imba",
"version": "2.0.0",
"version": "2.0.1",
"description": "Compile Imba files with Fly.",

@@ -5,0 +5,0 @@ "license": "MIT",

'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);
});
};