Urgent.News

What's breaking now, across thousands of outlets.

Tech

Modelling Swedish intestate succession in TypeScript

When someone in Sweden dies without a will, the Inheritance Code ( ärvdabalken , SFS 1958:637) decides who gets what. The rules fit on two printed pages. They are also a small, well-defined algorithm: a walk over a family tree with a fixed priority order, equal splits per branch, and a couple of special cases for spouses. I wrote that algorithm in TypeScript for a free calculator that answers…

Sweden's intestate succession law, as outlined in the Inheritance Code (ärvdabalken), dictates how assets are divided when someone dies without a will. This law is concise, fitting on just two printed pages, and follows a fixed order of priority, with equal splits per branch and special cases for spouses. The author has adapted this algorithm into a TypeScript calculator for Swedish users, providing a clear explanation of the law for developers who don't read Swedish.

The code is a single pure function, vemArver(input), which takes input and outputs who inherits, without any DOM or I/O operations. The law is structured into three classes of relatives: descendants, parents, and grandparents. Each class inherits only if all classes above it are empty. If a class member is deceased, their descendants or other relatives step into their place, with equal shares being taken.

The law also specifies that no other relatives, such as cousins, inherit, and if no heirs are found, the estate goes to Allmänna arvsfonden, the state inheritance fund.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

ssh-keygen -N Puts Your Passphrase in ps

I'm writing a small GUI that walks a person through creating an SSH key. The core of it is one call to ssh-keygen , and on paper that call is trivial: ssh-keygen -t ed25519 -f ~/.ssh/id_ed25519 -N…

  • Passing passphrase via -N argument is insecure as it resides in /proc
  • Pseudo-terminal approach depends on exact prompt text which changes over time
  • SSHASKPASS mechanism securely retrieves passphrase without exposing it in argv

A Media Asset Is a Stateful Object

A phone can upload a sharp photo and still leave the product with nothing usable. The bytes are there. A thumbnail may exist. A background cutout may even look clean.

  • Media asset is stateful object, not just bytes
  • Vehicle listings rely heavily on media preservation
  • Four lanes - storage, database, worker, product - must agree for listing readiness

More from Monday 12 October →