UNPKG
@speckle/shared
Version:
latest (2.28.0)
2.28.0
2.27.2
2.27.1
2.26.9
2.26.8
2.26.7
2.26.6
2.26.5
2.26.4
2.26.3
2.26.2
2.26.1
2.26.0
2.25.9
2.25.8
2.25.7
2.25.4
2.25.1
2.25.0
2.24.2
2.24.0
2.23.23
2.23.22
2.23.21
2.23.20
2.23.19
2.23.16
2.23.15
2.23.14
2.23.13
2.23.12
2.23.11
2.23.10
2.23.9
2.23.8
2.23.7
2.23.6
2.23.5
2.23.4
2.23.3
2.23.2
2.23.1
2.23.0
2.22.6
2.22.5
2.22.4
2.22.3
2.22.2
2.22.1
2.22.0
2.21.2
2.21.1
2.21.0
2.20.6
2.20.5
2.20.4
2.20.3
2.20.2
2.20.1
2.20.0-alpha4
2.19.6
2.19.5
2.19.4
2.19.3
2.19.2
2.19.0
2.18.16
2.18.15
2.18.14
2.18.13
2.18.12
2.18.11
2.18.10
2.18.9
2.18.8
2.18.7
2.18.6
2.18.4
2.18.3
2.18.2
2.18.1
2.18.0
2.17.16
2.17.15
2.17.14
2.17.13
2.17.12
2.17.11
2.17.10
2.17.9
2.17.8
2.17.7
2.17.6
2.17.5
2.17.4
2.17.3
2.17.2
2.17.1
2.16.1-alpha.1
2.16.0
2.15.1
2.15.0
2.14.7
2.14.6
2.14.5
2.14.4
2.14.3
2.14.1
2.14.0
2.13.3
2.13.2
2.13.1
2.13.0
2.12.666
2.12.5
2.12.4
2.12.3
2.12.2
2.12.1
2.12.0
2.11.4
2.11.3
2.11.2
2.11.1
2.11.0
2.10.3
2.10.2
2.10.1
2.10.0
2.9.2
2.9.1
0.2.0
Shared code between various Speckle JS packages
speckle.systems
specklesystems/speckle-server
@speckle/shared
/
dist
/
esm
/
core
/
helpers
/
encoding.js
11 lines
•
307 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export
const
safeParse
= (
json, guard
) => {
try
{
const
parsed =
JSON
.
parse
(json);
return
guard ? (
guard
(parsed) ? parsed :
null
) : parsed; }
catch
{
return
null
; } };
//# sourceMappingURL=encoding.js.map