mirror of
https://github.com/czlonkowski/n8n-mcp.git
synced 2026-02-06 05:23:08 +00:00
chore: add pre-built dist folder for npx usage
This commit is contained in:
committed by
Romuald Członkowski
parent
a70d96a373
commit
5057481e70
47
dist/utils/expression-utils.js
vendored
Normal file
47
dist/utils/expression-utils.js
vendored
Normal file
@@ -0,0 +1,47 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.isExpression = isExpression;
|
||||
exports.containsExpression = containsExpression;
|
||||
exports.shouldSkipLiteralValidation = shouldSkipLiteralValidation;
|
||||
exports.extractExpressionContent = extractExpressionContent;
|
||||
exports.hasMixedContent = hasMixedContent;
|
||||
function isExpression(value) {
|
||||
return typeof value === 'string' && value.startsWith('=');
|
||||
}
|
||||
function containsExpression(value) {
|
||||
if (typeof value !== 'string') {
|
||||
return false;
|
||||
}
|
||||
return /\{\{.*\}\}/s.test(value);
|
||||
}
|
||||
function shouldSkipLiteralValidation(value) {
|
||||
return isExpression(value) || containsExpression(value);
|
||||
}
|
||||
function extractExpressionContent(value) {
|
||||
if (!isExpression(value)) {
|
||||
return value;
|
||||
}
|
||||
const withoutPrefix = value.substring(1);
|
||||
const match = withoutPrefix.match(/^\{\{(.+)\}\}$/s);
|
||||
if (match) {
|
||||
return match[1].trim();
|
||||
}
|
||||
return withoutPrefix;
|
||||
}
|
||||
function hasMixedContent(value) {
|
||||
if (typeof value !== 'string') {
|
||||
return false;
|
||||
}
|
||||
if (!containsExpression(value)) {
|
||||
return false;
|
||||
}
|
||||
const trimmed = value.trim();
|
||||
if (trimmed.startsWith('={{') && trimmed.endsWith('}}')) {
|
||||
const count = (trimmed.match(/\{\{/g) || []).length;
|
||||
if (count === 1) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
//# sourceMappingURL=expression-utils.js.map
|
||||
Reference in New Issue
Block a user