a33c8b004a35677925ba3e1c60b0ac8034b212c4
3 const { TemplateHelper
} = require('@squeep/html-template-helper');
7 * Escape a string to be suitable as a CSS name.
8 * @param {String} unsafeName
11 function escapeCSS(unsafeName
) {
12 return unsafeName
.replace(/([^0-9a-zA-Z-])/g, '\\$1');
17 * Given a pair of Array tuples containing scope names and scope details,
18 * return the comparison between the two, for sorting.
19 * Scopes are sorted such that they are grouped by application, then name.
20 * Empty applications are sorted ahead of extant applications.
25 function scopeCompare([aScope
, aDetails
], [bScope
, bDetails
]) {
26 const { application: aApp
} = aDetails
;
27 const { application: bApp
} = bDetails
;
28 if ((aApp
|| bApp
) && (aApp
!== bApp
)) {
41 if (aScope
> bScope
) {
43 } else if (aScope
< bScope
) {
50 module
.exports
= Object
.assign(Object
.create(TemplateHelper
), {