bb26 3.0.0 → 3.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/random.js CHANGED
@@ -1,4 +1,3 @@
1
- /* eslint-disable @typescript-eslint/unified-signatures */
2
1
  import randomItem from 'random-item';
3
2
  import { range } from './index.js';
4
3
  /**
package/dist/range.js CHANGED
@@ -1,4 +1,3 @@
1
- /* eslint-disable @typescript-eslint/unified-signatures */
2
1
  import { toDecimal, increment } from './index.js';
3
2
  /**
4
3
  * Creates an array of bijective base-26 numerals progressing from `start` up
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bb26",
3
- "version": "3.0.0",
3
+ "version": "3.0.2",
4
4
  "description": "Utilities for working with bijective base-26 numerals",
5
5
  "keywords": [
6
6
  "base 26",
@@ -11,16 +11,16 @@
11
11
  "spreadsheet column letters",
12
12
  "license plate serials"
13
13
  ],
14
- "homepage": "https://github.com/ptrkcsk/BB26#readme",
14
+ "homepage": "https://github.com/patrik-csak/BB26#readme",
15
15
  "bugs": {
16
- "url": "https://github.com/ptrkcsk/BB26/issues"
16
+ "url": "https://github.com/patrik-csak/BB26/issues"
17
17
  },
18
18
  "license": "MIT",
19
19
  "author": "Patrik Csak <p@trikcsak.com>",
20
20
  "files": [
21
21
  "dist"
22
22
  ],
23
- "repository": "github:ptrkcsk/BB26",
23
+ "repository": "github:patrik-csak/BB26",
24
24
  "scripts": {
25
25
  "build": "del-cli dist && tsc",
26
26
  "format": "xo --fix",
@@ -39,7 +39,7 @@
39
39
  "del-cli": "^5.0.0",
40
40
  "ts-node": "^10.4.0",
41
41
  "typescript": "^5.0.2",
42
- "xo": "^0.53.1"
42
+ "xo": "^0.54.1"
43
43
  },
44
44
  "engines": {
45
45
  "node": ">=14 <=19"
package/readme.md CHANGED
@@ -1,6 +1,5 @@
1
1
  # BB26
2
2
 
3
- [![Badge indicating minified and gzipped size of BB26](https://badgen.net/bundlephobia/minzip/bb26)](https://bundlephobia.com/result?p=bb26)
4
3
  [![Badge indicating number of weekly downloads of BB26 from npm package registry](https://badgen.net/npm/dw/bb26)](https://www.npmjs.com/package/bb26)
5
4
  [![Badge indicating percent test coverage of BB26](https://badgen.net/codeclimate/coverage/patrik-csak/BB26?label=test+coverage)](https://codeclimate.com/github/patrik-csak/BB26/test_coverage)
6
5
 
@@ -19,6 +18,10 @@ Decimal: | 1 | 2 | 3 | ... | 24 | 25 | 26 | 27 | 28 | 29 | ...
19
18
 
20
19
  ## Install
21
20
 
21
+ > **Note**
22
+ >
23
+ > This package is a native ECMAScript Module (ESM). If your project is not ESM, read [Sindre Sorhus’s Pure ESM package article](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c).
24
+
22
25
  ```sh
23
26
  npm install bb26
24
27
  ```
@@ -27,87 +30,87 @@ npm install bb26
27
30
 
28
31
  ### `increment()`
29
32
 
30
- ```
31
- increment(string: string): string
33
+ ```ts
34
+ function increment(string: string): string;
32
35
  ```
33
36
 
34
37
  Increments a bijective base-26 string by one numeral.
35
38
 
36
39
  ```js
37
- import { increment } from 'bb26'
40
+ import { increment } from "bb26";
38
41
 
39
- increment('A') // 'B'
40
- increment('Z') // 'AA'
41
- increment('AA') // 'AB'
42
+ increment("A"); // 'B'
43
+ increment("Z"); // 'AA'
44
+ increment("AA"); // 'AB'
42
45
  ```
43
46
 
44
47
  ### `random()`
45
48
 
46
- ```
47
- random(upper: string): string
48
- random(lower: string, upper: string): string
49
+ ```ts
50
+ function random(upper: string): string;
51
+ function random(lower: string, upper: string): string;
49
52
  ```
50
53
 
51
54
  Produces a random string between the inclusive `lower` and `upper` bounds. If only one argument is provided, a string between `'A'` and the given string is returned.
52
55
 
53
56
  ```js
54
- import { random } from 'bb26'
57
+ import { random } from "bb26";
55
58
 
56
- random('AAA') // 'NE'
57
- random('AAA', 'AAAA') // 'KXZ'
59
+ random("AAA"); // 'NE'
60
+ random("AAA", "AAAA"); // 'KXZ'
58
61
  ```
59
62
 
60
63
  ### `range()`
61
64
 
62
- ```
63
- range(end: string): string[]
64
- range(start: string, end: string): string[]
65
+ ```ts
66
+ function range(end: string): string[];
67
+ function range(start: string, end: string): string[];
65
68
  ```
66
69
 
67
70
  Creates an array of bijective base-26 numerals progressing from `start` up to, but not including, `end`. If `end` is not specified, it's set to `start` with `start` then set to `'A'`.
68
71
 
69
72
  ```js
70
- import { range } from 'bb26'
73
+ import { range } from "bb26";
71
74
 
72
- range('B') // ['A']
73
- range('C') // ['A', 'B']
74
- range('B', 'C') // ['B']
75
- range('B', 'D') // ['B', 'C']
76
- range('Z', 'AC') // ['Z', 'AA', 'AB']
75
+ range("B"); // ['A']
76
+ range("C"); // ['A', 'B']
77
+ range("B", "C"); // ['B']
78
+ range("B", "D"); // ['B', 'C']
79
+ range("Z", "AC"); // ['Z', 'AA', 'AB']
77
80
  ```
78
81
 
79
82
  ### `toBb26()`
80
83
 
81
- ```
82
- toBb26(number: number): string
84
+ ```ts
85
+ function toBb26(number: number): string;
83
86
  ```
84
87
 
85
88
  Converts a decimal number to a bijective base-26 string.
86
89
 
87
90
  ```js
88
- import { toBb26 } from 'bb26'
91
+ import { toBb26 } from "bb26";
89
92
 
90
- toBb26(1) // 'A'
91
- toBb26(2) // 'B'
92
- toBb26(26) // 'Z'
93
- toBb26(27) // 'AA'
94
- toBb26(28) // 'AB'
93
+ toBb26(1); // 'A'
94
+ toBb26(2); // 'B'
95
+ toBb26(26); // 'Z'
96
+ toBb26(27); // 'AA'
97
+ toBb26(28); // 'AB'
95
98
  ```
96
99
 
97
100
  ### `toDecimal()`
98
101
 
99
- ```
100
- toDecimal(string: string): number
102
+ ```ts
103
+ function toDecimal(string: string): number;
101
104
  ```
102
105
 
103
106
  Converts a bijective base-26 string to a decimal number.
104
107
 
105
108
  ```js
106
- import { toDecimal } from 'bb26'
109
+ import { toDecimal } from "bb26";
107
110
 
108
- toDecimal('A') // 1
109
- toDecimal('B') // 2
110
- toDecimal('Z') // 26
111
- toDecimal('AA') // 27
112
- toDecimal('AB') // 28
111
+ toDecimal("A"); // 1
112
+ toDecimal("B"); // 2
113
+ toDecimal("Z"); // 26
114
+ toDecimal("AA"); // 27
115
+ toDecimal("AB"); // 28
113
116
  ```