Changing corner types and fixing annoying spikes

So, you know how when a corner is too sharp it juts out really far? Have you ever wanted to fix this without having to precariously set corners to be slightly rounded off?

Well, there’s a property for this called “strokeJoin” (which can be “miter” (sharp), “bevel” (flattened) or “round” (round))

So, I made some functions to set the DEFAULT strokejoin (affects new paths) to the 3 different values.

MAIN PROBLEM: It sets ALL corners in the project to the value, so some help would be appreciated.

Functions
function bevelCorners(){
    project._children[0]._children[0]._children[0]._children[0].view.item.style._defaults.strokeJoin = "bevel";
}
function roundCorners(){
    project._children[0]._children[0]._children[0]._children[0].view.item.style._defaults.strokeJoin = "round";
}
function sharpCorners(){
    project._children[0]._children[0]._children[0]._children[0].view.item.style._defaults.strokeJoin = "miter";
}

is the long string of _children[0]s supposed to access the property of a single path object? i haven’t done any research on how paper.js (i think it’s paper anyway) works but it looks like you’re overriding a default value (_defaults.strokeJoin) to me. not sure if this default value is used by everything else in the project.

it is used by everything else in the project, but for some reason it’s stored within individual paths.