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

36 lines
1.0 KiB
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// Based on: https://github.com/mathiasbynens/String.prototype.at
// Thanks @mathiasbynens !
"use strict";
var toInteger = require("../../number/to-integer")
, validValue = require("../../object/valid-value");
module.exports = function (pos) {
var str = String(validValue(this)), size = str.length, cuFirst, cuSecond, nextPos, len;
pos = toInteger(pos);
// Account for out-of-bounds indices
// The odd lower bound is because the ToInteger operation is
// going to round `n` to `0` for `-1 < n <= 0`.
if (pos <= -1 || pos >= size) return "";
// Second half of `ToInteger`
// eslint-disable-next-line no-bitwise
pos |= 0;
// Get the first code unit and code unit value
cuFirst = str.charCodeAt(pos);
nextPos = pos + 1;
len = 1;
if (
// Check if its the start of a surrogate pair
cuFirst >= 0xd800 &&
cuFirst <= 0xdbff && // High surrogate
size > nextPos // There is a next code unit
) {
cuSecond = str.charCodeAt(nextPos);
if (cuSecond >= 0xdc00 && cuSecond <= 0xdfff) len = 2; // Low surrogate
}
return str.slice(pos, pos + len);
};