![Maven Central Adds Sigstore Signature Validation](https://cdn.sanity.io/images/cgdhsj6q/production/7da3bc8a946cfb5df15d7fcf49767faedc72b483-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Maven Central Adds Sigstore Signature Validation
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
@scm-manager/refractor-flatten
Advanced tools
A utility to transform Refractor ASTs to flat arrays.
A utility to transform Refractor ASTs to flat arrays.
yarn add @suin/refractor-flatten
# or
npm install @suin/refractor-flatten
import refractor from "refractor";
import flatten from "@suin/refractor-flatten";
const tree = refractor.highlight("`${value}`", "js");
const flat = flatten(tree);
The structure of tree
is:
root[1]
└─0 element<span>[3]
│ properties: {"className":["token","template-string"]}
├─0 element<span>[1]
│ │ properties: {"className":["token","template-punctuation","string"]}
│ └─0 text "`"
├─1 element<span>[3]
│ │ properties: {"className":["token","interpolation"]}
│ ├─0 element<span>[1]
│ │ │ properties: {"className":["token","interpolation-punctuation","punctuation"]}
│ │ └─0 text "${"
│ ├─1 text "value"
│ └─2 element<span>[1]
│ │ properties: {"className":["token","interpolation-punctuation","punctuation"]}
│ └─0 text "}"
└─2 element<span>[1]
│ properties: {"className":["token","template-punctuation","string"]}
└─0 text "`"
The structure of the flat
above becomes:
root[5]
├─0 element<span>[1]
│ │ properties: {"className":["token","template-string","template-punctuation","string"]}
│ └─0 text "`"
├─1 element<span>[1]
│ │ properties: {"className":["token","template-string","interpolation","interpolation-punctuation","punctuation"]}
│ └─0 text "${"
├─2 element<span>[1]
│ │ properties: {"className":["token","template-string","interpolation"]}
│ └─0 text "value"
├─3 element<span>[1]
│ │ properties: {"className":["token","template-string","interpolation","interpolation-punctuation","punctuation"]}
│ └─0 text "}"
└─4 element<span>[1]
│ properties: {"className":["token","template-string","template-punctuation","string"]}
└─0 text "`"
FAQs
A utility to transform Refractor ASTs to flat arrays.
The npm package @scm-manager/refractor-flatten receives a total of 0 weekly downloads. As such, @scm-manager/refractor-flatten popularity was classified as not popular.
We found that @scm-manager/refractor-flatten demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.