🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

mso-conditional-parser

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mso-conditional-parser - npm Package Compare versions

Comparing version
1.1.0
to
1.1.1
+8
-8
package.json
{
"name": "mso-conditional-parser",
"version": "1.1.0",
"version": "1.1.1",
"description": "Parser and translator for MSO (Outlook) conditional comments in HTML email",

@@ -45,11 +45,11 @@ "type": "module",

"@eslint/js": "^10.0.1",
"eslint": "^10.1.0",
"eslint": "^10.6.0",
"eslint-config-prettier": "^10.1.8",
"eslint-plugin-jsdoc": "^62.0.0",
"eslint-plugin-prettier": "^5.5.0",
"eslint-plugin-unicorn": "^64.0.0",
"globals": "^17.4.0",
"eslint-plugin-jsdoc": "^63.0.13",
"eslint-plugin-prettier": "^5.5.6",
"eslint-plugin-unicorn": "^71.1.0",
"globals": "^17.7.0",
"husky": "^9.1.7",
"lint-staged": "^17.0.5",
"prettier": "^3.8.2"
"lint-staged": "^17.0.8",
"prettier": "^3.9.5"
},

@@ -56,0 +56,0 @@ "lint-staged": {

@@ -7,3 +7,3 @@ # mso-conditional-parser

Used as the core engine by [`eslint-plugin-mso`](https://github.com/JoernBerkefeld/eslint-plugin-mso) and the [`MSO Conditional Comments`](https://marketplace.visualstudio.com/items?itemName=joernberkefeld.mso-conditionals) VS Code extension.
Used as the core engine by [`eslint-plugin-mso-email`](https://github.com/JoernBerkefeld/eslint-plugin-mso-email) and the [`MSO Conditional Comments`](https://marketplace.visualstudio.com/items?itemName=joernberkefeld.mso-conditionals) VS Code extension.

@@ -10,0 +10,0 @@ ## Installation

@@ -165,3 +165,3 @@ /**

if (trimmed === 'mso' || trimmed === '!mso' || trimmed === 'IE' || trimmed === '!IE') {
if (['mso', '!mso', 'IE', '!IE'].includes(trimmed)) {
return null;

@@ -265,7 +265,7 @@ }

*
* @param {string} str - Raw HTML comment string (trimmed).
* @param {string} string_ - Raw HTML comment string (trimmed).
* @returns {{ type: string, condition: string, translation: string, isValid: boolean, error?: string } | null} Parsed opener object, or null if not an MSO opener.
*/
export function parseMsoComment(str) {
const trimmed = str.trim();
export function parseMsoComment(string_) {
const trimmed = string_.trim();

@@ -282,8 +282,6 @@ // Downlevel-revealed non-standard: <![if condition]>

isValid: !assessment,
...(assessment
? {
error: assessment.error,
...(assessment.fix ? { conditionFix: assessment.fix } : {}),
}
: {}),
...(assessment && {
error: assessment.error,
...(assessment.fix && { conditionFix: assessment.fix }),
}),
};

@@ -303,8 +301,6 @@ }

isValid: !assessment,
...(assessment
? {
error: assessment.error,
...(assessment.fix ? { conditionFix: assessment.fix } : {}),
}
: {}),
...(assessment && {
error: assessment.error,
...(assessment.fix && { conditionFix: assessment.fix }),
}),
};

@@ -326,7 +322,7 @@ }

*
* @param {string} str - Raw HTML comment string (trimmed).
* @param {string} string_ - Raw HTML comment string (trimmed).
* @returns {{ type: string, isClosing: true } | null} Parsed closer object, or null if not an MSO closer.
*/
export function parseMsoEndComment(str) {
const trimmed = str.trim();
export function parseMsoEndComment(string_) {
const trimmed = string_.trim();

@@ -347,7 +343,7 @@ if (HIDDEN_CLOSER_RE.test(trimmed)) {

*
* @param {string} str - Raw HTML comment string.
* @param {string} string_ - Raw HTML comment string.
* @returns {boolean} True if the string is a recognized MSO comment opener or closer.
*/
export function isMsoComment(str) {
return parseMsoComment(str) !== null || parseMsoEndComment(str) !== null;
export function isMsoComment(string_) {
return parseMsoComment(string_) !== null || parseMsoEndComment(string_) !== null;
}