This repository provides the official browser language detection plugin for i18next. It implements a modular strategy pattern where each detector (cookie, querystring, localStorage, sessionStorage, navigator, htmlTag, path, subdomain, hash) is a self-contained module with a consistent interface. The main `Browser` class orchestrates detection by iterating through a configurable order of detectors, filters out XSS vectors, and optionally converts detected language codes. The code is well-structured, tested, and production-grade; the cookie detector in particular includes a robust RFC-compliant serialization function. Everything is browser-native with no heavy dependencies beyond i18next itself.
This repository is a lightweight JavaScript library that provides a feature-rich wrapper around the browser's `localStorage` and `sessionStorage` APIs. It offers a unified API for storing, retrieving, and manipulating JSON data, with support for namespacing, multiple storage areas (local, session, page, custom), and a plugin system for extensions. The core module (`src/store2.js`) implements a Store constructor that creates namespace-aware stores, with methods like `get`, `set`, `remove`, `clear`, `each`, `keys`, `transact`, and `add`. It also includes a fake storage fallback for environments where Web Storage is unavailable. The architecture is modular: the core is augmented by optional extension files (e.g., caching, array operations, event handling, cookie backing) that hook into internal methods via `store._`. The library is production-ready, with extensive unit tests and CI via Travis CI (though using Node.js 9, which is outdated). Key entry points are the `store` function and its namespace/area methods, which expose the entire API.
This repository is a JavaScript library providing a BroadcastChannel polyfill with leader election capabilities. It enables cross-tab/window/node-process communication through multiple fallback mechanisms (native BroadcastChannel, IndexedDB, localStorage, Node.js sockets, and a simulate method). The library implements leader election algorithms to coordinate multiple instances, ensuring only one acts as leader at a time. It supports diverse environments including old browsers, modern browsers, WebWorkers, Node.js, Deno, and iframes. The architecture centers around a core BroadcastChannel class with pluggable method implementations, a method chooser for fallback selection, and separate leader election utilities. Key entry points are the exported BroadcastChannel class and createLeaderElection function from src/index.js.
This repository is a front-end todo list application built with Next.js and React, demonstrating clean (hexagonal) architecture principles. The codebase is organized into domain, application, and infrastructure layers, promoting separation of concerns and testability. The domain layer contains pure use cases and interfaces, making it highly reusable. The infrastructure layer provides implementations for localStorage and in-memory storage. The application layer uses React components to interact with the domain via use cases. Despite the strong architectural foundation, the project suffers from significant technical drift due to outdated dependencies (Next.js 11, React 17, TypeScript 4.4, etc.), indicating a lack of recent maintenance.