mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-21 07:16:17 -04:00
Merge branch 'master' into master
This commit is contained in:
commit
3cdbdf4223
4 changed files with 49 additions and 2 deletions
22
package-lock.json
generated
22
package-lock.json
generated
|
@ -118,6 +118,7 @@
|
||||||
"chromedriver": "^130.0.0",
|
"chromedriver": "^130.0.0",
|
||||||
"cli-progress": "^3.12.0",
|
"cli-progress": "^3.12.0",
|
||||||
"colors": "^1.4.0",
|
"colors": "^1.4.0",
|
||||||
|
"compression-webpack-plugin": "^11.1.0",
|
||||||
"copy-webpack-plugin": "^12.0.2",
|
"copy-webpack-plugin": "^12.0.2",
|
||||||
"core-js": "^3.37.1",
|
"core-js": "^3.37.1",
|
||||||
"css-loader": "7.1.2",
|
"css-loader": "7.1.2",
|
||||||
|
@ -5344,6 +5345,27 @@
|
||||||
"node": ">= 0.8.0"
|
"node": ">= 0.8.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/compression-webpack-plugin": {
|
||||||
|
"version": "11.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/compression-webpack-plugin/-/compression-webpack-plugin-11.1.0.tgz",
|
||||||
|
"integrity": "sha512-zDOQYp10+upzLxW+VRSjEpRRwBXJdsb5lBMlRxx1g8hckIFBpe3DTI0en2w7h+beuq89576RVzfiXrkdPGrHhA==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"schema-utils": "^4.2.0",
|
||||||
|
"serialize-javascript": "^6.0.2"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 18.12.0"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"type": "opencollective",
|
||||||
|
"url": "https://opencollective.com/webpack"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"webpack": "^5.1.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/compression/node_modules/bytes": {
|
"node_modules/compression/node_modules/bytes": {
|
||||||
"version": "3.0.0",
|
"version": "3.0.0",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
|
|
|
@ -58,6 +58,7 @@
|
||||||
"chromedriver": "^130.0.0",
|
"chromedriver": "^130.0.0",
|
||||||
"cli-progress": "^3.12.0",
|
"cli-progress": "^3.12.0",
|
||||||
"colors": "^1.4.0",
|
"colors": "^1.4.0",
|
||||||
|
"compression-webpack-plugin": "^11.1.0",
|
||||||
"copy-webpack-plugin": "^12.0.2",
|
"copy-webpack-plugin": "^12.0.2",
|
||||||
"core-js": "^3.37.1",
|
"core-js": "^3.37.1",
|
||||||
"css-loader": "7.1.2",
|
"css-loader": "7.1.2",
|
||||||
|
|
|
@ -22,7 +22,13 @@ class AddLineNumbers extends Operation {
|
||||||
this.description = "Adds line numbers to the output.";
|
this.description = "Adds line numbers to the output.";
|
||||||
this.inputType = "string";
|
this.inputType = "string";
|
||||||
this.outputType = "string";
|
this.outputType = "string";
|
||||||
this.args = [];
|
this.args = [
|
||||||
|
{
|
||||||
|
"name": "Offset",
|
||||||
|
"type": "number",
|
||||||
|
"value": 0
|
||||||
|
}
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -33,10 +39,11 @@ class AddLineNumbers extends Operation {
|
||||||
run(input, args) {
|
run(input, args) {
|
||||||
const lines = input.split("\n"),
|
const lines = input.split("\n"),
|
||||||
width = lines.length.toString().length;
|
width = lines.length.toString().length;
|
||||||
|
const offset = args[0] ? parseInt(args[0], 10) : 0;
|
||||||
let output = "";
|
let output = "";
|
||||||
|
|
||||||
for (let n = 0; n < lines.length; n++) {
|
for (let n = 0; n < lines.length; n++) {
|
||||||
output += (n+1).toString().padStart(width, " ") + " " + lines[n] + "\n";
|
output += (n+1+offset).toString().padStart(width, " ") + " " + lines[n] + "\n";
|
||||||
}
|
}
|
||||||
return output.slice(0, output.length-1);
|
return output.slice(0, output.length-1);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,10 @@
|
||||||
const webpack = require("webpack");
|
const webpack = require("webpack");
|
||||||
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
|
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
|
||||||
|
const CompressionPlugin = require("compression-webpack-plugin");
|
||||||
const CopyWebpackPlugin = require("copy-webpack-plugin");
|
const CopyWebpackPlugin = require("copy-webpack-plugin");
|
||||||
const { ModifySourcePlugin, ReplaceOperation } = require("modify-source-webpack-plugin");
|
const { ModifySourcePlugin, ReplaceOperation } = require("modify-source-webpack-plugin");
|
||||||
const path = require("path");
|
const path = require("path");
|
||||||
|
const zlib = require("zlib");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Webpack configuration details for use with Grunt.
|
* Webpack configuration details for use with Grunt.
|
||||||
|
@ -64,6 +66,21 @@ module.exports = {
|
||||||
new MiniCssExtractPlugin({
|
new MiniCssExtractPlugin({
|
||||||
filename: "assets/[name].css"
|
filename: "assets/[name].css"
|
||||||
}),
|
}),
|
||||||
|
new CompressionPlugin({
|
||||||
|
filename: "[path][base].gz",
|
||||||
|
algorithm: "gzip",
|
||||||
|
test: /\.(js|css|html)$/,
|
||||||
|
}),
|
||||||
|
new CompressionPlugin({
|
||||||
|
filename: "[path][base].br",
|
||||||
|
algorithm: "brotliCompress",
|
||||||
|
test: /\.(js|css|html)$/,
|
||||||
|
compressionOptions: {
|
||||||
|
params: {
|
||||||
|
[zlib.constants.BROTLI_PARAM_QUALITY]: 11,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}),
|
||||||
new CopyWebpackPlugin({
|
new CopyWebpackPlugin({
|
||||||
patterns: [
|
patterns: [
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue