@jackens/nnn 2026.2.24 → 2026.2.25
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/nnn.d.ts +12 -0
- package/nnn.js +4 -7
- package/package.json +1 -1
- package/readme.md +31 -1
package/nnn.d.ts
CHANGED
|
@@ -170,6 +170,18 @@ export declare const isArray: (arg: unknown) => arg is unknown[];
|
|
|
170
170
|
* `true` if `arg` is a finite number, `false` otherwise.
|
|
171
171
|
*/
|
|
172
172
|
export declare const isFiniteNumber: (arg: unknown) => arg is number;
|
|
173
|
+
/**
|
|
174
|
+
* Checks whether the argument is an integer number.
|
|
175
|
+
*
|
|
176
|
+
* @param arg
|
|
177
|
+
*
|
|
178
|
+
* The value to check.
|
|
179
|
+
*
|
|
180
|
+
* @returns
|
|
181
|
+
*
|
|
182
|
+
* `true` if `arg` is an integer number, `false` otherwise.
|
|
183
|
+
*/
|
|
184
|
+
export declare const isInteger: (arg: unknown) => arg is number;
|
|
173
185
|
/**
|
|
174
186
|
* Checks whether the argument is of type `number` (includes `NaN` and `±Infinity`).
|
|
175
187
|
*
|
package/nnn.js
CHANGED
|
@@ -12,9 +12,6 @@ var _c = (node, prefix, result, splitter) => {
|
|
|
12
12
|
const queue = [[node, prefix]];
|
|
13
13
|
while (queue.length > 0) {
|
|
14
14
|
const [style0, prefix0] = queue.shift();
|
|
15
|
-
if (style0 == null || prefix0 == null) {
|
|
16
|
-
continue;
|
|
17
|
-
}
|
|
18
15
|
if (isArray(style0)) {
|
|
19
16
|
result.push(prefix0, prefix0 !== "" ? "{" : "", style0.join(";"), prefix0 !== "" ? "}" : "");
|
|
20
17
|
} else {
|
|
@@ -185,7 +182,7 @@ var jsOnParse = (handlers, text) => JSON.parse(text, (key, value) => {
|
|
|
185
182
|
});
|
|
186
183
|
// src/nnn/monokai.ts
|
|
187
184
|
var monokai = {
|
|
188
|
-
":root": {
|
|
185
|
+
":root$$monokai": {
|
|
189
186
|
__bg: "#faf4f2",
|
|
190
187
|
__fg: "#29242a",
|
|
191
188
|
__comment: "#918c8e",
|
|
@@ -201,7 +198,7 @@ var monokai = {
|
|
|
201
198
|
__punctuation: "#918c8e",
|
|
202
199
|
__string: "#cc7a0a"
|
|
203
200
|
},
|
|
204
|
-
pre: {
|
|
201
|
+
pre$$monokai: {
|
|
205
202
|
backgroundColor: "var(--bg)",
|
|
206
203
|
color: "var(--fg)",
|
|
207
204
|
margin: 0,
|
|
@@ -212,7 +209,7 @@ var monokai = {
|
|
|
212
209
|
padding: 0
|
|
213
210
|
}
|
|
214
211
|
},
|
|
215
|
-
"code>span
|
|
212
|
+
"code>span.$$monokai": {
|
|
216
213
|
bg: { color: "var(--bg)" },
|
|
217
214
|
fg: { color: "var(--fg)" },
|
|
218
215
|
comment: { color: "var(--comment)" },
|
|
@@ -228,7 +225,7 @@ var monokai = {
|
|
|
228
225
|
punctuation: { color: "var(--punctuation)" },
|
|
229
226
|
string: { color: "var(--string)" }
|
|
230
227
|
},
|
|
231
|
-
"@media only screen and (prefers-color-scheme: dark)": {
|
|
228
|
+
"@media only screen and (prefers-color-scheme: dark)$$monokai": {
|
|
232
229
|
":root": {
|
|
233
230
|
__bg: "#2d2a2e",
|
|
234
231
|
__fg: "#fcfcfa",
|
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# nnn
|
|
2
2
|
|
|
3
|
-
A collection of Jackens’ JavaScript helper utilities (version: `2026.2.
|
|
3
|
+
A collection of Jackens’ JavaScript helper utilities (version: `2026.2.25`).
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
@@ -26,6 +26,7 @@ import {
|
|
|
26
26
|
hasOwn,
|
|
27
27
|
isArray,
|
|
28
28
|
isFiniteNumber,
|
|
29
|
+
isInteger,
|
|
29
30
|
isNumber,
|
|
30
31
|
isRecord,
|
|
31
32
|
isString,
|
|
@@ -60,6 +61,7 @@ import {
|
|
|
60
61
|
- [`hasOwn`](#hasOwn): Checks whether an object has the specified key as its own property.
|
|
61
62
|
- [`isArray`](#isArray): Checks whether the argument is an array.
|
|
62
63
|
- [`isFiniteNumber`](#isFiniteNumber): Checks whether the argument is a finite number (excludes `±Infinity` and `NaN`).
|
|
64
|
+
- [`isInteger`](#isInteger): Checks whether the argument is an integer number.
|
|
63
65
|
- [`isNumber`](#isNumber): Checks whether the argument is of type `number` (includes `NaN` and `±Infinity`).
|
|
64
66
|
- [`isRecord`](#isRecord): Checks whether the argument is a plain object (not `null` and not an array).
|
|
65
67
|
- [`isString`](#isString): Checks whether the argument is a string.
|
|
@@ -627,6 +629,34 @@ expect(isFiniteNumber(NaN)).to.be.false
|
|
|
627
629
|
expect(isFiniteNumber(Infinity)).to.be.false
|
|
628
630
|
```
|
|
629
631
|
|
|
632
|
+
### isInteger
|
|
633
|
+
|
|
634
|
+
```ts
|
|
635
|
+
const isInteger: (arg: unknown) => arg is number;
|
|
636
|
+
```
|
|
637
|
+
|
|
638
|
+
Checks whether the argument is an integer number.
|
|
639
|
+
|
|
640
|
+
#### arg
|
|
641
|
+
|
|
642
|
+
The value to check.
|
|
643
|
+
|
|
644
|
+
#### Returns
|
|
645
|
+
|
|
646
|
+
`true` if `arg` is an integer number, `false` otherwise.
|
|
647
|
+
|
|
648
|
+
#### Usage Examples
|
|
649
|
+
|
|
650
|
+
```ts
|
|
651
|
+
expect(isInteger(42)).to.be.true
|
|
652
|
+
expect(isInteger(42.00000000000001)).to.be.false
|
|
653
|
+
expect(isInteger(42.000000000000001)).to.be.true // because of loss of precision
|
|
654
|
+
expect(isInteger(Number(42))).to.be.true
|
|
655
|
+
expect(isInteger(new Number(42))).to.be.false
|
|
656
|
+
expect(isInteger(NaN)).to.be.false
|
|
657
|
+
expect(isInteger(Infinity)).to.be.false
|
|
658
|
+
```
|
|
659
|
+
|
|
630
660
|
### isNumber
|
|
631
661
|
|
|
632
662
|
```ts
|