Socket
Socket
Sign inDemoInstall

@influxdata/flux-lsp-node

Package Overview
Dependencies
Maintainers
23
Versions
111
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@influxdata/flux-lsp-node - npm Package Compare versions

Comparing version 0.7.2 to 0.7.4

16

flux-lsp-node.d.ts

@@ -9,2 +9,18 @@ /* tslint:disable */

/**
* Parse flux into an AST representation. The AST will be generated regardless
* of valid flux. As such, no error handling is needed.
* @param {string} script
* @returns {any}
*/
export function parse(script: string): any;
/**
* Format a flux script from AST.
*
* In the event that the flux is invalid syntax, an Err will be returned,
* which will translate into a JavaScript exception being thrown.
* @param {any} js_file
* @returns {string}
*/
export function format_from_js_file(js_file: any): string;
/**
* Lsp is the core lsp server interface.

@@ -11,0 +27,0 @@ */

222

flux-lsp-node.js

@@ -6,2 +6,22 @@ let imports = {};

const heap = new Array(32).fill(undefined);
heap.push(undefined, null, true, false);
function getObject(idx) { return heap[idx]; }
let heap_next = heap.length;
function dropObject(idx) {
if (idx < 36) return;
heap[idx] = heap_next;
heap_next = idx;
}
function takeObject(idx) {
const ret = getObject(idx);
dropObject(idx);
return ret;
}
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });

@@ -23,8 +43,2 @@

