the-orangee-dictionary
TypeScript icon, indicating that this package has built-in type declarations

1.0.4 • Public • Published

The Orangee Dictionary

npm version License

Description

The Orangee Dictionary is a JavaScript package designed to streamline word-related functionalities for games developed by The Orangee Games Studio. In the world of gaming, where crosswords, spelling bees, and word puzzles are prevalent, this library aims to prevent code duplication by providing a set of convenient functions.

Installation

npm install the-orangee-dictionary

Usage

import { checkWord, getDictionary, getLanguages, getWord } from "the-orangee-dictionary";
import { Language } from "the-orangee-dictionary/types/global";

// Example usage
const result = checkWord("test", "en-US");
console.log(result); // Should output true

Functions

checkWord(word: string, language: Language): boolean

Check if a word exists in the specified language dictionary.

getDictionary(language: Language): Dictionary | Error

Get the dictionary for a specific language. Returns an error if the language is not supported.

getLanguages(): Language[]

Get the list of supported languages.

getWord(word: string, language: Language): Word | undefined

Get the details of a word in the specified language dictionary. Returns undefined if the word is not found.

Tests

This package uses Jest for unit testing. To run the tests, use the following command:

npm test

License This project is licensed under the MIT License - see the LICENSE file for details.

Readme

Keywords

none

Package Sidebar

Install

npm i the-orangee-dictionary

Weekly Downloads

1

Version

1.0.4

License

MIT

Unpacked Size

5.34 MB

Total Files

21

Last publish

Collaborators

  • reehlittle