Skip to content

Commit

Permalink
Automatically applying Prettier changes
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Mar 15, 2024
1 parent 92155c9 commit f00d3fb
Show file tree
Hide file tree
Showing 5 changed files with 89 additions and 74 deletions.
34 changes: 17 additions & 17 deletions JS/jsonnet/src/jsonnet_wasm.d.ts
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
/* tslint:disable */
/* eslint-disable */
/**
* @returns {number}
*/
* @returns {number}
*/
export function jsonnet_make(): number;
/**
* @param {number} vm
*/
* @param {number} vm
*/
export function jsonnet_destroy(vm: number): void;
/**
* @param {number} vm
* @param {string} filename
* @param {string} snippet
* @returns {string}
*/
* @param {number} vm
* @param {string} filename
* @param {string} snippet
* @returns {string}
*/
export function jsonnet_evaluate_snippet(vm: number, filename: string, snippet: string): string;
/**
* @param {number} vm
* @param {string} filename
* @returns {string}
*/
* @param {number} vm
* @param {string} filename
* @returns {string}
*/
export function jsonnet_evaluate_file(vm: number, filename: string): string;
/**
* @param {number} vm
* @param {string} key
* @param {string} value
*/
* @param {number} vm
* @param {string} key
* @param {string} value
*/
export function ext_string(vm: number, key: string, value: string): void;
2 changes: 1 addition & 1 deletion JS/jsonnet/src/jsonnet_wasm.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as imports from "./jsonnet_wasm_bg.js";
// switch between both syntax for Node.js and for workers (Cloudflare Workers)
import * as wkmod from "./jsonnet_wasm_bg.wasm";
import * as nodemod from "./jsonnet_wasm_bg.wasm";
if ((typeof process !== 'undefined') && (process.release.name === 'node')) {
if (typeof process !== "undefined" && process.release.name === "node") {
imports.__wbg_set_wasm(nodemod);
} else {
const instance = new WebAssembly.Instance(wkmod.default, { "./jsonnet_wasm_bg.js": imports });
Expand Down
114 changes: 61 additions & 53 deletions JS/jsonnet/src/jsonnet_wasm_bg.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
import { read_file } from './snippets/arakoo-07ad5af4ed8e3fe0/read-file.js';
import { read_file } from "./snippets/arakoo-07ad5af4ed8e3fe0/read-file.js";

let wasm;
export function __wbg_set_wasm(val) {
wasm = val;
}


const heap = new Array(128).fill(undefined);

heap.push(undefined, null, true, false);

function getObject(idx) { return heap[idx]; }
function getObject(idx) {
return heap[idx];
}

let WASM_VECTOR_LEN = 0;

Expand All @@ -23,29 +24,32 @@ function getUint8Memory0() {
return cachedUint8Memory0;
}

const lTextEncoder = typeof TextEncoder === 'undefined' ? (0, module.require)('util').TextEncoder : TextEncoder;
const lTextEncoder =
typeof TextEncoder === "undefined" ? (0, module.require)("util").TextEncoder : TextEncoder;

let cachedTextEncoder = new lTextEncoder('utf-8');
let cachedTextEncoder = new lTextEncoder("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
};
});
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, 1) >>> 0;
getUint8Memory0().subarray(ptr, ptr + buf.length).set(buf);
getUint8Memory0()
.subarray(ptr, ptr + buf.length)
.set(buf);
WASM_VECTOR_LEN = buf.length;
return ptr;
}
Expand All @@ -59,15 +63,15 @@ function passStringToWasm0(arg, malloc, realloc) {

for (; offset < len; offset++) {
const code = arg.charCodeAt(offset);
if (code > 0x7F) break;
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, 1) >>> 0;
ptr = realloc(ptr, len, (len = offset + arg.length * 3), 1) >>> 0;
const view = getUint8Memory0().subarray(ptr + offset, ptr + len);
const ret = encodeString(arg, view);

Expand Down Expand Up @@ -106,9 +110,10 @@ function takeObject(idx) {
return ret;
}

const lTextDecoder = typeof TextDecoder === 'undefined' ? (0, module.require)('util').TextDecoder : TextDecoder;
const lTextDecoder =
typeof TextDecoder === "undefined" ? (0, module.require)("util").TextDecoder : TextDecoder;

let cachedTextDecoder = new lTextDecoder('utf-8', { ignoreBOM: true, fatal: true });
let cachedTextDecoder = new lTextDecoder("utf-8", { ignoreBOM: true, fatal: true });

cachedTextDecoder.decode();

Expand All @@ -134,26 +139,26 @@ function handleError(f, args) {
}
}
/**
* @returns {number}
*/
* @returns {number}
*/
export function jsonnet_make() {
const ret = wasm.jsonnet_make();
return ret >>> 0;
}

