npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@actuarial-ts/data

v0.3.0

Published

Data ingestion and ASOP No. 23 data-quality review for the actuarial-ts SDK: RFC 4180 CSV parsing, loss-run import, long-format triangle assembly, and claim/triangle review checks.

Readme

@actuarial-ts/data

Data ingestion and ASOP No. 23 data-quality review for the actuarial-ts SDK. Pure functions, zero runtime dependencies (besides @actuarial-ts/core), fully typed.

  • parseCsv(text) — minimal RFC 4180-subset CSV parser (quoted fields, escaped quotes, embedded commas/newlines, BOM, CRLF/LF).
  • parseLossRunCsv(text) — loss-run import to ClaimSnapshot[] with per-row validation errors (1-based row numbers including the header).
  • triangleFromLongFormat(rows, { kind }) — pivots long-format (origin, age, value) rows into a Triangle.
  • reviewClaimData(claims, { asOfDate? }) / reviewTriangles(paid, incurred) — the ASOP No. 23-oriented review; every check performed is listed in the report, pass or fail, so the actuary's disclosure can state what WAS reviewed, not just what was found.

Checks

reviewClaimData

| id | status when found | what it finds | |----|-------------------|---------------| | negative-paid | fail | cumulative paid < 0 | | negative-case | warning | case reserve < 0 (legitimate but rare) | | paid-decreasing | fail | cumulative paid decreasing across a claim's snapshots ordered by evaluation date | | date-order | fail | report before accident, or evaluation before report | | duplicate-snapshot | fail | same claimId + evaluationDate twice | | future-dated | fail | any claim date after asOfDate (not evaluated when asOfDate is omitted) | | closed-with-case | warning | closed claim still carrying case reserve |

reviewTriangles

| id | status when found | what it finds | |----|-------------------|---------------| | shape-mismatch | fail | origins/ages differ between paid and incurred (blocks cell-level checks, which stay listed as "not evaluated") | | paid-exceeds-incurred | fail | paid > incurred in a cell (1e-9 relative tolerance) | | negative-incremental-paid | warning | cumulative paid decreasing along a row (salvage/subrogation makes this legal but reportable) | | negative-incremental-incurred | warning | cumulative incurred decreasing along a row | | interior-missing | warning | a null cell with observed cells both before and after it in the same row |

Quickstart

import { buildTriangles } from "@actuarial-ts/core";
import { parseLossRunCsv, reviewClaimData, reviewTriangles } from "@actuarial-ts/data";

const { claims, errors } = parseLossRunCsv(csvText);
if (errors.length > 0) console.warn(errors); // caller decides: abort or proceed

const claimReview = reviewClaimData(claims, { asOfDate: "2023-12-31" });

const { paid, incurred } = buildTriangles(claims, {
  cadence: "annual",
  asOfDate: "2023-12-31",
});
const triangleReview = reviewTriangles(paid, incurred);

These utilities are designed to support the actuary's compliance with ASOP No. 23; responsibility for compliance remains with the credentialed actuary.

License

Apache-2.0. See LICENSE and NOTICE.