UNPKG

@drincs/pixi-vn-ink

Version:

Pixi'VN gives you the ability to write your own narrative using Ink

1 lines 692 B
function p(t,l){if(t.endsWith(".s"))return;if(new RegExp(/.*\.[0-9]+\..*$/).test(t)&&(t=t.split(".").filter(i=>!i.match(/^[0-9]+$/)).join("."),!t.startsWith(".")))return t.replaceAll(".","_|_");if(!new RegExp(/^\.\^.*$/).test(t)&&t.includes("g-")){let s=t.split("g-");return r(l)+"_|_"+"g-"+s[s.length-1]}let n=0;for(;new RegExp(/^\.\^.*$/).test(t);)n++,t=t.substring(2);if(n=n-1,new RegExp(/^\..*$/).test(t)&&l){let s=t.substring(1);return r(l,n)+"_|_"+s.replaceAll(".","_|_")}return t.replaceAll(".","_|_")||r(l,n).replaceAll(".","_|_")}function r(t,l=0){let n=t.split("_|_");for(;n.length>1&&l>0;)n.pop()?.includes("g-")&&l--,l--;return n.join("_|_")}export{p as getLabelByStandardDivert};