Files
portfolio2023/node_modules/haye/dist/haye-json-presenter.es.js
T
2023-11-24 22:35:41 +01:00

2 lines
437 B
JavaScript

function n(){return{nodes:[],currentNode:null,add:function(){this.currentNode={name:"",args:[]},this.nodes.push(this.currentNode)},appendKey:function(n,e){32!==e&&(this.currentNode.name+=n)},appendValue:function(n){this.currentNode.args[this.currentNode.args.length-1]+=n},shiftValue:function(){this.currentNode.args.push("")},toJSON:function(){return this.nodes.reduce((function(n,e){return n[e.name]=e.args,n}),{})}}}export default n;