@wtasnorg/node-lib 0.0.10 → 0.0.12
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/changelog.txt +14 -0
- package/docs/README.md +17 -0
- package/docs/docs.json +2148 -413
- package/docs/functions/countOnes.md +31 -0
- package/docs/functions/countZeroes.md +32 -0
- package/docs/functions/countZeroesWithWidth.md +37 -0
- package/docs/functions/createFindDirectories.md +3 -3
- package/docs/functions/decode.md +3 -3
- package/docs/functions/decode32.md +49 -0
- package/docs/functions/decode58.md +49 -0
- package/docs/functions/decode85.md +49 -0
- package/docs/functions/encode.md +3 -3
- package/docs/functions/encode32.md +45 -0
- package/docs/functions/encode58.md +45 -0
- package/docs/functions/encode85.md +45 -0
- package/docs/functions/hello.md +1 -1
- package/docs/functions/parseUserAgent.md +1 -1
- package/docs/functions/pojo.md +1 -1
- package/docs/functions/popcount32.md +27 -0
- package/docs/functions/popcount64.md +31 -0
- package/docs/interfaces/FileSystemDependencies.md +3 -3
- package/docs/interfaces/FindDirectoriesOptions.md +5 -5
- package/docs/interfaces/UserAgentInfo.md +6 -6
- package/docs/type-aliases/Base32CharsetType.md +13 -0
- package/docs/type-aliases/Base58CharsetType.md +13 -0
- package/docs/type-aliases/Base64CharsetType.md +1 -1
- package/docs/type-aliases/Base85CharsetType.md +13 -0
- package/docs/variables/Base32Charset.md +16 -0
- package/docs/variables/Base58Charset.md +16 -0
- package/docs/variables/Base64Charset.md +1 -1
- package/docs/variables/Base85Charset.md +16 -0
- package/package.json +52 -8
- package/readme.txt +30 -4
- package/src/base32.d.ts +58 -0
- package/src/base32.js +143 -0
- package/src/base32.test.d.ts +2 -0
- package/src/base32.test.js +121 -0
- package/src/base32.test.ts +144 -0
- package/src/base32.ts +169 -0
- package/src/base58.d.ts +58 -0
- package/src/base58.js +155 -0
- package/src/base58.test.d.ts +2 -0
- package/src/base58.test.js +108 -0
- package/src/base58.test.ts +128 -0
- package/src/base58.ts +177 -0
- package/src/base85.d.ts +58 -0
- package/src/base85.js +173 -0
- package/src/base85.test.d.ts +2 -0
- package/src/base85.test.js +107 -0
- package/src/base85.test.ts +125 -0
- package/src/base85.ts +199 -0
- package/src/bits.d.ts +43 -0
- package/src/bits.js +117 -0
- package/src/bits.test.d.ts +2 -0
- package/src/bits.test.js +62 -0
- package/src/bits.test.ts +77 -0
- package/src/bits.ts +135 -0
- package/src/index.d.ts +9 -2
- package/src/index.js +5 -1
- package/src/index.ts +26 -2
- package/.github/workflows/npm-publish.yml +0 -36
- package/.github/workflows/npm-test-on-pr.yml +0 -30
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
[**@wtasnorg/node-lib**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@wtasnorg/node-lib](../README.md) / countOnes
|
|
6
|
+
|
|
7
|
+
# Function: countOnes()
|
|
8
|
+
|
|
9
|
+
> **countOnes**(`value`): `number`
|
|
10
|
+
|
|
11
|
+
Defined in: [bits.ts:81](https://github.com/wtasg/node-lib/blob/e8728afafd1c71a23332e0e226c750c68ec8ae80/src/bits.ts#L81)
|
|
12
|
+
|
|
13
|
+
Count set bits in a non-negative integer.
|
|
14
|
+
|
|
15
|
+
## Parameters
|
|
16
|
+
|
|
17
|
+
### value
|
|
18
|
+
|
|
19
|
+
Input value.
|
|
20
|
+
|
|
21
|
+
`number` | `bigint`
|
|
22
|
+
|
|
23
|
+
## Returns
|
|
24
|
+
|
|
25
|
+
`number`
|
|
26
|
+
|
|
27
|
+
Number of set bits.
|
|
28
|
+
|
|
29
|
+
## Throws
|
|
30
|
+
|
|
31
|
+
If `value` is negative or an unsafe integer.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
[**@wtasnorg/node-lib**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@wtasnorg/node-lib](../README.md) / countZeroes
|
|
6
|
+
|
|
7
|
+
# Function: countZeroes()
|
|
8
|
+
|
|
9
|
+
> **countZeroes**(`value`): `number`
|
|
10
|
+
|
|
11
|
+
Defined in: [bits.ts:118](https://github.com/wtasg/node-lib/blob/e8728afafd1c71a23332e0e226c750c68ec8ae80/src/bits.ts#L118)
|
|
12
|
+
|
|
13
|
+
Count zero bits from LSB up to and including the highest set bit.
|
|
14
|
+
For zero input, returns 0.
|
|
15
|
+
|
|
16
|
+
## Parameters
|
|
17
|
+
|
|
18
|
+
### value
|
|
19
|
+
|
|
20
|
+
Input value.
|
|
21
|
+
|
|
22
|
+
`number` | `bigint`
|
|
23
|
+
|
|
24
|
+
## Returns
|
|
25
|
+
|
|
26
|
+
`number`
|
|
27
|
+
|
|
28
|
+
Zero count up to the left-most set bit.
|
|
29
|
+
|
|
30
|
+
## Throws
|
|
31
|
+
|
|
32
|
+
If `value` is negative or an unsafe integer.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
[**@wtasnorg/node-lib**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@wtasnorg/node-lib](../README.md) / countZeroesWithWidth
|
|
6
|
+
|
|
7
|
+
# Function: countZeroesWithWidth()
|
|
8
|
+
|
|
9
|
+
> **countZeroesWithWidth**(`value`, `width`): `number`
|
|
10
|
+
|
|
11
|
+
Defined in: [bits.ts:94](https://github.com/wtasg/node-lib/blob/e8728afafd1c71a23332e0e226c750c68ec8ae80/src/bits.ts#L94)
|
|
12
|
+
|
|
13
|
+
Count zero bits within a fixed width, considering only low-order `width` bits.
|
|
14
|
+
|
|
15
|
+
## Parameters
|
|
16
|
+
|
|
17
|
+
### value
|
|
18
|
+
|
|
19
|
+
Input value.
|
|
20
|
+
|
|
21
|
+
`number` | `bigint`
|
|
22
|
+
|
|
23
|
+
### width
|
|
24
|
+
|
|
25
|
+
`number`
|
|
26
|
+
|
|
27
|
+
Bit width to inspect.
|
|
28
|
+
|
|
29
|
+
## Returns
|
|
30
|
+
|
|
31
|
+
`number`
|
|
32
|
+
|
|
33
|
+
Number of zero bits in the selected width.
|
|
34
|
+
|
|
35
|
+
## Throws
|
|
36
|
+
|
|
37
|
+
If `value` is negative/unsafe or `width` is negative/unsafe.
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
> **createFindDirectories**(`deps`): (`root`, `options`) => `Promise`\<`string`[]\>
|
|
10
10
|
|
|
11
|
-
Defined in: [find.ts:19](https://github.com/wtasg/node-lib/blob/
|
|
11
|
+
Defined in: [find.ts:19](https://github.com/wtasg/node-lib/blob/e8728afafd1c71a23332e0e226c750c68ec8ae80/src/find.ts#L19)
|
|
12
12
|
|
|
13
13
|
Factory that produces an async findDirectories function with
|
|
14
14
|
injected filesystem dependencies for full testability.
|
|
@@ -21,7 +21,7 @@ injected filesystem dependencies for full testability.
|
|
|
21
21
|
|
|
22
22
|
## Returns
|
|
23
23
|
|
|
24
|
-
> (`root`, `options
|
|
24
|
+
> (`root`, `options?`): `Promise`\<`string`[]\>
|
|
25
25
|
|
|
26
26
|
### Parameters
|
|
27
27
|
|
|
@@ -29,7 +29,7 @@ injected filesystem dependencies for full testability.
|
|
|
29
29
|
|
|
30
30
|
`string`
|
|
31
31
|
|
|
32
|
-
#### options
|
|
32
|
+
#### options?
|
|
33
33
|
|
|
34
34
|
[`FindDirectoriesOptions`](../interfaces/FindDirectoriesOptions.md) = `{}`
|
|
35
35
|
|
package/docs/functions/decode.md
CHANGED
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
|
|
7
7
|
# Function: decode()
|
|
8
8
|
|
|
9
|
-
> **decode**(`input`, `charset
|
|
9
|
+
> **decode**(`input`, `charset?`): `string`
|
|
10
10
|
|
|
11
|
-
Defined in: [base64.ts:119](https://github.com/wtasg/node-lib/blob/
|
|
11
|
+
Defined in: [base64.ts:119](https://github.com/wtasg/node-lib/blob/e8728afafd1c71a23332e0e226c750c68ec8ae80/src/base64.ts#L119)
|
|
12
12
|
|
|
13
13
|
Decode a Base64 string.
|
|
14
14
|
|
|
@@ -20,7 +20,7 @@ Decode a Base64 string.
|
|
|
20
20
|
|
|
21
21
|
The Base64 encoded string.
|
|
22
22
|
|
|
23
|
-
### charset
|
|
23
|
+
### charset?
|
|
24
24
|
|
|
25
25
|
The charset variant to use (default: "standard").
|
|
26
26
|
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
[**@wtasnorg/node-lib**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@wtasnorg/node-lib](../README.md) / decode32
|
|
6
|
+
|
|
7
|
+
# Function: decode32()
|
|
8
|
+
|
|
9
|
+
> **decode32**(`input`, `charset?`): `string`
|
|
10
|
+
|
|
11
|
+
Defined in: [base32.ts:136](https://github.com/wtasg/node-lib/blob/e8728afafd1c71a23332e0e226c750c68ec8ae80/src/base32.ts#L136)
|
|
12
|
+
|
|
13
|
+
Decode a Base32 string.
|
|
14
|
+
|
|
15
|
+
## Parameters
|
|
16
|
+
|
|
17
|
+
### input
|
|
18
|
+
|
|
19
|
+
`string`
|
|
20
|
+
|
|
21
|
+
The Base32 encoded string.
|
|
22
|
+
|
|
23
|
+
### charset?
|
|
24
|
+
|
|
25
|
+
The charset variant to use (default: "rfc4648").
|
|
26
|
+
|
|
27
|
+
`"rfc4648"` | `"hex"` | `"crockford"`
|
|
28
|
+
|
|
29
|
+
## Returns
|
|
30
|
+
|
|
31
|
+
`string`
|
|
32
|
+
|
|
33
|
+
The decoded string.
|
|
34
|
+
|
|
35
|
+
## Example
|
|
36
|
+
|
|
37
|
+
```typescript
|
|
38
|
+
import { decode32 } from "./base32.js";
|
|
39
|
+
|
|
40
|
+
decode32("JBSWY3DP");
|
|
41
|
+
// => "Hello"
|
|
42
|
+
|
|
43
|
+
decode32("EHMP6SS=", "hex");
|
|
44
|
+
// => "test"
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Throws
|
|
48
|
+
|
|
49
|
+
Error if the input contains invalid characters.
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
[**@wtasnorg/node-lib**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@wtasnorg/node-lib](../README.md) / decode58
|
|
6
|
+
|
|
7
|
+
# Function: decode58()
|
|
8
|
+
|
|
9
|
+
> **decode58**(`input`, `charset?`): `string`
|
|
10
|
+
|
|
11
|
+
Defined in: [base58.ts:132](https://github.com/wtasg/node-lib/blob/e8728afafd1c71a23332e0e226c750c68ec8ae80/src/base58.ts#L132)
|
|
12
|
+
|
|
13
|
+
Decode a Base58 string.
|
|
14
|
+
|
|
15
|
+
## Parameters
|
|
16
|
+
|
|
17
|
+
### input
|
|
18
|
+
|
|
19
|
+
`string`
|
|
20
|
+
|
|
21
|
+
The Base58 encoded string.
|
|
22
|
+
|
|
23
|
+
### charset?
|
|
24
|
+
|
|
25
|
+
The charset variant to use (default: "bitcoin").
|
|
26
|
+
|
|
27
|
+
`"bitcoin"` | `"flickr"` | `"ripple"`
|
|
28
|
+
|
|
29
|
+
## Returns
|
|
30
|
+
|
|
31
|
+
`string`
|
|
32
|
+
|
|
33
|
+
The decoded string.
|
|
34
|
+
|
|
35
|
+
## Example
|
|
36
|
+
|
|
37
|
+
```typescript
|
|
38
|
+
import { decode58 } from "./base58.js";
|
|
39
|
+
|
|
40
|
+
decode58("JxF12TrwUP45BMd");
|
|
41
|
+
// => "Hello World"
|
|
42
|
+
|
|
43
|
+
decode58("jXf12sRWto45bmD", "flickr");
|
|
44
|
+
// => "Hello World"
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Throws
|
|
48
|
+
|
|
49
|
+
Error if the input contains invalid characters.
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
[**@wtasnorg/node-lib**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@wtasnorg/node-lib](../README.md) / decode85
|
|
6
|
+
|
|
7
|
+
# Function: decode85()
|
|
8
|
+
|
|
9
|
+
> **decode85**(`input`, `charset?`): `string`
|
|
10
|
+
|
|
11
|
+
Defined in: [base85.ts:135](https://github.com/wtasg/node-lib/blob/e8728afafd1c71a23332e0e226c750c68ec8ae80/src/base85.ts#L135)
|
|
12
|
+
|
|
13
|
+
Decode a Base85 string.
|
|
14
|
+
|
|
15
|
+
## Parameters
|
|
16
|
+
|
|
17
|
+
### input
|
|
18
|
+
|
|
19
|
+
`string`
|
|
20
|
+
|
|
21
|
+
The Base85 encoded string.
|
|
22
|
+
|
|
23
|
+
### charset?
|
|
24
|
+
|
|
25
|
+
The charset variant to use (default: "ascii85").
|
|
26
|
+
|
|
27
|
+
`"ascii85"` | `"z85"` | `"rfc1924"`
|
|
28
|
+
|
|
29
|
+
## Returns
|
|
30
|
+
|
|
31
|
+
`string`
|
|
32
|
+
|
|
33
|
+
The decoded string.
|
|
34
|
+
|
|
35
|
+
## Example
|
|
36
|
+
|
|
37
|
+
```typescript
|
|
38
|
+
import { decode85 } from "./base85.js";
|
|
39
|
+
|
|
40
|
+
decode85("87cURDZ");
|
|
41
|
+
// => "Hello"
|
|
42
|
+
|
|
43
|
+
decode85("wrx.P", "z85");
|
|
44
|
+
// => "test"
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Throws
|
|
48
|
+
|
|
49
|
+
Error if the input contains invalid characters.
|
package/docs/functions/encode.md
CHANGED
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
|
|
7
7
|
# Function: encode()
|
|
8
8
|
|
|
9
|
-
> **encode**(`input`, `charset
|
|
9
|
+
> **encode**(`input`, `charset?`): `string`
|
|
10
10
|
|
|
11
|
-
Defined in: [base64.ts:79](https://github.com/wtasg/node-lib/blob/
|
|
11
|
+
Defined in: [base64.ts:79](https://github.com/wtasg/node-lib/blob/e8728afafd1c71a23332e0e226c750c68ec8ae80/src/base64.ts#L79)
|
|
12
12
|
|
|
13
13
|
Encode a string to Base64.
|
|
14
14
|
|
|
@@ -20,7 +20,7 @@ Encode a string to Base64.
|
|
|
20
20
|
|
|
21
21
|
The string to encode.
|
|
22
22
|
|
|
23
|
-
### charset
|
|
23
|
+
### charset?
|
|
24
24
|
|
|
25
25
|
The charset variant to use (default: "standard").
|
|
26
26
|
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
[**@wtasnorg/node-lib**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@wtasnorg/node-lib](../README.md) / encode32
|
|
6
|
+
|
|
7
|
+
# Function: encode32()
|
|
8
|
+
|
|
9
|
+
> **encode32**(`input`, `charset?`): `string`
|
|
10
|
+
|
|
11
|
+
Defined in: [base32.ts:81](https://github.com/wtasg/node-lib/blob/e8728afafd1c71a23332e0e226c750c68ec8ae80/src/base32.ts#L81)
|
|
12
|
+
|
|
13
|
+
Encode a string to Base32.
|
|
14
|
+
|
|
15
|
+
## Parameters
|
|
16
|
+
|
|
17
|
+
### input
|
|
18
|
+
|
|
19
|
+
`string`
|
|
20
|
+
|
|
21
|
+
The string to encode.
|
|
22
|
+
|
|
23
|
+
### charset?
|
|
24
|
+
|
|
25
|
+
The charset variant to use (default: "rfc4648").
|
|
26
|
+
|
|
27
|
+
`"rfc4648"` | `"hex"` | `"crockford"`
|
|
28
|
+
|
|
29
|
+
## Returns
|
|
30
|
+
|
|
31
|
+
`string`
|
|
32
|
+
|
|
33
|
+
The Base32 encoded string.
|
|
34
|
+
|
|
35
|
+
## Example
|
|
36
|
+
|
|
37
|
+
```typescript
|
|
38
|
+
import { encode32 } from "./base32.js";
|
|
39
|
+
|
|
40
|
+
encode32("Hello");
|
|
41
|
+
// => "JBSWY3DP"
|
|
42
|
+
|
|
43
|
+
encode32("test", "hex");
|
|
44
|
+
// => "EHMP6SS="
|
|
45
|
+
```
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
[**@wtasnorg/node-lib**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@wtasnorg/node-lib](../README.md) / encode58
|
|
6
|
+
|
|
7
|
+
# Function: encode58()
|
|
8
|
+
|
|
9
|
+
> **encode58**(`input`, `charset?`): `string`
|
|
10
|
+
|
|
11
|
+
Defined in: [base58.ts:72](https://github.com/wtasg/node-lib/blob/e8728afafd1c71a23332e0e226c750c68ec8ae80/src/base58.ts#L72)
|
|
12
|
+
|
|
13
|
+
Encode a string to Base58.
|
|
14
|
+
|
|
15
|
+
## Parameters
|
|
16
|
+
|
|
17
|
+
### input
|
|
18
|
+
|
|
19
|
+
`string`
|
|
20
|
+
|
|
21
|
+
The string to encode.
|
|
22
|
+
|
|
23
|
+
### charset?
|
|
24
|
+
|
|
25
|
+
The charset variant to use (default: "bitcoin").
|
|
26
|
+
|
|
27
|
+
`"bitcoin"` | `"flickr"` | `"ripple"`
|
|
28
|
+
|
|
29
|
+
## Returns
|
|
30
|
+
|
|
31
|
+
`string`
|
|
32
|
+
|
|
33
|
+
The Base58 encoded string.
|
|
34
|
+
|
|
35
|
+
## Example
|
|
36
|
+
|
|
37
|
+
```typescript
|
|
38
|
+
import { encode58 } from "./base58.js";
|
|
39
|
+
|
|
40
|
+
encode58("Hello World");
|
|
41
|
+
// => "JxF12TrwUP45BMd"
|
|
42
|
+
|
|
43
|
+
encode58("Hello World", "flickr");
|
|
44
|
+
// => "jXf12sRWto45bmD"
|
|
45
|
+
```
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
[**@wtasnorg/node-lib**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@wtasnorg/node-lib](../README.md) / encode85
|
|
6
|
+
|
|
7
|
+
# Function: encode85()
|
|
8
|
+
|
|
9
|
+
> **encode85**(`input`, `charset?`): `string`
|
|
10
|
+
|
|
11
|
+
Defined in: [base85.ts:73](https://github.com/wtasg/node-lib/blob/e8728afafd1c71a23332e0e226c750c68ec8ae80/src/base85.ts#L73)
|
|
12
|
+
|
|
13
|
+
Encode a string to Base85.
|
|
14
|
+
|
|
15
|
+
## Parameters
|
|
16
|
+
|
|
17
|
+
### input
|
|
18
|
+
|
|
19
|
+
`string`
|
|
20
|
+
|
|
21
|
+
The string to encode.
|
|
22
|
+
|
|
23
|
+
### charset?
|
|
24
|
+
|
|
25
|
+
The charset variant to use (default: "ascii85").
|
|
26
|
+
|
|
27
|
+
`"ascii85"` | `"z85"` | `"rfc1924"`
|
|
28
|
+
|
|
29
|
+
## Returns
|
|
30
|
+
|
|
31
|
+
`string`
|
|
32
|
+
|
|
33
|
+
The Base85 encoded string.
|
|
34
|
+
|
|
35
|
+
## Example
|
|
36
|
+
|
|
37
|
+
```typescript
|
|
38
|
+
import { encode85 } from "./base85.js";
|
|
39
|
+
|
|
40
|
+
encode85("Hello");
|
|
41
|
+
// => "87cURDZ"
|
|
42
|
+
|
|
43
|
+
encode85("test", "z85");
|
|
44
|
+
// => "wrx.P"
|
|
45
|
+
```
|
package/docs/functions/hello.md
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
> **hello**(`konsole?`): `Promise`\<`string`\>
|
|
10
10
|
|
|
11
|
-
Defined in: [hello.ts:31](https://github.com/wtasg/node-lib/blob/
|
|
11
|
+
Defined in: [hello.ts:31](https://github.com/wtasg/node-lib/blob/e8728afafd1c71a23332e0e226c750c68ec8ae80/src/hello.ts#L31)
|
|
12
12
|
|
|
13
13
|
A sample function that should work to test if lib is installed correctly.
|
|
14
14
|
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
> **parseUserAgent**(`ua`): [`UserAgentInfo`](../interfaces/UserAgentInfo.md)
|
|
10
10
|
|
|
11
|
-
Defined in: [user-agent.ts:48](https://github.com/wtasg/node-lib/blob/
|
|
11
|
+
Defined in: [user-agent.ts:48](https://github.com/wtasg/node-lib/blob/e8728afafd1c71a23332e0e226c750c68ec8ae80/src/user-agent.ts#L48)
|
|
12
12
|
|
|
13
13
|
Parses a user-agent string into a UserAgentInfo object.
|
|
14
14
|
|
package/docs/functions/pojo.md
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
> **pojo**\<`T`\>(`instance`): `Record`\<`string`, `unknown`\>
|
|
10
10
|
|
|
11
|
-
Defined in: [pojo.ts:10](https://github.com/wtasg/node-lib/blob/
|
|
11
|
+
Defined in: [pojo.ts:10](https://github.com/wtasg/node-lib/blob/e8728afafd1c71a23332e0e226c750c68ec8ae80/src/pojo.ts#L10)
|
|
12
12
|
|
|
13
13
|
Convert a class instance into a plain JavaScript object.
|
|
14
14
|
Copies only the instance's own enumerable data properties
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
[**@wtasnorg/node-lib**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@wtasnorg/node-lib](../README.md) / popcount32
|
|
6
|
+
|
|
7
|
+
# Function: popcount32()
|
|
8
|
+
|
|
9
|
+
> **popcount32**(`value`): `number`
|
|
10
|
+
|
|
11
|
+
Defined in: [bits.ts:52](https://github.com/wtasg/node-lib/blob/e8728afafd1c71a23332e0e226c750c68ec8ae80/src/bits.ts#L52)
|
|
12
|
+
|
|
13
|
+
Count set bits in an unsigned 32-bit representation of a number.
|
|
14
|
+
|
|
15
|
+
## Parameters
|
|
16
|
+
|
|
17
|
+
### value
|
|
18
|
+
|
|
19
|
+
`number`
|
|
20
|
+
|
|
21
|
+
Number interpreted as uint32.
|
|
22
|
+
|
|
23
|
+
## Returns
|
|
24
|
+
|
|
25
|
+
`number`
|
|
26
|
+
|
|
27
|
+
Number of set bits (0-32).
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
[**@wtasnorg/node-lib**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@wtasnorg/node-lib](../README.md) / popcount64
|
|
6
|
+
|
|
7
|
+
# Function: popcount64()
|
|
8
|
+
|
|
9
|
+
> **popcount64**(`value`): `number`
|
|
10
|
+
|
|
11
|
+
Defined in: [bits.ts:69](https://github.com/wtasg/node-lib/blob/e8728afafd1c71a23332e0e226c750c68ec8ae80/src/bits.ts#L69)
|
|
12
|
+
|
|
13
|
+
Count set bits in the low 64 bits of a number or bigint.
|
|
14
|
+
|
|
15
|
+
## Parameters
|
|
16
|
+
|
|
17
|
+
### value
|
|
18
|
+
|
|
19
|
+
Input value. For `number`, it must be a non-negative safe integer.
|
|
20
|
+
|
|
21
|
+
`number` | `bigint`
|
|
22
|
+
|
|
23
|
+
## Returns
|
|
24
|
+
|
|
25
|
+
`number`
|
|
26
|
+
|
|
27
|
+
Number of set bits (0-64).
|
|
28
|
+
|
|
29
|
+
## Throws
|
|
30
|
+
|
|
31
|
+
If `value` is negative or an unsafe integer.
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# Interface: FileSystemDependencies
|
|
8
8
|
|
|
9
|
-
Defined in: [find.ts:3](https://github.com/wtasg/node-lib/blob/
|
|
9
|
+
Defined in: [find.ts:3](https://github.com/wtasg/node-lib/blob/e8728afafd1c71a23332e0e226c750c68ec8ae80/src/find.ts#L3)
|
|
10
10
|
|
|
11
11
|
## Properties
|
|
12
12
|
|
|
@@ -14,7 +14,7 @@ Defined in: [find.ts:3](https://github.com/wtasg/node-lib/blob/7baf8669b7042dca5
|
|
|
14
14
|
|
|
15
15
|
> **readdir**: (`_path`, `_opts`) => `Promise`\<`object`[]\>
|
|
16
16
|
|
|
17
|
-
Defined in: [find.ts:4](https://github.com/wtasg/node-lib/blob/
|
|
17
|
+
Defined in: [find.ts:4](https://github.com/wtasg/node-lib/blob/e8728afafd1c71a23332e0e226c750c68ec8ae80/src/find.ts#L4)
|
|
18
18
|
|
|
19
19
|
#### Parameters
|
|
20
20
|
|
|
@@ -38,7 +38,7 @@ Defined in: [find.ts:4](https://github.com/wtasg/node-lib/blob/7baf8669b7042dca5
|
|
|
38
38
|
|
|
39
39
|
> **stat**: (`_path`) => `Promise`\<\{ `isDirectory`: `boolean`; \}\>
|
|
40
40
|
|
|
41
|
-
Defined in: [find.ts:5](https://github.com/wtasg/node-lib/blob/
|
|
41
|
+
Defined in: [find.ts:5](https://github.com/wtasg/node-lib/blob/e8728afafd1c71a23332e0e226c750c68ec8ae80/src/find.ts#L5)
|
|
42
42
|
|
|
43
43
|
#### Parameters
|
|
44
44
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# Interface: FindDirectoriesOptions
|
|
8
8
|
|
|
9
|
-
Defined in: [find.ts:8](https://github.com/wtasg/node-lib/blob/
|
|
9
|
+
Defined in: [find.ts:8](https://github.com/wtasg/node-lib/blob/e8728afafd1c71a23332e0e226c750c68ec8ae80/src/find.ts#L8)
|
|
10
10
|
|
|
11
11
|
## Properties
|
|
12
12
|
|
|
@@ -14,7 +14,7 @@ Defined in: [find.ts:8](https://github.com/wtasg/node-lib/blob/7baf8669b7042dca5
|
|
|
14
14
|
|
|
15
15
|
> `optional` **allowlist**: `string`[] \| (`_absPath`, `_name`) => `boolean`
|
|
16
16
|
|
|
17
|
-
Defined in: [find.ts:11](https://github.com/wtasg/node-lib/blob/
|
|
17
|
+
Defined in: [find.ts:11](https://github.com/wtasg/node-lib/blob/e8728afafd1c71a23332e0e226c750c68ec8ae80/src/find.ts#L11)
|
|
18
18
|
|
|
19
19
|
***
|
|
20
20
|
|
|
@@ -22,7 +22,7 @@ Defined in: [find.ts:11](https://github.com/wtasg/node-lib/blob/7baf8669b7042dca
|
|
|
22
22
|
|
|
23
23
|
> `optional` **blocklist**: `string`[] \| (`_absPath`, `_name`) => `boolean`
|
|
24
24
|
|
|
25
|
-
Defined in: [find.ts:12](https://github.com/wtasg/node-lib/blob/
|
|
25
|
+
Defined in: [find.ts:12](https://github.com/wtasg/node-lib/blob/e8728afafd1c71a23332e0e226c750c68ec8ae80/src/find.ts#L12)
|
|
26
26
|
|
|
27
27
|
***
|
|
28
28
|
|
|
@@ -30,7 +30,7 @@ Defined in: [find.ts:12](https://github.com/wtasg/node-lib/blob/7baf8669b7042dca
|
|
|
30
30
|
|
|
31
31
|
> `optional` **followSymlinks**: `boolean`
|
|
32
32
|
|
|
33
|
-
Defined in: [find.ts:10](https://github.com/wtasg/node-lib/blob/
|
|
33
|
+
Defined in: [find.ts:10](https://github.com/wtasg/node-lib/blob/e8728afafd1c71a23332e0e226c750c68ec8ae80/src/find.ts#L10)
|
|
34
34
|
|
|
35
35
|
***
|
|
36
36
|
|
|
@@ -38,4 +38,4 @@ Defined in: [find.ts:10](https://github.com/wtasg/node-lib/blob/7baf8669b7042dca
|
|
|
38
38
|
|
|
39
39
|
> `optional` **maxDepth**: `number`
|
|
40
40
|
|
|
41
|
-
Defined in: [find.ts:9](https://github.com/wtasg/node-lib/blob/
|
|
41
|
+
Defined in: [find.ts:9](https://github.com/wtasg/node-lib/blob/e8728afafd1c71a23332e0e226c750c68ec8ae80/src/find.ts#L9)
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# Interface: UserAgentInfo
|
|
8
8
|
|
|
9
|
-
Defined in: [user-agent.ts:4](https://github.com/wtasg/node-lib/blob/
|
|
9
|
+
Defined in: [user-agent.ts:4](https://github.com/wtasg/node-lib/blob/e8728afafd1c71a23332e0e226c750c68ec8ae80/src/user-agent.ts#L4)
|
|
10
10
|
|
|
11
11
|
Information extracted from a user-agent string.
|
|
12
12
|
|
|
@@ -16,7 +16,7 @@ Information extracted from a user-agent string.
|
|
|
16
16
|
|
|
17
17
|
> **browser**: `string`
|
|
18
18
|
|
|
19
|
-
Defined in: [user-agent.ts:8](https://github.com/wtasg/node-lib/blob/
|
|
19
|
+
Defined in: [user-agent.ts:8](https://github.com/wtasg/node-lib/blob/e8728afafd1c71a23332e0e226c750c68ec8ae80/src/user-agent.ts#L8)
|
|
20
20
|
|
|
21
21
|
Browser name (e.g., Chrome, Firefox, Safari, Edge, Opera, Other).
|
|
22
22
|
|
|
@@ -26,7 +26,7 @@ Browser name (e.g., Chrome, Firefox, Safari, Edge, Opera, Other).
|
|
|
26
26
|
|
|
27
27
|
> **device**: `string`
|
|
28
28
|
|
|
29
|
-
Defined in: [user-agent.ts:20](https://github.com/wtasg/node-lib/blob/
|
|
29
|
+
Defined in: [user-agent.ts:20](https://github.com/wtasg/node-lib/blob/e8728afafd1c71a23332e0e226c750c68ec8ae80/src/user-agent.ts#L20)
|
|
30
30
|
|
|
31
31
|
Device type (e.g., Mobile, Tablet, Desktop, Other).
|
|
32
32
|
|
|
@@ -36,7 +36,7 @@ Device type (e.g., Mobile, Tablet, Desktop, Other).
|
|
|
36
36
|
|
|
37
37
|
> **engine**: `string`
|
|
38
38
|
|
|
39
|
-
Defined in: [user-agent.ts:24](https://github.com/wtasg/node-lib/blob/
|
|
39
|
+
Defined in: [user-agent.ts:24](https://github.com/wtasg/node-lib/blob/e8728afafd1c71a23332e0e226c750c68ec8ae80/src/user-agent.ts#L24)
|
|
40
40
|
|
|
41
41
|
Rendering engine (e.g., Blink, WebKit, Gecko, Presto, Other).
|
|
42
42
|
|
|
@@ -46,7 +46,7 @@ Rendering engine (e.g., Blink, WebKit, Gecko, Presto, Other).
|
|
|
46
46
|
|
|
47
47
|
> **os**: `string`
|
|
48
48
|
|
|
49
|
-
Defined in: [user-agent.ts:16](https://github.com/wtasg/node-lib/blob/
|
|
49
|
+
Defined in: [user-agent.ts:16](https://github.com/wtasg/node-lib/blob/e8728afafd1c71a23332e0e226c750c68ec8ae80/src/user-agent.ts#L16)
|
|
50
50
|
|
|
51
51
|
Operating system (e.g., Windows, macOS, Linux, iOS, Android, Other).
|
|
52
52
|
|
|
@@ -56,6 +56,6 @@ Operating system (e.g., Windows, macOS, Linux, iOS, Android, Other).
|
|
|
56
56
|
|
|
57
57
|
> **version**: `string`
|
|
58
58
|
|
|
59
|
-
Defined in: [user-agent.ts:12](https://github.com/wtasg/node-lib/blob/
|
|
59
|
+
Defined in: [user-agent.ts:12](https://github.com/wtasg/node-lib/blob/e8728afafd1c71a23332e0e226c750c68ec8ae80/src/user-agent.ts#L12)
|
|
60
60
|
|
|
61
61
|
Browser version (e.g., 120.0.0.0).
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
[**@wtasnorg/node-lib**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@wtasnorg/node-lib](../README.md) / Base32CharsetType
|
|
6
|
+
|
|
7
|
+
# Type Alias: Base32CharsetType
|
|
8
|
+
|
|
9
|
+
> **Base32CharsetType** = *typeof* [`Base32Charset`](../variables/Base32Charset.md)\[`number`\]
|
|
10
|
+
|
|
11
|
+
Defined in: [base32.ts:18](https://github.com/wtasg/node-lib/blob/e8728afafd1c71a23332e0e226c750c68ec8ae80/src/base32.ts#L18)
|
|
12
|
+
|
|
13
|
+
Base32 charset type.
|