Skip to content

agree

Whether two raw license strings agree closely enough to count as “no real conflict” — true when their family sets share at least one real (known) family, or when either side is entirely unknown (e.g. "custom"/"unknown") — a vague claim is never itself evidence of disagreement. Only two different, both-known family sets (e.g. bsd vs apache) count as a real conflict.

Available since v3.1.2

import { agree } from '@helpers4/license';
// or, from the all-in-one package (same code, one install):
import { agree } from 'helpers4/license';
agree(a: string, b: string): boolean
ParameterTypeDescription
astringThe first raw license string
bstringThe second raw license string

boolean — true when the two strings can be treated as the same license (or too vague to tell), false on a real family conflict

Two package sources reporting the same real license under different notation.

agree('GPL3', 'GPL-3.0-or-later')
// => true

Two sources genuinely disagreeing on the license family — a real data-quality signal.

agree('BSD-2-Clause', 'Apache-2.0')
// => false

When either side is non-informative (“custom”, “unknown”, …), there is nothing real to disagree with.

agree('custom', 'MIT')
// => true

View source on GitHub