// npm package
babel-plugin-version
babel plugin replace define Identifier / StringLiteral `__VERSION__` to pkg.version!
versions
5
maintainers
1
license
MIT
first publish
2018-11-15
publisher
atool
tarball
2,485 B
AUTO-PUBLISHED·1 version indexed·latest published 2018-11-26
// publisher campaignby atool
9 caught packages from this accountThis is not an isolated catch. The same publisher has shipped 8 other packages that our pipeline flagged — the shape of a coordinated campaign, not a one-off. Each link below opens that sibling's analysis.
// offending code· @0.2.3· no static-pattern hits
llm: benign · 0.85→ No suspicious destination, no remote-exec shape — 1 known-vendor host(s).
- @0.2.3··AUTO-PUBLISHED·publisher: atoolheuristic 75/100static flags 0llm benign (0.85) via ollamapublisher-multi-name-burst:5osv-flagged:MAL-2026-4129
→ No suspicious destination, no remote-exec shape — 1 known-vendor host(s).
// offending code· no static-pattern hits
--- package.json (entry) --- { "name": "babel-plugin-version", "version": "0.2.3", "description": "babel plugin replace define Identifier / StringLiteral `__VERSION__` to pkg.version!", "main": "src/index.js", "scripts": { "test": "rm -rf lib && babel test -d lib" }, "keywords": [ "babel-plugin", "version" ], "devDependencies": { "babel-cli": "^6.26.0" }, "license": "MIT" } --- index.js (entry) --- 'use strict'; var fs = require('fs'); var version = JSON.parse(fs.readFileSync('package.json', 'utf8')).version; module.exports = function (_ref) { var t = _ref.types; return { visitor: { // __VERSION__ ReferencedIdentifier: function(path, state) { var identifier = state.opts.identifier; var transform = identifier === undefined ? true : identifier; // 默认转换 var define = state.opts.define || '__VERSION__'; // 默认值 if (transform && path.node.name === define) { path.replaceWith(t.valueToNode(version)); } }, // "__VERSION__" StringLiteral: function(path, state) { var stringLiteral = state.opts.stringLiteral; var transform = stringLiteral === undefined ? true : stringLiteral; var define = state.opts.define || '__VERSION__'; if (transform && path.node.value === define) { path.replaceWith(t.valueToNode(version)); } } } }; };
