mirror of
https://github.com/garraflavatra/alphabets.git
synced 2025-01-18 13:17:59 +00:00
Alphabets 2.0.0
This commit is contained in:
parent
0419039306
commit
20edb694a9
38
.github/ISSUE_TEMPLATE/bug_report.md
vendored
38
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@ -1,38 +0,0 @@
|
|||||||
---
|
|
||||||
name: Bug report
|
|
||||||
about: Create a report to help us improve
|
|
||||||
title: ''
|
|
||||||
labels: ''
|
|
||||||
assignees: ''
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
**Describe the bug**
|
|
||||||
A clear and concise description of what the bug is.
|
|
||||||
|
|
||||||
**To Reproduce**
|
|
||||||
Steps to reproduce the behavior:
|
|
||||||
1. Go to '...'
|
|
||||||
2. Click on '....'
|
|
||||||
3. Scroll down to '....'
|
|
||||||
4. See error
|
|
||||||
|
|
||||||
**Expected behavior**
|
|
||||||
A clear and concise description of what you expected to happen.
|
|
||||||
|
|
||||||
**Screenshots**
|
|
||||||
If applicable, add screenshots to help explain your problem.
|
|
||||||
|
|
||||||
**Desktop (please complete the following information):**
|
|
||||||
- OS: [e.g. iOS]
|
|
||||||
- Browser [e.g. chrome, safari]
|
|
||||||
- Version [e.g. 22]
|
|
||||||
|
|
||||||
**Smartphone (please complete the following information):**
|
|
||||||
- Device: [e.g. iPhone6]
|
|
||||||
- OS: [e.g. iOS8.1]
|
|
||||||
- Browser [e.g. stock browser, safari]
|
|
||||||
- Version [e.g. 22]
|
|
||||||
|
|
||||||
**Additional context**
|
|
||||||
Add any other context about the problem here.
|
|
20
.github/ISSUE_TEMPLATE/feature_request.md
vendored
20
.github/ISSUE_TEMPLATE/feature_request.md
vendored
@ -1,20 +0,0 @@
|
|||||||
---
|
|
||||||
name: Feature request
|
|
||||||
about: Suggest an idea for this project
|
|
||||||
title: ''
|
|
||||||
labels: ''
|
|
||||||
assignees: ''
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
**Is your feature request related to a problem? Please describe.**
|
|
||||||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
|
||||||
|
|
||||||
**Describe the solution you'd like**
|
|
||||||
A clear and concise description of what you want to happen.
|
|
||||||
|
|
||||||
**Describe alternatives you've considered**
|
|
||||||
A clear and concise description of any alternative solutions or features you've considered.
|
|
||||||
|
|
||||||
**Additional context**
|
|
||||||
Add any other context or screenshots about the feature request here.
|
|
11
.github/dependabot.disable.yml
vendored
11
.github/dependabot.disable.yml
vendored
@ -1,11 +0,0 @@
|
|||||||
# To get started with Dependabot version updates, you'll need to specify which
|
|
||||||
# package ecosystems to update and where the package manifests are located.
|
|
||||||
# Please see the documentation for all configuration options:
|
|
||||||
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
|
|
||||||
|
|
||||||
version: 2
|
|
||||||
updates:
|
|
||||||
- package-ecosystem: "npm" # See documentation for possible values
|
|
||||||
directory: "/" # Location of package manifests
|
|
||||||
schedule:
|
|
||||||
interval: "daily"
|
|
31
.github/workflows/ci.yml
vendored
31
.github/workflows/ci.yml
vendored
@ -1,31 +0,0 @@
|
|||||||
name: Build and test
|
|
||||||
|
|
||||||
on: [ push, pull_request ]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
node-version: [10.x, 12.x, 14.x, 15.x, 16.x]
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
|
|
||||||
- name: Use Node.js ${{ matrix.node-version }}
|
|
||||||
uses: actions/setup-node@v2
|
|
||||||
with:
|
|
||||||
node-version: ${{ matrix.node-version }}
|
|
||||||
|
|
||||||
- run: npm install
|
|
||||||
|
|
||||||
- run: npm run build
|
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v2
|
|
||||||
with:
|
|
||||||
name: build
|
|
||||||
path: dist/
|
|
||||||
|
|
||||||
- run: npm run test
|
|
71
.github/workflows/codeql-analysis.yml
vendored
71
.github/workflows/codeql-analysis.yml
vendored
@ -1,71 +0,0 @@
|
|||||||
# For most projects, this workflow file will not need changing; you simply need
|
|
||||||
# to commit it to your repository.
|
|
||||||
#
|
|
||||||
# You may wish to alter this file to override the set of languages analyzed,
|
|
||||||
# or to provide custom queries or build logic.
|
|
||||||
#
|
|
||||||
# ******** NOTE ********
|
|
||||||
# We have attempted to detect the languages in your repository. Please check
|
|
||||||
# the `language` matrix defined below to confirm you have the correct set of
|
|
||||||
# supported CodeQL languages.
|
|
||||||
#
|
|
||||||
name: "CodeQL"
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [ main ]
|
|
||||||
pull_request:
|
|
||||||
# The branches below must be a subset of the branches above
|
|
||||||
branches: [ main ]
|
|
||||||
schedule:
|
|
||||||
- cron: '39 0 * * 2'
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
analyze:
|
|
||||||
name: Analyze
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
permissions:
|
|
||||||
actions: read
|
|
||||||
contents: read
|
|
||||||
security-events: write
|
|
||||||
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
language: [ 'javascript' ]
|
|
||||||
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
|
|
||||||
# Learn more:
|
|
||||||
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout repository
|
|
||||||
uses: actions/checkout@v2
|
|
||||||
|
|
||||||
# Initializes the CodeQL tools for scanning.
|
|
||||||
- name: Initialize CodeQL
|
|
||||||
uses: github/codeql-action/init@v1
|
|
||||||
with:
|
|
||||||
languages: ${{ matrix.language }}
|
|
||||||
# If you wish to specify custom queries, you can do so here or in a config file.
|
|
||||||
# By default, queries listed here will override any specified in a config file.
|
|
||||||
# Prefix the list here with "+" to use these queries and those in the config file.
|
|
||||||
# queries: ./path/to/local/query, your-org/your-repo/queries@main
|
|
||||||
|
|
||||||
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
|
|
||||||
# If this step fails, then you should remove it and run the build manually (see below)
|
|
||||||
- name: Autobuild
|
|
||||||
uses: github/codeql-action/autobuild@v1
|
|
||||||
|
|
||||||
# ℹ️ Command-line programs to run using the OS shell.
|
|
||||||
# 📚 https://git.io/JvXDl
|
|
||||||
|
|
||||||
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
|
|
||||||
# and modify them (or add more) to build your code if your project
|
|
||||||
# uses a compiled language
|
|
||||||
|
|
||||||
#- run: |
|
|
||||||
# make bootstrap
|
|
||||||
# make release
|
|
||||||
|
|
||||||
- name: Perform CodeQL Analysis
|
|
||||||
uses: github/codeql-action/analyze@v1
|
|
@ -1,3 +0,0 @@
|
|||||||
.DS_Store
|
|
||||||
.husky
|
|
||||||
node_modules
|
|
@ -1,128 +0,0 @@
|
|||||||
# Contributor Covenant Code of Conduct
|
|
||||||
|
|
||||||
## Our Pledge
|
|
||||||
|
|
||||||
We as members, contributors, and leaders pledge to make participation in our
|
|
||||||
community a harassment-free experience for everyone, regardless of age, body
|
|
||||||
size, visible or invisible disability, ethnicity, sex characteristics, gender
|
|
||||||
identity and expression, level of experience, education, socio-economic status,
|
|
||||||
nationality, personal appearance, race, religion, or sexual identity
|
|
||||||
and orientation.
|
|
||||||
|
|
||||||
We pledge to act and interact in ways that contribute to an open, welcoming,
|
|
||||||
diverse, inclusive, and healthy community.
|
|
||||||
|
|
||||||
## Our Standards
|
|
||||||
|
|
||||||
Examples of behavior that contributes to a positive environment for our
|
|
||||||
community include:
|
|
||||||
|
|
||||||
* Demonstrating empathy and kindness toward other people
|
|
||||||
* Being respectful of differing opinions, viewpoints, and experiences
|
|
||||||
* Giving and gracefully accepting constructive feedback
|
|
||||||
* Accepting responsibility and apologizing to those affected by our mistakes,
|
|
||||||
and learning from the experience
|
|
||||||
* Focusing on what is best not just for us as individuals, but for the
|
|
||||||
overall community
|
|
||||||
|
|
||||||
Examples of unacceptable behavior include:
|
|
||||||
|
|
||||||
* The use of sexualized language or imagery, and sexual attention or
|
|
||||||
advances of any kind
|
|
||||||
* Trolling, insulting or derogatory comments, and personal or political attacks
|
|
||||||
* Public or private harassment
|
|
||||||
* Publishing others' private information, such as a physical or email
|
|
||||||
address, without their explicit permission
|
|
||||||
* Other conduct which could reasonably be considered inappropriate in a
|
|
||||||
professional setting
|
|
||||||
|
|
||||||
## Enforcement Responsibilities
|
|
||||||
|
|
||||||
Community leaders are responsible for clarifying and enforcing our standards of
|
|
||||||
acceptable behavior and will take appropriate and fair corrective action in
|
|
||||||
response to any behavior that they deem inappropriate, threatening, offensive,
|
|
||||||
or harmful.
|
|
||||||
|
|
||||||
Community leaders have the right and responsibility to remove, edit, or reject
|
|
||||||
comments, commits, code, wiki edits, issues, and other contributions that are
|
|
||||||
not aligned to this Code of Conduct, and will communicate reasons for moderation
|
|
||||||
decisions when appropriate.
|
|
||||||
|
|
||||||
## Scope
|
|
||||||
|
|
||||||
This Code of Conduct applies within all community spaces, and also applies when
|
|
||||||
an individual is officially representing the community in public spaces.
|
|
||||||
Examples of representing our community include using an official e-mail address,
|
|
||||||
posting via an official social media account, or acting as an appointed
|
|
||||||
representative at an online or offline event.
|
|
||||||
|
|
||||||
## Enforcement
|
|
||||||
|
|
||||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
|
||||||
reported to the community leaders responsible for enforcement at
|
|
||||||
romein@vburen.eu.
|
|
||||||
All complaints will be reviewed and investigated promptly and fairly.
|
|
||||||
|
|
||||||
All community leaders are obligated to respect the privacy and security of the
|
|
||||||
reporter of any incident.
|
|
||||||
|
|
||||||
## Enforcement Guidelines
|
|
||||||
|
|
||||||
Community leaders will follow these Community Impact Guidelines in determining
|
|
||||||
the consequences for any action they deem in violation of this Code of Conduct:
|
|
||||||
|
|
||||||
### 1. Correction
|
|
||||||
|
|
||||||
**Community Impact**: Use of inappropriate language or other behavior deemed
|
|
||||||
unprofessional or unwelcome in the community.
|
|
||||||
|
|
||||||
**Consequence**: A private, written warning from community leaders, providing
|
|
||||||
clarity around the nature of the violation and an explanation of why the
|
|
||||||
behavior was inappropriate. A public apology may be requested.
|
|
||||||
|
|
||||||
### 2. Warning
|
|
||||||
|
|
||||||
**Community Impact**: A violation through a single incident or series
|
|
||||||
of actions.
|
|
||||||
|
|
||||||
**Consequence**: A warning with consequences for continued behavior. No
|
|
||||||
interaction with the people involved, including unsolicited interaction with
|
|
||||||
those enforcing the Code of Conduct, for a specified period of time. This
|
|
||||||
includes avoiding interactions in community spaces as well as external channels
|
|
||||||
like social media. Violating these terms may lead to a temporary or
|
|
||||||
permanent ban.
|
|
||||||
|
|
||||||
### 3. Temporary Ban
|
|
||||||
|
|
||||||
**Community Impact**: A serious violation of community standards, including
|
|
||||||
sustained inappropriate behavior.
|
|
||||||
|
|
||||||
**Consequence**: A temporary ban from any sort of interaction or public
|
|
||||||
communication with the community for a specified period of time. No public or
|
|
||||||
private interaction with the people involved, including unsolicited interaction
|
|
||||||
with those enforcing the Code of Conduct, is allowed during this period.
|
|
||||||
Violating these terms may lead to a permanent ban.
|
|
||||||
|
|
||||||
### 4. Permanent Ban
|
|
||||||
|
|
||||||
**Community Impact**: Demonstrating a pattern of violation of community
|
|
||||||
standards, including sustained inappropriate behavior, harassment of an
|
|
||||||
individual, or aggression toward or disparagement of classes of individuals.
|
|
||||||
|
|
||||||
**Consequence**: A permanent ban from any sort of public interaction within
|
|
||||||
the community.
|
|
||||||
|
|
||||||
## Attribution
|
|
||||||
|
|
||||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
|
||||||
version 2.0, available at
|
|
||||||
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
|
|
||||||
|
|
||||||
Community Impact Guidelines were inspired by [Mozilla's code of conduct
|
|
||||||
enforcement ladder](https://github.com/mozilla/diversity).
|
|
||||||
|
|
||||||
[homepage]: https://www.contributor-covenant.org
|
|
||||||
|
|
||||||
For answers to common questions about this code of conduct, see the FAQ at
|
|
||||||
https://www.contributor-covenant.org/faq. Translations are available at
|
|
||||||
https://www.contributor-covenant.org/translations.
|
|
35
LICENSE.md
35
LICENSE.md
@ -1,22 +1,19 @@
|
|||||||
Copyright (c) 2021 Romein van Buren <romein@vburen.eu>
|
Copyright (c) 2021-2023 Romein van Buren
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
obtaining a copy of this software and associated documentation
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
files (the "Software"), to deal in the Software without
|
in the Software without restriction, including without limitation the rights
|
||||||
restriction, including without limitation the rights to use,
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
copies of the Software, and to permit persons to whom the
|
furnished to do so, subject to the following conditions:
|
||||||
Software is furnished to do so, subject to the following
|
|
||||||
conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be
|
The above copyright notice and this permission notice shall be included in all
|
||||||
included in all copies or substantial portions of the Software.
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
SOFTWARE.
|
||||||
OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
|
76
README.md
76
README.md
@ -1,23 +1,10 @@
|
|||||||
# Alphabets
|
# Alphabets
|
||||||
|
|
||||||
[![CI](https://github.com/garraflavatra/alphabets/actions/workflows/test.yml/badge.svg?branch=main)](https://github.com/garraflavatra/alphabets/actions/workflows/test.yml)
|
A tiny JS dependency which exports many alphabets for many use cases.
|
||||||
[![npm](https://img.shields.io/npm/v/alphabets)](https://www.npmjs.com/package/alphabets)
|
|
||||||
[![npm bundle size](https://img.shields.io/bundlephobia/min/alphabets)](https://www.npmjs.com/package/alphabets)
|
|
||||||
[![GitHub last commit](https://img.shields.io/github/last-commit/garraflavatra/alphabets)](https://github.com/garraflavatra/alphabets)
|
|
||||||
[![Forum](https://img.shields.io/badge/-forum-blue)](https://github.com/garraflavatra/alphabets)
|
|
||||||
|
|
||||||
|
## Why
|
||||||
|
|
||||||
A tiny JS dependency (<2kb!) which exports many alphabets for many use
|
I have seen code like this:
|
||||||
cases.
|
|
||||||
|
|
||||||
More information is available in the
|
|
||||||
[documentation](https://projects.romeinvanburen.nl/alphabets/).
|
|
||||||
|
|
||||||
## Why would I use this?
|
|
||||||
|
|
||||||
### Why?
|
|
||||||
|
|
||||||
I have seen developers doing this:
|
|
||||||
|
|
||||||
```js
|
```js
|
||||||
const alphabet = 'abcdefghijklmnopqrstuvwxyz'.split('');
|
const alphabet = 'abcdefghijklmnopqrstuvwxyz'.split('');
|
||||||
@ -29,39 +16,41 @@ Or worse:
|
|||||||
const alphabet = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"];
|
const alphabet = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"];
|
||||||
```
|
```
|
||||||
|
|
||||||
My opinion about this? 🙄. It's ugly, it makes your code less readable
|
My opinion about this: it's ugly, and it pollutes your code. Instead, you should do it like so:
|
||||||
(read: ugly) and it's simply not something you should want to have in your
|
|
||||||
code! Instead, you should do it like so:
|
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import { latin } from 'alphabets';
|
import { latin } from 'alphabets';
|
||||||
// or
|
// or
|
||||||
const alphabets = require('alphabets');
|
const alphabets = require('alphabets');
|
||||||
|
|
||||||
|
doSomethingWithTheAlphabet(latin);
|
||||||
```
|
```
|
||||||
|
|
||||||
Much cleaner, right? That's why I made this package.
|
Much cleaner, right?
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
Use npm:
|
Use npm: [`npm i alphabets`](https://www.npmjs.com/package/alphabets). Or if you prefer Yarn: `yarn add alphabets`.
|
||||||
|
|
||||||
```bash
|
## Supported alphabets
|
||||||
npm install alphabets --save
|
|
||||||
```
|
|
||||||
|
|
||||||
Or if you prefer Yarn:
|
See below for usage instructions.
|
||||||
|
|
||||||
```bash
|
| Alphabet | Export name |
|
||||||
yarn add alphabets
|
|------|-------------|
|
||||||
```
|
| Danish | `danish` |
|
||||||
|
| Faroese | `faroese` |
|
||||||
|
| Greek (modern) | `greek` |
|
||||||
|
| Greek (ancient/polytonic) | `greekPolytonic` |
|
||||||
|
| Icelandic | `icelandic` |
|
||||||
|
| Latin (abcdefg etc.) | `latin` |
|
||||||
|
| Norwegian | `norwegian` |
|
||||||
|
| Russian | `russian` |
|
||||||
|
| Swedish | `swedish` |
|
||||||
|
|
||||||
CDN, if that's more your style:
|
## How to use
|
||||||
|
|
||||||
```html
|
Replace `<alphabetYouWantToUse>` with an alphabet identifier this package supports:
|
||||||
<script src="https://unpkg.com/alphabets@1/dist/bundle.js"></script>
|
|
||||||
```
|
|
||||||
|
|
||||||
## Usage
|
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import { <alphabetYouWantToUse> } from 'alphabets';
|
import { <alphabetYouWantToUse> } from 'alphabets';
|
||||||
@ -74,21 +63,8 @@ const alphabets = require('alphabets');
|
|||||||
console.log(alphabets.<alphabetYouWantToUse>);
|
console.log(alphabets.<alphabetYouWantToUse>);
|
||||||
```
|
```
|
||||||
|
|
||||||
where `<alphabetYouWantToUse>` is an alphabet this package supports.
|
## Copyright
|
||||||
[Here](#supported-alphabets) is a list from which you can choose.
|
|
||||||
|
|
||||||
## Supported alphabets
|
(c) 2021-2023 Romein van Buren. Licensed under the MIT license.
|
||||||
|
|
||||||
Usage: see [Usage](#usage).
|
For the full copyright and license information, please view the [`license.md`](./license.md) file that was distributed with this source code.
|
||||||
|
|
||||||
| Name | Export name |
|
|
||||||
|------|-------------|
|
|
||||||
| Danish | `danish` |
|
|
||||||
| Faroese | `faroese` |
|
|
||||||
| Greek (modern) | `greek` |
|
|
||||||
| Greek (ancient/polytonic) | `greekPolytonic` |
|
|
||||||
| Icelandic | `icelandic` |
|
|
||||||
| Latin | `latin` |
|
|
||||||
| Norwegian | `norwegian` |
|
|
||||||
| Russian | `russian` |
|
|
||||||
| Swedish | `swedish` |
|
|
||||||
|
1
alphabets.cjs
Normal file
1
alphabets.cjs
Normal file
@ -0,0 +1 @@
|
|||||||
|
module.exports = require('./alphabets.json');
|
23
alphabets.json
Normal file
23
alphabets.json
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
{
|
||||||
|
|
||||||
|
"danish": ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "æ", "ø", "å"],
|
||||||
|
|
||||||
|
"elfadian": ["a", "ą", "b", "d", "ð", "e", "ę", "f", "g", "h", "i", "į", "j", "k", "l", "m", "n", "o", "p", "r", "s", "t", "u", "ų", "v", "w", "y", "y̨", "å", "ą̊", "ä", "ö"],
|
||||||
|
|
||||||
|
"faroese": ["a", "á", "b", "d", "ð", "e", "f", "g", "h", "i", "í", "j", "k", "l", "m", "n", "o", "ó", "p", "r", "s", "t", "u", "ú", "v", "y", "ý", "æ", "ø"],
|
||||||
|
|
||||||
|
"greek": ["α", "β", "γ", "δ", "ε", "ζ", "η", "θ", "ι", "κ", "λ", "μ", "ν", "ξ", "ο", "π", "ρ", "σ", "τ", "υ", "φ", "χ", "ψ", "ω"],
|
||||||
|
|
||||||
|
"greekPolytonic": ["α", "β", "γ", "δ", "ε", "ζ", "η", "θ", "ι", "κ", "λ", "μ", "ν", "ξ", "ο", "π", "ρ", "σ", "τ", "υ", "φ", "χ", "ψ", "ω"],
|
||||||
|
|
||||||
|
"icelandic": ["a", "á", "b", "d", "ð", "e", "é", "f", "g", "h", "i", "í", "j", "k", "l", "m", "n", "o", "ó", "p", "r", "s", "t", "u", "ú", "v", "x", "y", "ý", "þ", "æ", "ö"],
|
||||||
|
|
||||||
|
"latin": ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"],
|
||||||
|
|
||||||
|
"norwegian": ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "æ", "ø", "å"],
|
||||||
|
|
||||||
|
"russian": ["а", "б", "в", "г", "д", "е", "ё", "ж", "з", "и", "й", "к", "л", "м", "н", "о", "п", "р", "с", "т", "у", "ф", "х", "ц", "ч", "ш", "щ", "ъ", "ы", "ь", "э", "ю", "я"],
|
||||||
|
|
||||||
|
"swedish": ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "å", "ä", "ö"]
|
||||||
|
|
||||||
|
}
|
1
alphabets.mjs
Normal file
1
alphabets.mjs
Normal file
@ -0,0 +1 @@
|
|||||||
|
export * from "./alphabets.json";
|
4
docs/.gitignore
vendored
4
docs/.gitignore
vendored
@ -1,4 +0,0 @@
|
|||||||
_site/
|
|
||||||
.sass-cache/
|
|
||||||
.jekyll-cache/
|
|
||||||
.jekyll-metadata
|
|
@ -1,4 +0,0 @@
|
|||||||
source "https://rubygems.org"
|
|
||||||
|
|
||||||
gem "github-pages", group: :jekyll_plugins
|
|
||||||
gem "jekyll-include-cache", group: :jekyll_plugins
|
|
@ -1,279 +0,0 @@
|
|||||||
GEM
|
|
||||||
remote: https://rubygems.org/
|
|
||||||
specs:
|
|
||||||
activesupport (6.0.3.7)
|
|
||||||
concurrent-ruby (~> 1.0, >= 1.0.2)
|
|
||||||
i18n (>= 0.7, < 2)
|
|
||||||
minitest (~> 5.1)
|
|
||||||
tzinfo (~> 1.1)
|
|
||||||
zeitwerk (~> 2.2, >= 2.2.2)
|
|
||||||
addressable (2.8.0)
|
|
||||||
public_suffix (>= 2.0.2, < 5.0)
|
|
||||||
coffee-script (2.4.1)
|
|
||||||
coffee-script-source
|
|
||||||
execjs
|
|
||||||
coffee-script-source (1.11.1)
|
|
||||||
colorator (1.1.0)
|
|
||||||
commonmarker (0.17.13)
|
|
||||||
ruby-enum (~> 0.5)
|
|
||||||
concurrent-ruby (1.1.8)
|
|
||||||
dnsruby (1.61.5)
|
|
||||||
simpleidn (~> 0.1)
|
|
||||||
em-websocket (0.5.2)
|
|
||||||
eventmachine (>= 0.12.9)
|
|
||||||
http_parser.rb (~> 0.6.0)
|
|
||||||
ethon (0.14.0)
|
|
||||||
ffi (>= 1.15.0)
|
|
||||||
eventmachine (1.2.7)
|
|
||||||
execjs (2.8.1)
|
|
||||||
faraday (1.4.2)
|
|
||||||
faraday-em_http (~> 1.0)
|
|
||||||
faraday-em_synchrony (~> 1.0)
|
|
||||||
faraday-excon (~> 1.1)
|
|
||||||
faraday-net_http (~> 1.0)
|
|
||||||
faraday-net_http_persistent (~> 1.1)
|
|
||||||
multipart-post (>= 1.2, < 3)
|
|
||||||
ruby2_keywords (>= 0.0.4)
|
|
||||||
faraday-em_http (1.0.0)
|
|
||||||
faraday-em_synchrony (1.0.0)
|
|
||||||
faraday-excon (1.1.0)
|
|
||||||
faraday-net_http (1.0.1)
|
|
||||||
faraday-net_http_persistent (1.1.0)
|
|
||||||
ffi (1.15.1)
|
|
||||||
forwardable-extended (2.6.0)
|
|
||||||
gemoji (3.0.1)
|
|
||||||
github-pages (214)
|
|
||||||
github-pages-health-check (= 1.17.0)
|
|
||||||
jekyll (= 3.9.0)
|
|
||||||
jekyll-avatar (= 0.7.0)
|
|
||||||
jekyll-coffeescript (= 1.1.1)
|
|
||||||
jekyll-commonmark-ghpages (= 0.1.6)
|
|
||||||
jekyll-default-layout (= 0.1.4)
|
|
||||||
jekyll-feed (= 0.15.1)
|
|
||||||
jekyll-gist (= 1.5.0)
|
|
||||||
jekyll-github-metadata (= 2.13.0)
|
|
||||||
jekyll-mentions (= 1.6.0)
|
|
||||||
jekyll-optional-front-matter (= 0.3.2)
|
|
||||||
jekyll-paginate (= 1.1.0)
|
|
||||||
jekyll-readme-index (= 0.3.0)
|
|
||||||
jekyll-redirect-from (= 0.16.0)
|
|
||||||
jekyll-relative-links (= 0.6.1)
|
|
||||||
jekyll-remote-theme (= 0.4.3)
|
|
||||||
jekyll-sass-converter (= 1.5.2)
|
|
||||||
jekyll-seo-tag (= 2.7.1)
|
|
||||||
jekyll-sitemap (= 1.4.0)
|
|
||||||
jekyll-swiss (= 1.0.0)
|
|
||||||
jekyll-theme-architect (= 0.1.1)
|
|
||||||
jekyll-theme-cayman (= 0.1.1)
|
|
||||||
jekyll-theme-dinky (= 0.1.1)
|
|
||||||
jekyll-theme-hacker (= 0.1.2)
|
|
||||||
jekyll-theme-leap-day (= 0.1.1)
|
|
||||||
jekyll-theme-merlot (= 0.1.1)
|
|
||||||
jekyll-theme-midnight (= 0.1.1)
|
|
||||||
jekyll-theme-minimal (= 0.1.1)
|
|
||||||
jekyll-theme-modernist (= 0.1.1)
|
|
||||||
jekyll-theme-primer (= 0.5.4)
|
|
||||||
jekyll-theme-slate (= 0.1.1)
|
|
||||||
jekyll-theme-tactile (= 0.1.1)
|
|
||||||
jekyll-theme-time-machine (= 0.1.1)
|
|
||||||
jekyll-titles-from-headings (= 0.5.3)
|
|
||||||
jemoji (= 0.12.0)
|
|
||||||
kramdown (= 2.3.1)
|
|
||||||
kramdown-parser-gfm (= 1.1.0)
|
|
||||||
liquid (= 4.0.3)
|
|
||||||
mercenary (~> 0.3)
|
|
||||||
minima (= 2.5.1)
|
|
||||||
nokogiri (>= 1.10.4, < 2.0)
|
|
||||||
rouge (= 3.26.0)
|
|
||||||
terminal-table (~> 1.4)
|
|
||||||
github-pages-health-check (1.17.0)
|
|
||||||
addressable (~> 2.3)
|
|
||||||
dnsruby (~> 1.60)
|
|
||||||
octokit (~> 4.0)
|
|
||||||
public_suffix (>= 2.0.2, < 5.0)
|
|
||||||
typhoeus (~> 1.3)
|
|
||||||
html-pipeline (2.14.0)
|
|
||||||
activesupport (>= 2)
|
|
||||||
nokogiri (>= 1.4)
|
|
||||||
http_parser.rb (0.6.0)
|
|
||||||
i18n (0.9.5)
|
|
||||||
concurrent-ruby (~> 1.0)
|
|
||||||
jekyll (3.9.0)
|
|
||||||
addressable (~> 2.4)
|
|
||||||
colorator (~> 1.0)
|
|
||||||
em-websocket (~> 0.5)
|
|
||||||
i18n (~> 0.7)
|
|
||||||
jekyll-sass-converter (~> 1.0)
|
|
||||||
jekyll-watch (~> 2.0)
|
|
||||||
kramdown (>= 1.17, < 3)
|
|
||||||
liquid (~> 4.0)
|
|
||||||
mercenary (~> 0.3.3)
|
|
||||||
pathutil (~> 0.9)
|
|
||||||
rouge (>= 1.7, < 4)
|
|
||||||
safe_yaml (~> 1.0)
|
|
||||||
jekyll-avatar (0.7.0)
|
|
||||||
jekyll (>= 3.0, < 5.0)
|
|
||||||
jekyll-coffeescript (1.1.1)
|
|
||||||
coffee-script (~> 2.2)
|
|
||||||
coffee-script-source (~> 1.11.1)
|
|
||||||
jekyll-commonmark (1.3.1)
|
|
||||||
commonmarker (~> 0.14)
|
|
||||||
jekyll (>= 3.7, < 5.0)
|
|
||||||
jekyll-commonmark-ghpages (0.1.6)
|
|
||||||
commonmarker (~> 0.17.6)
|
|
||||||
jekyll-commonmark (~> 1.2)
|
|
||||||
rouge (>= 2.0, < 4.0)
|
|
||||||
jekyll-default-layout (0.1.4)
|
|
||||||
jekyll (~> 3.0)
|
|
||||||
jekyll-feed (0.15.1)
|
|
||||||
jekyll (>= 3.7, < 5.0)
|
|
||||||
jekyll-gist (1.5.0)
|
|
||||||
octokit (~> 4.2)
|
|
||||||
jekyll-github-metadata (2.13.0)
|
|
||||||
jekyll (>= 3.4, < 5.0)
|
|
||||||
octokit (~> 4.0, != 4.4.0)
|
|
||||||
jekyll-include-cache (0.2.1)
|
|
||||||
jekyll (>= 3.7, < 5.0)
|
|
||||||
jekyll-mentions (1.6.0)
|
|
||||||
html-pipeline (~> 2.3)
|
|
||||||
jekyll (>= 3.7, < 5.0)
|
|
||||||
jekyll-optional-front-matter (0.3.2)
|
|
||||||
jekyll (>= 3.0, < 5.0)
|
|
||||||
jekyll-paginate (1.1.0)
|
|
||||||
jekyll-readme-index (0.3.0)
|
|
||||||
jekyll (>= 3.0, < 5.0)
|
|
||||||
jekyll-redirect-from (0.16.0)
|
|
||||||
jekyll (>= 3.3, < 5.0)
|
|
||||||
jekyll-relative-links (0.6.1)
|
|
||||||
jekyll (>= 3.3, < 5.0)
|
|
||||||
jekyll-remote-theme (0.4.3)
|
|
||||||
addressable (~> 2.0)
|
|
||||||
jekyll (>= 3.5, < 5.0)
|
|
||||||
jekyll-sass-converter (>= 1.0, <= 3.0.0, != 2.0.0)
|
|
||||||
rubyzip (>= 1.3.0, < 3.0)
|
|
||||||
jekyll-sass-converter (1.5.2)
|
|
||||||
sass (~> 3.4)
|
|
||||||
jekyll-seo-tag (2.7.1)
|
|
||||||
jekyll (>= 3.8, < 5.0)
|
|
||||||
jekyll-sitemap (1.4.0)
|
|
||||||
jekyll (>= 3.7, < 5.0)
|
|
||||||
jekyll-swiss (1.0.0)
|
|
||||||
jekyll-theme-architect (0.1.1)
|
|
||||||
jekyll (~> 3.5)
|
|
||||||
jekyll-seo-tag (~> 2.0)
|
|
||||||
jekyll-theme-cayman (0.1.1)
|
|
||||||
jekyll (~> 3.5)
|
|
||||||
jekyll-seo-tag (~> 2.0)
|
|
||||||
jekyll-theme-dinky (0.1.1)
|
|
||||||
jekyll (~> 3.5)
|
|
||||||
jekyll-seo-tag (~> 2.0)
|
|
||||||
jekyll-theme-hacker (0.1.2)
|
|
||||||
jekyll (> 3.5, < 5.0)
|
|
||||||
jekyll-seo-tag (~> 2.0)
|
|
||||||
jekyll-theme-leap-day (0.1.1)
|
|
||||||
jekyll (~> 3.5)
|
|
||||||
jekyll-seo-tag (~> 2.0)
|
|
||||||
jekyll-theme-merlot (0.1.1)
|
|
||||||
jekyll (~> 3.5)
|
|
||||||
jekyll-seo-tag (~> 2.0)
|
|
||||||
jekyll-theme-midnight (0.1.1)
|
|
||||||
jekyll (~> 3.5)
|
|
||||||
jekyll-seo-tag (~> 2.0)
|
|
||||||
jekyll-theme-minimal (0.1.1)
|
|
||||||
jekyll (~> 3.5)
|
|
||||||
jekyll-seo-tag (~> 2.0)
|
|
||||||
jekyll-theme-modernist (0.1.1)
|
|
||||||
jekyll (~> 3.5)
|
|
||||||
jekyll-seo-tag (~> 2.0)
|
|
||||||
jekyll-theme-primer (0.5.4)
|
|
||||||
jekyll (> 3.5, < 5.0)
|
|
||||||
jekyll-github-metadata (~> 2.9)
|
|
||||||
jekyll-seo-tag (~> 2.0)
|
|
||||||
jekyll-theme-slate (0.1.1)
|
|
||||||
jekyll (~> 3.5)
|
|
||||||
jekyll-seo-tag (~> 2.0)
|
|
||||||
jekyll-theme-tactile (0.1.1)
|
|
||||||
jekyll (~> 3.5)
|
|
||||||
jekyll-seo-tag (~> 2.0)
|
|
||||||
jekyll-theme-time-machine (0.1.1)
|
|
||||||
jekyll (~> 3.5)
|
|
||||||
jekyll-seo-tag (~> 2.0)
|
|
||||||
jekyll-titles-from-headings (0.5.3)
|
|
||||||
jekyll (>= 3.3, < 5.0)
|
|
||||||
jekyll-watch (2.2.1)
|
|
||||||
listen (~> 3.0)
|
|
||||||
jemoji (0.12.0)
|
|
||||||
gemoji (~> 3.0)
|
|
||||||
html-pipeline (~> 2.2)
|
|
||||||
jekyll (>= 3.0, < 5.0)
|
|
||||||
kramdown (2.3.1)
|
|
||||||
rexml
|
|
||||||
kramdown-parser-gfm (1.1.0)
|
|
||||||
kramdown (~> 2.0)
|
|
||||||
liquid (4.0.3)
|
|
||||||
listen (3.5.1)
|
|
||||||
rb-fsevent (~> 0.10, >= 0.10.3)
|
|
||||||
rb-inotify (~> 0.9, >= 0.9.10)
|
|
||||||
mercenary (0.3.6)
|
|
||||||
minima (2.5.1)
|
|
||||||
jekyll (>= 3.5, < 5.0)
|
|
||||||
jekyll-feed (~> 0.9)
|
|
||||||
jekyll-seo-tag (~> 2.1)
|
|
||||||
minitest (5.14.4)
|
|
||||||
multipart-post (2.1.1)
|
|
||||||
nokogiri (1.13.9-arm64-darwin)
|
|
||||||
racc (~> 1.4)
|
|
||||||
nokogiri (1.13.9-x86_64-darwin)
|
|
||||||
racc (~> 1.4)
|
|
||||||
nokogiri (1.13.9-x86_64-linux)
|
|
||||||
racc (~> 1.4)
|
|
||||||
octokit (4.21.0)
|
|
||||||
faraday (>= 0.9)
|
|
||||||
sawyer (~> 0.8.0, >= 0.5.3)
|
|
||||||
pathutil (0.16.2)
|
|
||||||
forwardable-extended (~> 2.6)
|
|
||||||
public_suffix (4.0.6)
|
|
||||||
racc (1.6.0)
|
|
||||||
rb-fsevent (0.11.0)
|
|
||||||
rb-inotify (0.10.1)
|
|
||||||
ffi (~> 1.0)
|
|
||||||
rexml (3.2.5)
|
|
||||||
rouge (3.26.0)
|
|
||||||
ruby-enum (0.9.0)
|
|
||||||
i18n
|
|
||||||
ruby2_keywords (0.0.4)
|
|
||||||
rubyzip (2.3.0)
|
|
||||||
safe_yaml (1.0.5)
|
|
||||||
sass (3.7.4)
|
|
||||||
sass-listen (~> 4.0.0)
|
|
||||||
sass-listen (4.0.0)
|
|
||||||
rb-fsevent (~> 0.9, >= 0.9.4)
|
|
||||||
rb-inotify (~> 0.9, >= 0.9.7)
|
|
||||||
sawyer (0.8.2)
|
|
||||||
addressable (>= 2.3.5)
|
|
||||||
faraday (> 0.8, < 2.0)
|
|
||||||
simpleidn (0.2.1)
|
|
||||||
unf (~> 0.1.4)
|
|
||||||
terminal-table (1.8.0)
|
|
||||||
unicode-display_width (~> 1.1, >= 1.1.1)
|
|
||||||
thread_safe (0.3.6)
|
|
||||||
typhoeus (1.4.0)
|
|
||||||
ethon (>= 0.9.0)
|
|
||||||
tzinfo (1.2.9)
|
|
||||||
thread_safe (~> 0.1)
|
|
||||||
unf (0.1.4)
|
|
||||||
unf_ext
|
|
||||||
unf_ext (0.0.7.7)
|
|
||||||
unicode-display_width (1.7.0)
|
|
||||||
zeitwerk (2.4.2)
|
|
||||||
|
|
||||||
PLATFORMS
|
|
||||||
universal-darwin-20
|
|
||||||
x86_64-linux
|
|
||||||
|
|
||||||
DEPENDENCIES
|
|
||||||
github-pages
|
|
||||||
jekyll-include-cache
|
|
||||||
|
|
||||||
BUNDLED WITH
|
|
||||||
2.2.17
|
|
@ -1,40 +0,0 @@
|
|||||||
remote_theme: "mmistakes/minimal-mistakes@4.9.0"
|
|
||||||
minimal_mistakes_skin: air
|
|
||||||
repository: garraflavatra/alphabets
|
|
||||||
|
|
||||||
title: Alphabets
|
|
||||||
description: A tiny JS dependency (<800 bytes!) which exports many alphabets for many use cases.
|
|
||||||
|
|
||||||
author:
|
|
||||||
name: "garraflavatra"
|
|
||||||
avatar: "https://avatars.githubusercontent.com/u/34036573"
|
|
||||||
email: "romein@vburen.eu"
|
|
||||||
links:
|
|
||||||
- label: "Email"
|
|
||||||
icon: "fas fa-fw fa-envelope-square"
|
|
||||||
url: "mailto:romein@vburen.eu"
|
|
||||||
- label: "Website"
|
|
||||||
icon: "fas fa-fw fa-link"
|
|
||||||
url: "https://garraflavatra.github.io"
|
|
||||||
- label: "GitHub"
|
|
||||||
icon: "fab fa-fw fa-github"
|
|
||||||
url: "https://github.com/garraflavatra/alphabet.js"
|
|
||||||
|
|
||||||
plugins:
|
|
||||||
- jekyll-include-cache
|
|
||||||
|
|
||||||
footer:
|
|
||||||
links:
|
|
||||||
- label: "GitHub"
|
|
||||||
icon: "fab fa-fw fa-github"
|
|
||||||
url: "https://github.com/garraflavatra/alphabet.js"
|
|
||||||
|
|
||||||
defaults:
|
|
||||||
- scope:
|
|
||||||
path: ""
|
|
||||||
values:
|
|
||||||
layout: single
|
|
||||||
toc: true
|
|
||||||
sidebar:
|
|
||||||
nav: "docs"
|
|
||||||
|
|
@ -1,25 +0,0 @@
|
|||||||
main:
|
|
||||||
- title: "Forums"
|
|
||||||
url: https://github.com/garraflavatra/alphabets/discussions
|
|
||||||
- title: "GitHub"
|
|
||||||
url: https://github.com/garraflavatra/alphabets
|
|
||||||
|
|
||||||
docs:
|
|
||||||
- title: About
|
|
||||||
children:
|
|
||||||
- title: Why would I use this?
|
|
||||||
url: /about/why
|
|
||||||
- title: Alternatives
|
|
||||||
url: /about/alternatives
|
|
||||||
- title: Usage
|
|
||||||
children:
|
|
||||||
- title: Installation
|
|
||||||
url: /usage/installation
|
|
||||||
- title: Usage
|
|
||||||
url: /usage/usage
|
|
||||||
- title: Advanced
|
|
||||||
url: /usage/advanced
|
|
||||||
- title: API
|
|
||||||
children:
|
|
||||||
- title: Supported alphabets
|
|
||||||
url: /api/supported-alphabets
|
|
@ -1,29 +0,0 @@
|
|||||||
---
|
|
||||||
title: Alternatives to Alphabets
|
|
||||||
---
|
|
||||||
|
|
||||||
Know more alternatives? Please open an
|
|
||||||
[issue](https://github.com/garraflavatra/alphabet.js/issues/new) or
|
|
||||||
[pull request](https://github.com/garraflavatra/alphabet.js)!
|
|
||||||
{: .notice--info}
|
|
||||||
|
|
||||||
## [alphabet](https://www.npmjs.com/package/alphabet)
|
|
||||||
|
|
||||||
(whithout trailing `s`)
|
|
||||||
|
|
||||||
I do not say this package doesn't work. I think it will work perfectly, but it
|
|
||||||
has less features:
|
|
||||||
{: .notice--warning}
|
|
||||||
|
|
||||||
Seems a good alternative, right? But:
|
|
||||||
|
|
||||||
* It only supports the Latin alphabet.
|
|
||||||
* It is larger. (The size is equal to this package's size, but this package
|
|
||||||
includes more.)
|
|
||||||
* It is only [CommonJS](https://en.wikipedia.org/wiki/CommonJS) and not
|
|
||||||
[ECMAScript](https://en.wikipedia.org/wiki/ECMAScript) etc.
|
|
||||||
* When did the author last update it? Right.
|
|
||||||
<figure>
|
|
||||||
<img src="https://projects.romeinvanburen.nl/alphabets/images/competitors/alphabet-last-publish.png" alt="Last updated: 6 years ago">
|
|
||||||
<figcaption>Hmmm...</figcaption>
|
|
||||||
</figure>
|
|
@ -1,44 +0,0 @@
|
|||||||
---
|
|
||||||
title: Why would I use this?
|
|
||||||
---
|
|
||||||
|
|
||||||
I have seen developers doing this:
|
|
||||||
|
|
||||||
```js
|
|
||||||
const alphabet = 'abcdefghijklmnopqrstuvwxyz'.split('');
|
|
||||||
```
|
|
||||||
|
|
||||||
Or worse:
|
|
||||||
|
|
||||||
```js
|
|
||||||
const alphabet = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"];
|
|
||||||
```
|
|
||||||
|
|
||||||
My opinion about this? 🙄. It's ugly, it makes your code less readable
|
|
||||||
(read: ugly) and it's simply not something you should want to have in your
|
|
||||||
code! Instead, you should do it like so:
|
|
||||||
|
|
||||||
```js
|
|
||||||
import { latin } from 'alphabets';
|
|
||||||
// or
|
|
||||||
const alphabets = require('alphabets');
|
|
||||||
```
|
|
||||||
|
|
||||||
Much cleaner, right? That's why I made this package.
|
|
||||||
|
|
||||||
## Why not?
|
|
||||||
|
|
||||||
I see very few reasons not to use this package.
|
|
||||||
|
|
||||||
### But doesn't it cost me performance?
|
|
||||||
|
|
||||||
No. This package is only <800 bytes so it should not cost you any performance.
|
|
||||||
Neither via [CDN](/usage/installation/#cdn) nor if you use a bundler like
|
|
||||||
webpack, Parcel or Rollup.
|
|
||||||
|
|
||||||
### Why not making an array on my own?
|
|
||||||
|
|
||||||
It's a choice. This whole package is **opinionated**. *I* think you should not
|
|
||||||
do `const alphabet = 'abcdefghijklmnopqrstuvwxyz'.split('');` in your code. *I*
|
|
||||||
think you should use a package for that. Do you think it's OK to define your own
|
|
||||||
alphabet array? Do that!
|
|
@ -1,18 +0,0 @@
|
|||||||
---
|
|
||||||
title: Supported alphabets
|
|
||||||
toc: false
|
|
||||||
---
|
|
||||||
|
|
||||||
Usage: see [Usage](../usage/usage).
|
|
||||||
|
|
||||||
| Name | Export name |
|
|
||||||
|------|-------------|
|
|
||||||
| Danish | `danish` |
|
|
||||||
| Faroese | `faroese` |
|
|
||||||
| Greek (modern) | `greek` |
|
|
||||||
| Greek (ancient/polytonic) | `greekPolytonic` |
|
|
||||||
| Icelandic | `icelandic` |
|
|
||||||
| Latin | `latin` |
|
|
||||||
| Norwegian | `norwegian` |
|
|
||||||
| Russian | `russian` |
|
|
||||||
| Swedish | `swedish` |
|
|
Binary file not shown.
Before Width: | Height: | Size: 12 KiB |
@ -1,16 +0,0 @@
|
|||||||
---
|
|
||||||
title: Alphabets
|
|
||||||
toc: false
|
|
||||||
---
|
|
||||||
|
|
||||||
A tiny JS dependency (<2kb!) which exports many alphabet arrays for many use
|
|
||||||
cases.
|
|
||||||
|
|
||||||
[![CI](https://github.com/garraflavatra/alphabets/actions/workflows/test.yml/badge.svg?branch=main)](https://github.com/garraflavatra/alphabets/actions/workflows/test.yml)
|
|
||||||
[![npm](https://img.shields.io/npm/v/alphabets)](https://www.npmjs.com/package/alphabets)
|
|
||||||
[![npm bundle size](https://img.shields.io/bundlephobia/min/alphabets)](https://www.npmjs.com/package/alphabets)
|
|
||||||
[![GitHub last commit](https://img.shields.io/github/last-commit/garraflavatra/alphabets)](https://github.com/garraflavatra/alphabets)
|
|
||||||
[![Forum](https://img.shields.io/badge/-forum-blue)](https://github.com/garraflavatra/alphabets)
|
|
||||||
|
|
||||||
Are you convinced [why to use this](about/why)? Get started
|
|
||||||
[here](usage/installation)!
|
|
@ -1,17 +0,0 @@
|
|||||||
---
|
|
||||||
title: Advanced usage
|
|
||||||
---
|
|
||||||
|
|
||||||
## Alphabet as a string
|
|
||||||
|
|
||||||
```js
|
|
||||||
alphabet.join('')[0];
|
|
||||||
//=> 'abcdefghijklmnopqrstuvwxyz'
|
|
||||||
```
|
|
||||||
|
|
||||||
## Uppercase
|
|
||||||
|
|
||||||
```js
|
|
||||||
alphabet.toUpperCase();
|
|
||||||
//=> ["Α", "Β", "Γ", "Δ", "Ε", "Ζ", "Η", "Θ", "Ι", "Κ", "Λ", "Μ", "Ν", "Ξ", "Ο", "Π", "Ρ", "Σ", "Τ", "Υ", "Φ", "Χ", "Ψ", "Ω"]
|
|
||||||
```
|
|
@ -1,21 +0,0 @@
|
|||||||
---
|
|
||||||
title: Installation
|
|
||||||
---
|
|
||||||
|
|
||||||
## npm
|
|
||||||
|
|
||||||
```bash
|
|
||||||
npm install alphabets --save
|
|
||||||
```
|
|
||||||
|
|
||||||
## Yarn
|
|
||||||
|
|
||||||
```bash
|
|
||||||
yarn add alphabets
|
|
||||||
```
|
|
||||||
|
|
||||||
## CDN
|
|
||||||
|
|
||||||
```html
|
|
||||||
<script src="https://unpkg.com/alphabets@1/dist/bundle.js"></script>
|
|
||||||
```
|
|
@ -1,18 +0,0 @@
|
|||||||
---
|
|
||||||
title: Usage
|
|
||||||
toc: false
|
|
||||||
---
|
|
||||||
|
|
||||||
```js
|
|
||||||
import { <alphabetYouWantToUse> } from 'alphabets';
|
|
||||||
```
|
|
||||||
|
|
||||||
or:
|
|
||||||
|
|
||||||
```js
|
|
||||||
const alphabets = require('alphabets');
|
|
||||||
console.log(alphabets.<alphabetYouWantToUse>);
|
|
||||||
```
|
|
||||||
|
|
||||||
where `<alphabetYouWantToUse>` is an alphabet this package supports.
|
|
||||||
[Here](../api/supported-alphabets) is a list from which you can choose.
|
|
10072
package-lock.json
generated
10072
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
34
package.json
34
package.json
@ -1,24 +1,24 @@
|
|||||||
{
|
{
|
||||||
"name": "alphabets",
|
"name": "alphabets",
|
||||||
"version": "1.2.0",
|
"keywords": ["alphabet", "alphabets"],
|
||||||
"description": "Exports many alphabets for many use cases",
|
"description": "Many different alphabets, many different use cases, zero depencencies.",
|
||||||
"main": "dist/bundle.js",
|
|
||||||
"scripts": {
|
"homepage": "https://github.com/garraflavatra/alphabets#readme",
|
||||||
"build": "rollup -c",
|
|
||||||
"test": "jest"
|
|
||||||
},
|
|
||||||
"keywords": [],
|
|
||||||
"author": "Romein van Buren <romein@vburen.eu>",
|
|
||||||
"license": "MIT",
|
|
||||||
"homepage": "https://projects.romeinvanburen.nl/alphabets/",
|
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/garraflavatra/alphabets.git"
|
"url": "https://github.com/garraflavatra/alphabets.git"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
|
||||||
"jest": "^27.0.1",
|
"version": "2.0.0",
|
||||||
"rollup": "^2.49.0",
|
"author": "Romein van Buren <romein@vburen.eu>",
|
||||||
"rollup-plugin-clear": "^2.0.7",
|
"license": "MIT",
|
||||||
"rollup-plugin-terser": "^7.0.2"
|
|
||||||
}
|
"main": "alphabets.js",
|
||||||
|
"module": "alphabets.mjs",
|
||||||
|
|
||||||
|
"files": [
|
||||||
|
"alphabets.js",
|
||||||
|
"alphabets.mjs",
|
||||||
|
"alphabets.json"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
@ -1,15 +0,0 @@
|
|||||||
import clear from 'rollup-plugin-clear';
|
|
||||||
import { terser } from "rollup-plugin-terser";
|
|
||||||
|
|
||||||
export default {
|
|
||||||
input: 'src/main.js',
|
|
||||||
output: {
|
|
||||||
file: 'dist/bundle.js',
|
|
||||||
format: 'umd',
|
|
||||||
name: 'alphabets',
|
|
||||||
},
|
|
||||||
plugins: [
|
|
||||||
terser(),
|
|
||||||
clear({ targets: ['dist'] }),
|
|
||||||
],
|
|
||||||
};
|
|
@ -1,19 +0,0 @@
|
|||||||
// These tests are just samples and not every alphabet is tested (that's boring).
|
|
||||||
|
|
||||||
const alphabets = require("../dist/bundle.js");
|
|
||||||
|
|
||||||
const greek = ["α", "β", "γ", "δ", "ε", "ζ", "η", "θ", "ι", "κ", "λ", "μ", "ν", "ξ", "ο", "π", "ρ", "σ", "τ", "υ", "φ", "χ", "ψ", "ω"];
|
|
||||||
const greekPolytonic = ["α", "β", "γ", "δ", "ε", "ζ", "η", "θ", "ι", "κ", "λ", "μ", "ν", "ξ", "ο", "π", "ρ", "σ", "τ", "υ", "φ", "χ", "ψ", "ω"];
|
|
||||||
const latin = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"];
|
|
||||||
|
|
||||||
test('alphabets.latin should return Latin alphabet', () => {
|
|
||||||
expect(alphabets.latin).toStrictEqual(latin);
|
|
||||||
});
|
|
||||||
|
|
||||||
test('alphabets.greek should return Greek alphabet', () => {
|
|
||||||
expect(alphabets.greek).toStrictEqual(greek);
|
|
||||||
});
|
|
||||||
|
|
||||||
test('alphabets.greekPolytonic should return Greek (Polytonic) alphabet', () => {
|
|
||||||
expect(alphabets.greekPolytonic).toStrictEqual(greekPolytonic);
|
|
||||||
});
|
|
23
src/main.js
23
src/main.js
@ -1,23 +0,0 @@
|
|||||||
export const danish = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "æ", "ø", "å"];
|
|
||||||
export const elfadian = ["a", "ą", "b", "d", "ð", "e", "ę", "f", "g", "h", "i", "į", "j", "k", "l", "m", "n", "o", "p", "r", "s", "t", "u", "ų", "v", "w", "y", "y̨", "å", "ą̊", "ä", "ö"];
|
|
||||||
export const faroese = ["a", "á", "b", "d", "ð", "e", "f", "g", "h", "i", "í", "j", "k", "l", "m", "n", "o", "ó", "p", "r", "s", "t", "u", "ú", "v", "y", "ý", "æ", "ø"];
|
|
||||||
export const greek = ["α", "β", "γ", "δ", "ε", "ζ", "η", "θ", "ι", "κ", "λ", "μ", "ν", "ξ", "ο", "π", "ρ", "σ", "τ", "υ", "φ", "χ", "ψ", "ω"];
|
|
||||||
export const greekPolytonic = ["α", "β", "γ", "δ", "ε", "ζ", "η", "θ", "ι", "κ", "λ", "μ", "ν", "ξ", "ο", "π", "ρ", "σ", "τ", "υ", "φ", "χ", "ψ", "ω"];
|
|
||||||
export const icelandic = ["a", "á", "b", "d", "ð", "e", "é", "f", "g", "h", "i", "í", "j", "k", "l", "m", "n", "o", "ó", "p", "r", "s", "t", "u", "ú", "v", "x", "y", "ý", "þ", "æ", "ö"];
|
|
||||||
export const latin = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"];
|
|
||||||
export const norwegian = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "æ", "ø", "å"];
|
|
||||||
export const russian = ["а", "б", "в", "г", "д", "е", "ё", "ж", "з", "и", "й", "к", "л", "м", "н", "о", "п", "р", "с", "т", "у", "ф", "х", "ц", "ч", "ш", "щ", "ъ", "ы", "ь", "э", "ю", "я"];
|
|
||||||
export const swedish = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "å", "ä", "ö"];
|
|
||||||
|
|
||||||
export default [
|
|
||||||
danish,
|
|
||||||
elfadian,
|
|
||||||
faroese,
|
|
||||||
greek,
|
|
||||||
greekPolytonic,
|
|
||||||
icelandic,
|
|
||||||
latin,
|
|
||||||
norwegian,
|
|
||||||
russian,
|
|
||||||
swedish,
|
|
||||||
];
|
|
Loading…
Reference in New Issue
Block a user