const heap = new Array(32).fill(undefined);
heap.push(undefined, null, true, false);
let heap_next = heap.length;
function addHeapObject(obj) {

@@ -39,16 +53,65 @@ if (heap_next === heap.length) heap.push(heap.length + 1);

function getObject(idx) { return heap[idx]; }
let WASM_VECTOR_LEN = 0;
function dropObject(idx) {
if (idx < 36) return;
heap[idx] = heap_next;
heap_next = idx;
let cachedTextEncoder = new TextEncoder('utf-8');
const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
? function (arg, view) {
return cachedTextEncoder.encodeInto(arg, view);
}
: function (arg, view) {
const buf = cachedTextEncoder.encode(arg);
view.set(buf);
return {
read: arg.length,
written: buf.length
};
});
function takeObject(idx) {
const ret = getObject(idx);
dropObject(idx);
return ret;
function passStringToWasm0(arg, malloc, realloc) {
if (realloc === undefined) {
const buf = cachedTextEncoder.encode(arg);
const ptr = malloc(buf.length);
getUint8Memory0().subarray(ptr, ptr + buf.length).set(buf);
WASM_VECTOR_LEN = buf.length;
return ptr;
}
let len = arg.length;
let ptr = malloc(len);
const mem = getUint8Memory0();
let offset = 0;
for (; offset < len; offset++) {
const code = arg.charCodeAt(offset);
if (code > 0x7F) break;
mem[ptr + offset] = code;
}
if (offset !== len) {
if (offset !== 0) {
arg = arg.slice(offset);
}
ptr = realloc(ptr, len, len = offset + arg.length * 3);
const view = getUint8Memory0().subarray(ptr + offset, ptr + len);
const ret = encodeString(arg, view);
offset += ret.written;
}
WASM_VECTOR_LEN = offset;
return ptr;
}
let cachegetInt32Memory0 = null;
function getInt32Memory0() {
if (cachegetInt32Memory0 === null || cachegetInt32Memory0.buffer !== wasm.memory.buffer) {
cachegetInt32Memory0 = new Int32Array(wasm.memory.buffer);
}
return cachegetInt32Memory0;
}
function debugString(val) {

@@ -119,65 +182,2 @@ // primitive types

let WASM_VECTOR_LEN = 0;
let cachedTextEncoder = new TextEncoder('utf-8');
const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
? function (arg, view) {
return cachedTextEncoder.encodeInto(arg, view);
}
: function (arg, view) {
const buf = cachedTextEncoder.encode(arg);
view.set(buf);
return {
read: arg.length,
written: buf.length
};
});
function passStringToWasm0(arg, malloc, realloc) {
if (realloc === undefined) {
const buf = cachedTextEncoder.encode(arg);
const ptr = malloc(buf.length);
getUint8Memory0().subarray(ptr, ptr + buf.length).set(buf);
WASM_VECTOR_LEN = buf.length;
return ptr;
}
let len = arg.length;
let ptr = malloc(len);
const mem = getUint8Memory0();
let offset = 0;
for (; offset < len; offset++) {
const code = arg.charCodeAt(offset);
if (code > 0x7F) break;
mem[ptr + offset] = code;
}
if (offset !== len) {
if (offset !== 0) {
arg = arg.slice(offset);
}
ptr = realloc(ptr, len, len = offset + arg.length * 3);
const view = getUint8Memory0().subarray(ptr + offset, ptr + len);
const ret = encodeString(arg, view);
offset += ret.written;
}
WASM_VECTOR_LEN = offset;
return ptr;
}
let cachegetInt32Memory0 = null;
function getInt32Memory0() {
if (cachegetInt32Memory0 === null || cachegetInt32Memory0.buffer !== wasm.memory.buffer) {
cachegetInt32Memory0 = new Int32Array(wasm.memory.buffer);
}
return cachegetInt32Memory0;
}
function makeMutClosure(arg0, arg1, dtor, f) {

@@ -207,3 +207,3 @@ const state = { a: arg0, b: arg1, cnt: 1, dtor };

}
function __wbg_adapter_12(arg0, arg1, arg2) {
function __wbg_adapter_18(arg0, arg1, arg2) {
wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hd9d00d3aeebb5f0a(arg0, arg1, addHeapObject(arg2));

@@ -220,2 +220,36 @@ }

/**
* Parse flux into an AST representation. The AST will be generated regardless
* of valid flux. As such, no error handling is needed.
* @param {string} script
* @returns {any}
*/
module.exports.parse = function(script) {
var ptr0 = passStringToWasm0(script, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
var len0 = WASM_VECTOR_LEN;
var ret = wasm.parse(ptr0, len0);
return takeObject(ret);
};
/**
* Format a flux script from AST.
*
* In the event that the flux is invalid syntax, an Err will be returned,
* which will translate into a JavaScript exception being thrown.
* @param {any} js_file
* @returns {string}
*/
module.exports.format_from_js_file = function(js_file) {
try {
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
wasm.format_from_js_file(retptr, addHeapObject(js_file));
var r0 = getInt32Memory0()[retptr / 4 + 0];
var r1 = getInt32Memory0()[retptr / 4 + 1];
return getStringFromWasm0(r0, r1);
} finally {
wasm.__wbindgen_add_to_stack_pointer(16);
wasm.__wbindgen_free(r0, r1);
}
};
function handleError(f, args) {

@@ -228,3 +262,3 @@ try {

}
function __wbg_adapter_26(arg0, arg1, arg2, arg3) {
function __wbg_adapter_34(arg0, arg1, arg2, arg3) {
wasm.wasm_bindgen__convert__closures__invoke2_mut__h49fa787168aa1201(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));

@@ -297,2 +331,6 @@ }

module.exports.__wbindgen_object_drop_ref = function(arg0) {
takeObject(arg0);
};
module.exports.__wbindgen_string_new = function(arg0, arg1) {

@@ -303,6 +341,16 @@ var ret = getStringFromWasm0(arg0, arg1);

module.exports.__wbindgen_object_drop_ref = function(arg0) {
takeObject(arg0);
module.exports.__wbindgen_json_parse = function(arg0, arg1) {
var ret = JSON.parse(getStringFromWasm0(arg0, arg1));
return addHeapObject(ret);
};
module.exports.__wbindgen_json_serialize = function(arg0, arg1) {
const obj = getObject(arg1);
var ret = JSON.stringify(obj === undefined ? null : obj);
var ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
var len0 = WASM_VECTOR_LEN;
getInt32Memory0()[arg0 / 4 + 1] = len0;
getInt32Memory0()[arg0 / 4 + 0] = ptr0;
};
module.exports.__wbg_new_693216e109162396 = function() {

@@ -351,3 +399,3 @@ var ret = new Error();

try {
return __wbg_adapter_26(a, state0.b, arg0, arg1);
return __wbg_adapter_34(a, state0.b, arg0, arg1);
} finally {

@@ -386,4 +434,8 @@ state0.a = a;

module.exports.__wbindgen_closure_wrapper7926 = function(arg0, arg1, arg2) {
var ret = makeMutClosure(arg0, arg1, 1133, __wbg_adapter_12);
module.exports.__wbindgen_rethrow = function(arg0) {
throw takeObject(arg0);
};
module.exports.__wbindgen_closure_wrapper8011 = function(arg0, arg1, arg2) {
var ret = makeMutClosure(arg0, arg1, 1152, __wbg_adapter_18);
return addHeapObject(ret);

@@ -390,0 +442,0 @@ };

@@ -7,3 +7,3 @@ {

"description": "LSP support for the flux language",
"version": "0.7.2",
"version": "0.7.4",
"license": "MIT",

@@ -10,0 +10,0 @@ "repository": {

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc