Paperjs SVG 导入:如何访问组 ID

Paperjs SVG import: How to access group id's

在 paperjs 中,我正在导入一个包含如下元素的 SVG 文件:

<g id="Layer_4">
    <circle fill="#F42700" cx="114.5" cy="249.5" r="50"/>
    <circle fill="#F42700" cx="385.5" cy="249.5" r="50"/>
</g>
<g id="Layer_3">
    <path fill="#8A0055" d="M408,263l-36-0.3V38c0-0.3-..."/>
</g>

这些顶级组可以在解析的 SVG 中作为创建的 SVG 对象的直接子对象访问。但是除了他们的订单之外,有什么方法可以检索原始 id 参数?

顶级组ids变成item.name参数,如:

paper.project.import("path/to/svg.svg", function (item) {
    console.log(item.firstChild.name)
}

根据 this comment.