msgpackr 1.6.1 → 1.7.0-alpha2

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/node-index.js CHANGED
@@ -1,24 +1,25 @@
1
- export { Packr, Encoder, addExtension, pack, encode, NEVER, ALWAYS, DECIMAL_ROUND, DECIMAL_FIT } from './pack.js'
2
- export { Unpackr, Decoder, C1, unpack, unpackMultiple, decode, FLOAT32_OPTIONS, clearSource, roundFloat32, isNativeAccelerationEnabled } from './unpack.js'
3
- export { PackrStream, UnpackrStream, PackrStream as EncoderStream, UnpackrStream as DecoderStream } from './stream.js'
4
- export { decodeIter, encodeIter } from './iterators.js'
5
- export const useRecords = false
6
- export const mapsAsObjects = true
7
- import { setExtractor } from './unpack.js'
8
- import { createRequire } from 'module'
9
-
10
- const nativeAccelerationDisabled = process.env.MSGPACKR_NATIVE_ACCELERATION_DISABLED !== undefined && process.env.MSGPACKR_NATIVE_ACCELERATION_DISABLED.toLowerCase() === 'true';
11
-
12
- if (!nativeAccelerationDisabled) {
13
- let extractor
14
- try {
15
- if (typeof require == 'function')
16
- extractor = require('msgpackr-extract')
17
- else
18
- extractor = createRequire(import.meta.url)('msgpackr-extract')
19
- if (extractor)
20
- setExtractor(extractor.extractStrings)
21
- } catch (error) {
22
- // native module is optional
23
- }
1
+ export { Packr, Encoder, addExtension, pack, encode, NEVER, ALWAYS, DECIMAL_ROUND, DECIMAL_FIT } from './pack.js'
2
+ export { Unpackr, Decoder, C1, unpack, unpackMultiple, decode, FLOAT32_OPTIONS, clearSource, roundFloat32, isNativeAccelerationEnabled } from './unpack.js'
3
+ import './struct.js'
4
+ export { PackrStream, UnpackrStream, PackrStream as EncoderStream, UnpackrStream as DecoderStream } from './stream.js'
5
+ export { decodeIter, encodeIter } from './iterators.js'
6
+ export const useRecords = false
7
+ export const mapsAsObjects = true
8
+ import { setExtractor } from './unpack.js'
9
+ import { createRequire } from 'module'
10
+
11
+ const nativeAccelerationDisabled = process.env.MSGPACKR_NATIVE_ACCELERATION_DISABLED !== undefined && process.env.MSGPACKR_NATIVE_ACCELERATION_DISABLED.toLowerCase() === 'true';
12
+
13
+ if (!nativeAccelerationDisabled) {
14
+ let extractor
15
+ try {
16
+ if (typeof require == 'function')
17
+ extractor = require('msgpackr-extract')
18
+ else
19
+ extractor = createRequire(import.meta.url)('msgpackr-extract')
20
+ if (extractor)
21
+ setExtractor(extractor.extractStrings)
22
+ } catch (error) {
23
+ // native module is optional
24
+ }
24
25
  }