Functional Weave
Code in TypeScript

Organisations / anterra

Anterra

1 member

Money, tax and invoicing capabilities for UK and Irish business software.

Published functions 200

email.send Integration · does I/O TypeScript only
Send a transactional email through Resend, any SMTP server or the log, behind one call.
encoding.utf8
Text to UTF-8 bytes and strictly back (RFC 3629), so hashing and signing see the same bytes in every language.
react.form.form-field React ^19 · TypeScript only
Wire a label, hint and error message to one form control by id, the accessible way (GOV.UK form group pattern).
finance.tax.vat-rate Unreviewed
Look up the VAT rate in force for a jurisdiction, category and date.
react.form.select React ^19 · TypeScript only
A labelled drop-down list with a hint, error message and an optional empty first option (GOV.UK select).
math.clamp
Clamp an integer to an inclusive range, refusing a range whose bounds are the wrong way round.
react.form.fieldset React ^19 · TypeScript only
Group related inputs under a legend, with a hint and error message described to the whole group (GOV.UK fieldset).
auth.oauth-sign-in Integration · does I/O TypeScript only
Sign users in with OpenID Connect or GitHub (authorisation code + PKCE), and keep them in a signed session cookie.
finance.tax.remove-vat Unreviewed
Extract the VAT already included in a gross amount, using the rate in force on the date of supply.
form.file-check
Check files chosen in an upload field: accept types, size, empty files and how many, with GOV.UK messages.
auth.jwt
Sign, verify and decode HS256 JSON Web Tokens (RFC 7519): signature, algorithm and exp/nbf/iat checked with leeway.
react.form.file-upload React ^19 · TypeScript only
A labelled file upload field: accept, size and how-many checked by form.file-check, the chosen files listed with errors.
react.form.button React ^19 · TypeScript only
A form button in primary, secondary or warning style that stays focusable while loading (GOV.UK button).
auth.totp
Authenticator-app two-factor codes (TOTP RFC 6238, HOTP RFC 4226): secret, QR URI, codes, verify with window and drift.
crypto.sha1
The SHA-1 digest of a byte string (FIPS 180-4), for HMAC-SHA1 in HOTP/TOTP codes; not for new signatures.
storage.signed-url Integration · does I/O TypeScript only
Signed URLs for a browser to upload a file straight to S3 or Google Cloud Storage, and to download it.
react.form.date-input React ^19 · TypeScript only
Day, month and year boxes under one legend, with hint, error message and the boxes in error marked (GOV.UK date input).
react.form.styles React ^19 · TypeScript only
An optional stylesheet for the react.form elements' caps-* classes, themed by --caps-form-* custom properties.
math.gcd-lcm
Greatest common divisor and least common multiple of two integers, exactly and without overflow.
invest.bond-yield Unreviewed
Current yield and yield to maturity of a fixed-coupon bond from its clean price, as Excel's YIELD defines it.
math.sin-cos
Sine and cosine of an angle in radians from + - * / only, so every language returns the same doubles.
charts.scale
Map data values onto screen positions and back: linear, log, time, band and point scales, and nice domains.
todo.import-csv
Read todos from a CSV file (RFC 4180) as todo.export-csv writes it, checking every row, with row-numbered errors.
math.exp
e to the power x from + - * / only, so TypeScript, Python and Rust return the same double for the same input.
todo.list
The to-do list reducer: add, edit, complete, remove, clear and reorder todos, each returning a new list.
math.ln
Natural logarithm from + - * / only, so TypeScript, Python and Rust return the same double for the same input.
charts.axis
Axis geometry as data: tick positions, tick marks, label anchors and gridlines for number, time and category axes.
charts.extent
The minimum and maximum of a series as [min, max], skipping gaps (null), or null when there is no value.
charts.shape
SVG path strings for lines, areas, steps, monotone curves, bars, arcs and pie slices, identical in every language.
charts.color
Hex colours to RGB and back, and sRGB channels to linear light and back, identically in every language.
fleet.emissions
Vehicle greenhouse gas emissions (grams CO2e) from fuel used or distance, using UK government DESNZ conversion factors.
retail.oss-vat
EU distance-selling VAT: which member state's standard rate applies under OSS and the EUR 10,000 threshold, and the VAT.