refactor(frontend): eslint contd

This commit is contained in:
Sarah Vaupel 2025-01-22 10:54:52 +01:00
parent f9f79b2a42
commit 0ad82f6275
2 changed files with 7 additions and 7 deletions

View File

@ -7,8 +7,8 @@ import svgPlugin from 'esbuild-plugin-svg-bundle';
import { copy } from 'esbuild-plugin-copy';
// import manifestPlugin from 'esbuild-plugin-manifest';
import manifestPlugin from 'esbuild-plugin-assets-manifest';
import copyWithHashPlugin from '@enonic/esbuild-plugin-copy-with-hash';
import inlineImportPlugin from 'esbuild-plugin-inline-import';
// import copyWithHashPlugin from '@enonic/esbuild-plugin-copy-with-hash';
// import inlineImportPlugin from 'esbuild-plugin-inline-import';
import { nodeModulesPolyfillPlugin } from 'esbuild-plugins-node-modules-polyfill';
const staticDir = './static';

View File

@ -1,11 +1,11 @@
// SPDX-FileCopyrightText: 2022-2024 Sarah Vaupel <sarah.vaupel@uniworx.de>, Gregor Kleen <gregor.kleen@ifi.lmu.de>,Johannes Eder <ederj@cip.ifi.lmu.de>,Sarah Vaupel <sarah.vaupel@ifi.lmu.de>,Sarah Vaupel <vaupel.sarah@campus.lmu.de>
// SPDX-FileCopyrightText: 2022-2025 Sarah Vaupel <sarah.vaupel@uniworx.de>, Gregor Kleen <gregor.kleen@ifi.lmu.de>,Johannes Eder <ederj@cip.ifi.lmu.de>,Sarah Vaupel <sarah.vaupel@ifi.lmu.de>,Sarah Vaupel <vaupel.sarah@campus.lmu.de>
//
// SPDX-License-Identifier: AGPL-3.0-or-later
/* global:writable */
import semver from 'semver';
// import sodium from 'sodium-javascript';
import sodium from 'sodium-javascript';
import { HttpClient } from '../../services/http-client/http-client';
@ -501,10 +501,10 @@ function encrypt(plaintext, key) {
// TODO use const if possible
let plaintextB = Buffer.from(plaintext);
let cipherB = Buffer.alloc(plaintextB.length + sodium.crypto_secretbox_MACBYTES);
let nonceB = undefined; // Buffer.alloc(sodium.crypto_secretbox_NONCEBYTES);
let nonceB = Buffer.alloc(sodium.crypto_secretbox_NONCEBYTES);
let keyB = Buffer.from(key);
// sodium.crypto_secretbox_easy(cipherB, plaintextB, nonceB, keyB);
sodium.crypto_secretbox_easy(cipherB, plaintextB, nonceB, keyB);
const result = cipherB;
console.log('encrypt result', result);
@ -524,7 +524,7 @@ function decrypt(ciphertext, key) {
let nonceB = undefined; Buffer.alloc(sodium.crypto_secretbox_NONCEBYTES);
let keyB = Buffer.from(key);
// sodium.crypto_secretbox_open_easy(plaintextB, cipherB, nonceB, keyB);
sodium.crypto_secretbox_open_easy(plaintextB, cipherB, nonceB, keyB);
const result = plaintextB.toString();
console.log('decrypt result', result);