@xylabs/platform 5.0.80 → 5.0.81
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/README.md +113 -1
- package/package.json +5 -9
- package/src/browser/index.ts +0 -15
- package/src/index-browser.ts +0 -1
- package/src/index-node.ts +0 -1
- package/src/node/index.ts +0 -13
package/README.md
CHANGED
|
@@ -17,7 +17,119 @@ Base functionality used throughout XY Labs TypeScript/JavaScript libraries
|
|
|
17
17
|
|
|
18
18
|
## Reference
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
**@xylabs/platform**
|
|
21
|
+
|
|
22
|
+
***
|
|
23
|
+
|
|
24
|
+
## Modules
|
|
25
|
+
|
|
26
|
+
- [index-browser](#index-browser/README)
|
|
27
|
+
- [index-node](#index-node/README)
|
|
28
|
+
|
|
29
|
+
### index-browser
|
|
30
|
+
|
|
31
|
+
### functions
|
|
32
|
+
|
|
33
|
+
### <a id="isBrowser"></a>isBrowser
|
|
34
|
+
|
|
35
|
+
[**@xylabs/platform**](#../../README)
|
|
36
|
+
|
|
37
|
+
***
|
|
38
|
+
|
|
39
|
+
```ts
|
|
40
|
+
function isBrowser(): boolean;
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Returns
|
|
44
|
+
|
|
45
|
+
`boolean`
|
|
46
|
+
|
|
47
|
+
### <a id="isNode"></a>isNode
|
|
48
|
+
|
|
49
|
+
[**@xylabs/platform**](#../../README)
|
|
50
|
+
|
|
51
|
+
***
|
|
52
|
+
|
|
53
|
+
```ts
|
|
54
|
+
function isNode(): boolean;
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Returns
|
|
58
|
+
|
|
59
|
+
`boolean`
|
|
60
|
+
|
|
61
|
+
### <a id="isWebworker"></a>isWebworker
|
|
62
|
+
|
|
63
|
+
[**@xylabs/platform**](#../../README)
|
|
64
|
+
|
|
65
|
+
***
|
|
66
|
+
|
|
67
|
+
```ts
|
|
68
|
+
function isWebworker(): boolean;
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## Returns
|
|
72
|
+
|
|
73
|
+
`boolean`
|
|
74
|
+
|
|
75
|
+
### variables
|
|
76
|
+
|
|
77
|
+
### <a id="subtle"></a>subtle
|
|
78
|
+
|
|
79
|
+
[**@xylabs/platform**](#../../README)
|
|
80
|
+
|
|
81
|
+
***
|
|
82
|
+
|
|
83
|
+
```ts
|
|
84
|
+
const subtle: SubtleCrypto;
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### index-node
|
|
88
|
+
|
|
89
|
+
### functions
|
|
90
|
+
|
|
91
|
+
### <a id="isBrowser"></a>isBrowser
|
|
92
|
+
|
|
93
|
+
[**@xylabs/platform**](#../../README)
|
|
94
|
+
|
|
95
|
+
***
|
|
96
|
+
|
|
97
|
+
```ts
|
|
98
|
+
function isBrowser(): boolean;
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
## Returns
|
|
102
|
+
|
|
103
|
+
`boolean`
|
|
104
|
+
|
|
105
|
+
### <a id="isNode"></a>isNode
|
|
106
|
+
|
|
107
|
+
[**@xylabs/platform**](#../../README)
|
|
108
|
+
|
|
109
|
+
***
|
|
110
|
+
|
|
111
|
+
```ts
|
|
112
|
+
function isNode(): boolean;
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
## Returns
|
|
116
|
+
|
|
117
|
+
`boolean`
|
|
118
|
+
|
|
119
|
+
### <a id="isWebworker"></a>isWebworker
|
|
120
|
+
|
|
121
|
+
[**@xylabs/platform**](#../../README)
|
|
122
|
+
|
|
123
|
+
***
|
|
124
|
+
|
|
125
|
+
```ts
|
|
126
|
+
function isWebworker(): boolean;
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
## Returns
|
|
130
|
+
|
|
131
|
+
`boolean`
|
|
132
|
+
|
|
21
133
|
|
|
22
134
|
Part of [sdk-js](https://www.npmjs.com/package/@xyo-network/sdk-js)
|
|
23
135
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xylabs/platform",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.81",
|
|
4
4
|
"description": "Base functionality used throughout XY Labs TypeScript/JavaScript libraries",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"platform",
|
|
@@ -30,32 +30,28 @@
|
|
|
30
30
|
".": {
|
|
31
31
|
"browser": {
|
|
32
32
|
"types": "./dist/browser/index-browser.d.ts",
|
|
33
|
-
"source": "./src/browser/index.ts",
|
|
34
33
|
"default": "./dist/browser/index-browser.mjs"
|
|
35
34
|
},
|
|
36
35
|
"node": {
|
|
37
36
|
"types": "./dist/node/index-node.d.ts",
|
|
38
|
-
"source": "./src/node/index.ts",
|
|
39
37
|
"default": "./dist/node/index-node.mjs"
|
|
40
38
|
}
|
|
41
39
|
},
|
|
42
40
|
"./package.json": "./package.json"
|
|
43
41
|
},
|
|
44
42
|
"module": "./dist/browser/index-browser.mjs",
|
|
45
|
-
"source": "./src/browser/index.ts",
|
|
46
43
|
"types": "./dist/browser/index-browser.d.ts",
|
|
47
44
|
"files": [
|
|
48
45
|
"dist",
|
|
49
|
-
"src",
|
|
50
46
|
"!**/*.bench.*",
|
|
51
47
|
"!**/*.spec.*",
|
|
52
48
|
"!**/*.test.*"
|
|
53
49
|
],
|
|
54
50
|
"devDependencies": {
|
|
55
|
-
"@
|
|
56
|
-
"@xylabs/
|
|
57
|
-
"
|
|
58
|
-
"
|
|
51
|
+
"@xylabs/ts-scripts-yarn3": "~7.4.11",
|
|
52
|
+
"@xylabs/tsconfig": "~7.4.11",
|
|
53
|
+
"typescript": "~5.9.3",
|
|
54
|
+
"vitest": "~4.0.18"
|
|
59
55
|
},
|
|
60
56
|
"engines": {
|
|
61
57
|
"node": ">=18"
|
package/src/browser/index.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { subtle as subtleType } from 'node:crypto'
|
|
2
|
-
|
|
3
|
-
export const isBrowser = () => {
|
|
4
|
-
return !isWebworker() && globalThis.constructor?.name === 'Window'
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
export const isWebworker = () => {
|
|
8
|
-
return typeof globalThis === 'object' && globalThis.constructor?.name === 'DedicatedWorkerGlobalScope'
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export const isNode = () => {
|
|
12
|
-
return false
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export const subtle = globalThis.crypto.subtle as typeof subtleType
|
package/src/index-browser.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './browser/index.ts'
|
package/src/index-node.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './node/index.ts'
|