1
0
Fork 0

fix(shared): Display of part named in workbench

This commit is contained in:
Joost De Cock 2023-09-15 17:59:32 +02:00
parent 36465d7302
commit 28f82019f6
6 changed files with 32 additions and 10 deletions

View file

@ -457,3 +457,13 @@ export const randomString = (len = 42) => {
window.crypto.getRandomValues(arr) // eslint-disable-line
return Array.from(arr, dec2hex).join('')
}
/*
* Gets the pattern namespaces based on patternConfig
*/
export const patternNsFromPatternConfig = (config) => {
const ns = new Set()
for (const part of config.draftOrder) ns.add(part.split('.')[0])
return [...ns]
}