UNPKG

scrabble-solver

Version:

Scrabble Solver 2 - Free, open-source, cross-platform, multi-language analysis tool for Scrabble, Scrabble Duel, Super Scrabble, Letter League, Crossplay, Literaki, and Kelimelik. Quickly find the top-scoring words using the given board and tiles.

13 lines (10 loc) 408 B
import { createComparator } from './createComparator'; export const unorderedArraysEqual = <T>(a: T[], b: T[], locale: string): boolean => { if (a.length !== b.length) { return false; } const comparator = createComparator(locale); const aSorted = [...a].sort(comparator); const bSorted = [...b].sort(comparator); return aSorted.every((character, index) => character === bSorted[index]); };