/
mustreets
/
CreateTransactions
Обзор
Документация
Войти
/
mustreets
/
CreateTransactions
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
codemods/kat/discovery.transform.cjs
29 строк
1000 B
Slava
Initialize project with essential configurations and structures
14 май 2026, 22:23
14 май 2026, 22:23
a89cd26
Код
Авторство
О чём код?
/** * KAT pipeline — фаза 1 (Discovery): печать Identity Map и отчёта по «тяжёлым» BinaryExpression. * Исходники не меняет. * * npx jscodeshift -t codemods/kat/discovery.transform.cjs libJS/wallet/class.CreateTransaction.ts --parser=tsx */ const { buildIdentityMap, mapToSortedObject, scanHighRiskBinaryExpressions } = require("./identity-map.cjs"); module.exports = function transformer(file, api, options) { const j = api.jscodeshift; const root = j(file.source); const weightMap = buildIdentityMap(root, j); const threshold = Number(options.threshold ?? 1.2); const payload = { file: file.path, identityMap: mapToSortedObject(weightMap), highRiskBinaryExpressions: scanHighRiskBinaryExpressions(root, j, weightMap, threshold), threshold, }; // eslint-disable-next-line no-console -- codemod CLI output console.log(JSON.stringify(payload, null, 2)); return file.source; }; module.exports.parser = "tsx";