/**
* @param {number} vm
*/
* @param {number} vm
*/
export function jsonnet_destroy(vm) {
wasm.jsonnet_destroy(vm);
}

/**
* @param {number} vm
* @param {string} filename
* @param {string} snippet
* @returns {string}
*/
* @param {number} vm
* @param {string} filename
* @param {string} snippet
* @returns {string}
*/
export function jsonnet_evaluate_snippet(vm, filename, snippet) {
let deferred3_0;
let deferred3_1;
Expand All @@ -176,10 +181,10 @@ export function jsonnet_evaluate_snippet(vm, filename, snippet) {
}

/**
* @param {number} vm
* @param {string} filename
* @returns {string}
*/
* @param {number} vm
* @param {string} filename
* @returns {string}
*/
export function jsonnet_evaluate_file(vm, filename) {
let deferred2_0;
let deferred2_1;
Expand All @@ -200,10 +205,10 @@ export function jsonnet_evaluate_file(vm, filename) {
}

/**
* @param {number} vm
* @param {string} key
* @param {string} value
*/
* @param {number} vm
* @param {string} key
* @param {string} value
*/
export function ext_string(vm, key, value) {
const ptr0 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
const len0 = WASM_VECTOR_LEN;
Expand All @@ -214,26 +219,29 @@ export function ext_string(vm, key, value) {

export function __wbindgen_string_get(arg0, arg1) {
const obj = getObject(arg1);
const ret = typeof(obj) === 'string' ? obj : undefined;
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
const ret = typeof obj === "string" ? obj : undefined;
var ptr1 = isLikeNone(ret)
? 0
: passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
var len1 = WASM_VECTOR_LEN;
getInt32Memory0()[arg0 / 4 + 1] = len1;
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
};
}

export function __wbg_readfile_3df9f1d22ad880df() { return handleError(function (arg0, arg1, arg2) {
const ret = read_file(getStringFromWasm0(arg1, arg2));
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
const len1 = WASM_VECTOR_LEN;
getInt32Memory0()[arg0 / 4 + 1] = len1;
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
}, arguments) };
export function __wbg_readfile_3df9f1d22ad880df() {
return handleError(function (arg0, arg1, arg2) {
const ret = read_file(getStringFromWasm0(arg1, arg2));
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
const len1 = WASM_VECTOR_LEN;
getInt32Memory0()[arg0 / 4 + 1] = len1;
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
}, arguments);
}

export function __wbindgen_object_drop_ref(arg0) {
takeObject(arg0);
};
}

export function __wbg_log_50ac1182ae1d639d(arg0, arg1) {
console.log(getStringFromWasm0(arg0, arg1));
};

}
9 changes: 8 additions & 1 deletion JS/jsonnet/src/jsonnet_wasm_bg.wasm.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,14 @@
export const memory: WebAssembly.Memory;
export function jsonnet_make(): number;
export function jsonnet_destroy(a: number): void;
export function jsonnet_evaluate_snippet(a: number, b: number, c: number, d: number, e: number, f: number): void;
export function jsonnet_evaluate_snippet(
a: number,
b: number,
c: number,
d: number,
e: number,
f: number
): void;
export function jsonnet_evaluate_file(a: number, b: number, c: number, d: number): void;
export function ext_string(a: number, b: number, c: number, d: number, e: number): void;
export function __wbindgen_malloc(a: number, b: number): number;
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"dependencies": {
"@microsoft/eslint-formatter-sarif": "^3.0.0",
"@typescript-eslint/eslint-plugin": "^7.1.1",
"@typescript-eslint/parser": "^7.1.1",
"@typescript-eslint/eslint-plugin": "^7.2.0",
"@typescript-eslint/parser": "^7.2.0",
"eslint": "^8.57.0",
"eslint-config-google": "^0.14.0",
"eslint-config-prettier": "^9.1.0",
Expand Down

0 comments on commit f00d3fb

Please sign in to comment.