Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add FLOAT32_OPTIONS enum declaration to JS.
  • Loading branch information
mattbishop committed Feb 2, 2021
commit 536f32190abd1382840da37ef261dc4ba71bd21d
3 changes: 1 addition & 2 deletions unpack.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ export enum FLOAT32_OPTIONS {
NEVER = 0,
ALWAYS = 1,
DECIMAL_ROUND = 3,
DECIMAL_FIT= 4
DECIMAL_FIT = 4
}

interface Options {
useFloat32?: FLOAT32_OPTIONS
useRecords?: boolean
Expand Down
8 changes: 8 additions & 0 deletions unpack.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@ class C1Type {}
const C1 = new C1Type()
C1.name = 'MessagePack 0xC1'

let FLOAT32_OPTIONS;
(function (FLOAT32_OPTIONS) {
FLOAT32_OPTIONS[FLOAT32_OPTIONS["NEVER"] = 0] = "NEVER";
FLOAT32_OPTIONS[FLOAT32_OPTIONS["ALWAYS"] = 1] = "ALWAYS";
FLOAT32_OPTIONS[FLOAT32_OPTIONS["DECIMAL_ROUND"] = 3] = "DECIMAL_ROUND";
FLOAT32_OPTIONS[FLOAT32_OPTIONS["DECIMAL_FIT"] = 4] = "DECIMAL_FIT";
})(FLOAT32_OPTIONS = exports.FLOAT32_OPTIONS || (exports.FLOAT32_OPTIONS = {}));

class Unpackr {
constructor(options) {
if (options) {
Expand Down