@lwc/jest-shared
Advanced tools
Comparing version 11.8.0 to 12.0.0
{ | ||
"name": "@lwc/jest-shared", | ||
"version": "11.8.0", | ||
"version": "12.0.0", | ||
"description": "Shared internal code for LWC Jest packages", | ||
@@ -23,3 +23,3 @@ "homepage": "https://lwc.dev/", | ||
}, | ||
"gitHead": "69fdc0c8ed1fe3522fab01049b305cf5b5b2d0f1" | ||
"gitHead": "35157d2926c57b287a3bfa77c895733e0a03a9fa" | ||
} |
@@ -20,5 +20,37 @@ const knownScopedCssFiles = new Set(); | ||
const knownScopeTokens = new Set(); | ||
/** | ||
* Indicate that this string is a scope token (used by LWC for style scoping). | ||
* @param str - scope token string | ||
*/ | ||
function addKnownScopeToken(str) { | ||
// attributes in the HTML namespace are case-insensitive, so we treat everything as lowercase | ||
knownScopeTokens.add(str.toLowerCase()); | ||
} | ||
/** | ||
* Check if this string is a known scope token | ||
* @param str - string to check | ||
* @returns {boolean} - true if it's a known scope token | ||
*/ | ||
function isKnownScopeToken(str) { | ||
// attributes in the HTML namespace are case-insensitive, so we treat everything as lowercase | ||
return knownScopeTokens.has(str.toLowerCase()); | ||
} | ||
/** | ||
* Get all known scope tokens | ||
@returns {string[]} - list of known scope tokens | ||
*/ | ||
function getKnownScopeTokens() { | ||
return [...knownScopeTokens]; | ||
} | ||
module.exports = { | ||
addKnownScopedCssFile, | ||
isKnownScopedCssFile | ||
isKnownScopedCssFile, | ||
addKnownScopeToken, | ||
isKnownScopeToken, | ||
getKnownScopeTokens, | ||
}; |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
3328
48
0