Skip to content

Instantly share code, notes, and snippets.

View SimonStorlSchulke's full-sized avatar

Simon Storl-Schulke SimonStorlSchulke

View GitHub Profile
@SimonStorlSchulke
SimonStorlSchulke / replaceJsonArguments.ts
Created March 21, 2023 00:23
Replace mutiple json values at the given key-array
function replaceJsonArguments(jsonText: string, keyValues: Map<string[], string>) {
let jsonObj = JSON.parse(jsonText);
for (let [key, value] of keyValues) {
var currentObj = jsonObj;
for (var i = 0; i < key.length - 1; i++) {
currentObj = currentObj[key[i]];
}
currentObj[key[key.length - 1]] = value; //ChatGPT is a genius...
<style>
/* <![CDATA[ */
.j-blog-header {
font-size: 40px;
}
.j-blog #cc-matrix-,
#new-dogs-area #cc-matrix- {
<style>
/* <![CDATA[ */
.j-blog-header {
font-size: 40px;
}
.j-blog #cc-matrix-,
#new-dogs-area #cc-matrix- {