Files
Martien 5605b9b49a Initial commit: n8n Strike API node
- Add Strike API credentials configuration
- Implement Strike node with 9 resources (Account, Balance, Currency Exchange, Deposit, Invoice, Payment, Payment Method, Payout, Rates)
- Add comprehensive operation descriptions for all resources
- Include CLAUDE.MD documentation
- Set up build configuration with TypeScript, ESLint, and Prettier

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-10 11:00:38 +01:00

41 lines
1.1 KiB
JavaScript

"use strict";
var ensureString = require("type/string/ensure")
, isValue = require("type/value/is")
, esniff = require("./");
module.exports = function (name/*, options*/) {
var options = Object(arguments[1])
, asProperty = options.asProperty
, asPlain = isValue(options.asPlain) ? options.asPlain : true;
var length, names;
name = ensureString(name);
names = name.split(".").map(function (prop) {
prop = prop.trim();
if (!prop) throw new TypeError(name + " is not valid function name");
return prop;
});
length = names.length;
return function (code) {
code = ensureString(code);
return esniff(code, function (emitter) {
emitter.on("trigger:" + names[0][0], function (accessor) {
if (accessor.previousToken === ".") {
if (!asProperty) return;
} else if (!asPlain) {
return;
}
for (var i = 0, propertyName; (propertyName = names[i]); ++i) {
if (!accessor.skipCodePart(propertyName)) return;
accessor.skipWhitespace();
if (i < length - 1) {
if (!accessor.skipCodePart(".")) return;
accessor.skipWhitespace();
}
}
accessor.collectScope();
});
});
};
};