( command: IUserScript, )
| 30 | * never consume each other's preloaded entry. |
| 31 | */ |
| 32 | export function getUserScriptPreloadKey( |
| 33 | command: IUserScript, |
| 34 | ): string | undefined { |
| 35 | const base = command.path ?? command.id; |
| 36 | if (base === undefined) return undefined; |
| 37 | const { memberAccess } = getUserScriptMemberAccess(command.name ?? ""); |
| 38 | return memberAccess && memberAccess.length > 0 |
| 39 | ? `${base}::${memberAccess.join("::")}` |
| 40 | : base; |
| 41 | } |
| 42 | |
| 43 | // Slightly modified version of Templater's user script import implementation |
| 44 | // Source: https://github.com/SilentVoid13/Templater |
no test coverage detected