
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
@qrvey/formula-lang
Advanced tools
import { ENGINES, Transpile } from "@qrvey/formula-lang";
const program = "MID(MID(\"This is a test\", 1, 5), 1, 2)"
const transpiled = Transpile(program, ENGINES.ELASTICSEARCH)
console.log(transpiled)
the output will be
'This is a test'.substring(1, 5).substring(1, 2)
import { ENGINES, TranspileAST } from "@qrvey/formula-lang";
const ast = {
"type": "Program",
"exp": "1 + 2",
"lang": "QrveyLang",
"version": "0.0.0",
"body": {
"operator": "+",
"type": "BinaryExpression",
"left": {
"type": "Literal",
"dataType": "number",
"value": 1
},
"right": {
"type": "Literal",
"dataType": "number",
"value": 2
}
}
}
const transpiled = TranspileAST(ast, ENGINES.ELASTICSEARCH)
console.log(transpiled)
the output will be
(1 + 2)
import { EditorState } from "@codemirror/state";
import { basicSetup } from "codemirror";
import { FormulaHighlight, calculateAST } from "@qrvey/formula-lang"
// set the editor state with the QFormula plugin. This adds the support for
this._state = EditorState.create({
doc: 'Test formula',
extensions: [
basicSetup,
FormulaHighlight(),
...
]
})
// On every edit update you can calculate the AST
private dispatchTextUpdate(state: EditorState) {
const tree = (state as any).tree;
const text = ((state.doc as any).text as Array<string>).join('\n');
const ast = calculateAST(text, tree.topNode);
// dispatch event after return
return { text, ast }
}
The context is a object where implementor can build the information required for the transpiler. For example, the columns that will be used in the formula.
The properties needed are:
false
__tests__/__mocks__/context.ts
> testContext
{ offset: 'String' }
Set the timezone offset in String format.Use this Interfaces and Constants to build a Context
import { FormulaContext, AST_PRIMITIVES } from '"@qrvey/formula-lang"';
In some scenarios will be necessary to clean the Context, for example: Delete columns that will cause Circular Dependencies. This package have a utility call: cleanInvalidItemsInContext
for that
import { cleanInvalidItemsInContext } from "@qrvey/formula-lang";
const cleanContext = cleanInvalidItemsInContext(dirtyContext);
FAQs
QFormula support for qrvey projects
We found that @qrvey/formula-lang demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 14 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.