diff --git a/src/decimal128.ts b/src/decimal128.ts index d3d197d6..ccf35743 100644 --- a/src/decimal128.ts +++ b/src/decimal128.ts @@ -12,59 +12,14 @@ const MAX_DIGITS = 34; // Nan value bits as 32 bit values (due to lack of longs) const NAN_BUFFER = [ - 0x7c, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00 + 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ].reverse(); // Infinity value bits 32 bit values (due to lack of longs) const INF_NEGATIVE_BUFFER = [ - 0xf8, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00 + 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ].reverse(); const INF_POSITIVE_BUFFER = [ - 0x78, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00 + 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ].reverse(); const EXPONENT_REGEX = /^([-+])?(\d+)?$/; diff --git a/src/long.ts b/src/long.ts index 977a9d39..6f79fae4 100644 --- a/src/long.ts +++ b/src/long.ts @@ -27,13 +27,13 @@ let wasm: LongWASMHelpers | undefined = undefined; declare const WebAssembly: any; try { - wasm = (new WebAssembly.Instance( + wasm = new WebAssembly.Instance( new WebAssembly.Module( // prettier-ignore new Uint8Array([0, 97, 115, 109, 1, 0, 0, 0, 1, 13, 2, 96, 0, 1, 127, 96, 4, 127, 127, 127, 127, 1, 127, 3, 7, 6, 0, 1, 1, 1, 1, 1, 6, 6, 1, 127, 1, 65, 0, 11, 7, 50, 6, 3, 109, 117, 108, 0, 1, 5, 100, 105, 118, 95, 115, 0, 2, 5, 100, 105, 118, 95, 117, 0, 3, 5, 114, 101, 109, 95, 115, 0, 4, 5, 114, 101, 109, 95, 117, 0, 5, 8, 103, 101, 116, 95, 104, 105, 103, 104, 0, 0, 10, 191, 1, 6, 4, 0, 35, 0, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 126, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 127, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 128, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 129, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 130, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11]) ), {} - ).exports as unknown) as LongWASMHelpers; + ).exports as unknown as LongWASMHelpers; } catch { // no wasm support } diff --git a/src/map.ts b/src/map.ts index e5eb32a6..96a76486 100644 --- a/src/map.ts +++ b/src/map.ts @@ -31,7 +31,7 @@ if (Object.prototype.hasOwnProperty.call(bsonGlobal, 'Map')) { bsonMap = bsonGlobal.Map; } else { // We will return a polyfill - bsonMap = (class Map { + bsonMap = class Map { private _keys: string[]; private _values: Record; constructor(array: [string, any][] = []) { @@ -133,7 +133,7 @@ if (Object.prototype.hasOwnProperty.call(bsonGlobal, 'Map')) { get size() { return this._keys.length; } - } as unknown) as MapConstructor; + } as unknown as MapConstructor; } export { bsonMap as Map }; diff --git a/src/parser/deserializer.ts b/src/parser/deserializer.ts index 90b3afbe..d197b86c 100644 --- a/src/parser/deserializer.ts +++ b/src/parser/deserializer.ts @@ -246,9 +246,11 @@ function deserializeObject( if (fieldsAsRaw && fieldsAsRaw[name]) { arrayOptions = {}; for (const n in options) { - (arrayOptions as { - [key: string]: DeserializeOptions[keyof DeserializeOptions]; - })[n] = options[n as keyof DeserializeOptions]; + ( + arrayOptions as { + [key: string]: DeserializeOptions[keyof DeserializeOptions]; + } + )[n] = options[n as keyof DeserializeOptions]; } arrayOptions['raw'] = true; } diff --git a/src/parser/utils.ts b/src/parser/utils.ts index 3f0dcc7c..e34ae131 100644 --- a/src/parser/utils.ts +++ b/src/parser/utils.ts @@ -121,5 +121,5 @@ export function deprecate(fn: T, message: string): T { } return fn.apply(this, args); } - return (deprecated as unknown) as T; + return deprecated as unknown as T; } diff --git a/src/regexp.ts b/src/regexp.ts index 76d1f5e9..667d3d5a 100644 --- a/src/regexp.ts +++ b/src/regexp.ts @@ -73,7 +73,7 @@ export class BSONRegExp { if (typeof doc.$regex !== 'string') { // This is for $regex query operators that have extended json values. if (doc.$regex._bsontype === 'BSONRegExp') { - return (doc as unknown) as BSONRegExp; + return doc as unknown as BSONRegExp; } } else { return new BSONRegExp(doc.$regex, BSONRegExp.parseOptions(doc.$options)); diff --git a/src/timestamp.ts b/src/timestamp.ts index d20b6b5f..098420d4 100644 --- a/src/timestamp.ts +++ b/src/timestamp.ts @@ -7,7 +7,8 @@ export type LongWithoutOverrides = new (low: number | Long, high?: number, unsig [P in Exclude]: Long[P]; }; /** @public */ -export const LongWithoutOverridesClass: LongWithoutOverrides = (Long as unknown) as LongWithoutOverrides; +export const LongWithoutOverridesClass: LongWithoutOverrides = + Long as unknown as LongWithoutOverrides; /** @public */ export interface TimestampExtended { diff --git a/src/uuid_utils.ts b/src/uuid_utils.ts index 5c5166c2..edae0da5 100644 --- a/src/uuid_utils.ts +++ b/src/uuid_utils.ts @@ -1,7 +1,8 @@ import { Buffer } from 'buffer'; // Validation regex for v4 uuid (validates with or without dashes) -const VALIDATION_REGEX = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|[0-9a-f]{12}4[0-9a-f]{3}[89ab][0-9a-f]{15})$/i; +const VALIDATION_REGEX = + /^(?:[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|[0-9a-f]{12}4[0-9a-f]{3}[89ab][0-9a-f]{15})$/i; export const uuidValidateString = (str: string): boolean => typeof str === 'string' && VALIDATION_REGEX.test(str); diff --git a/test/node/bson_test.js b/test/node/bson_test.js index 92646c1b..b5541da6 100644 --- a/test/node/bson_test.js +++ b/test/node/bson_test.js @@ -24,7 +24,8 @@ const { inspect } = require('util'); /** * Module for parsing an ISO 8601 formatted string into a Date object. */ -const ISO_REGEX = /^(\d{4})(-(\d{2})(-(\d{2})(T(\d{2}):(\d{2})(:(\d{2})(\.(\d+))?)?(Z|((\+|-)(\d{2}):(\d{2}))))?)?)?$/; +const ISO_REGEX = + /^(\d{4})(-(\d{2})(-(\d{2})(T(\d{2}):(\d{2})(:(\d{2})(\.(\d+))?)?(Z|((\+|-)(\d{2}):(\d{2}))))?)?)?$/; var ISODate = function (string) { if (typeof string.getTime === 'function') { return string; @@ -122,288 +123,18 @@ describe('BSON', function () { */ it('Should Correctly Deserialize object with all types', function (done) { var bytes = [ - 26, - 1, - 0, - 0, - 7, - 95, - 105, - 100, - 0, - 161, - 190, - 98, - 75, - 118, - 169, - 3, - 0, - 0, - 3, - 0, - 0, - 4, - 97, - 114, - 114, - 97, - 121, - 0, - 26, - 0, - 0, - 0, - 16, - 48, - 0, - 1, - 0, - 0, - 0, - 16, - 49, - 0, - 2, - 0, - 0, - 0, - 16, - 50, - 0, - 3, - 0, - 0, - 0, - 0, - 2, - 115, - 116, - 114, - 105, - 110, - 103, - 0, - 6, - 0, - 0, - 0, - 104, - 101, - 108, - 108, - 111, - 0, - 3, - 104, - 97, - 115, - 104, - 0, - 19, - 0, - 0, - 0, - 16, - 97, - 0, - 1, - 0, - 0, - 0, - 16, - 98, - 0, - 2, - 0, - 0, - 0, - 0, - 9, - 100, - 97, - 116, - 101, - 0, - 161, - 190, - 98, - 75, - 0, - 0, - 0, - 0, - 7, - 111, - 105, - 100, - 0, - 161, - 190, - 98, - 75, - 90, - 217, - 18, - 0, - 0, - 1, - 0, - 0, - 5, - 98, - 105, - 110, - 97, - 114, - 121, - 0, - 7, - 0, - 0, - 0, - 2, - 3, - 0, - 0, - 0, - 49, - 50, - 51, - 16, - 105, - 110, - 116, - 0, - 42, - 0, - 0, - 0, - 1, - 102, - 108, - 111, - 97, - 116, - 0, - 223, - 224, - 11, - 147, - 169, - 170, - 64, - 64, - 11, - 114, - 101, - 103, - 101, - 120, - 112, - 0, - 102, - 111, - 111, - 98, - 97, - 114, - 0, - 105, - 0, - 8, - 98, - 111, - 111, - 108, - 101, - 97, - 110, - 0, - 1, - 15, - 119, - 104, - 101, - 114, - 101, - 0, - 25, - 0, - 0, - 0, - 12, - 0, - 0, - 0, - 116, - 104, - 105, - 115, - 46, - 120, - 32, - 61, - 61, - 32, - 51, - 0, - 5, - 0, - 0, - 0, - 0, - 3, - 100, - 98, - 114, - 101, - 102, - 0, - 37, - 0, - 0, - 0, - 2, - 36, - 114, - 101, - 102, - 0, - 5, - 0, - 0, - 0, - 116, - 101, - 115, - 116, - 0, - 7, - 36, - 105, - 100, - 0, - 161, - 190, - 98, - 75, - 2, - 180, - 1, - 0, - 0, - 2, - 0, - 0, - 0, - 10, - 110, - 117, - 108, - 108, - 0, - 0 + 26, 1, 0, 0, 7, 95, 105, 100, 0, 161, 190, 98, 75, 118, 169, 3, 0, 0, 3, 0, 0, 4, 97, 114, + 114, 97, 121, 0, 26, 0, 0, 0, 16, 48, 0, 1, 0, 0, 0, 16, 49, 0, 2, 0, 0, 0, 16, 50, 0, 3, 0, + 0, 0, 0, 2, 115, 116, 114, 105, 110, 103, 0, 6, 0, 0, 0, 104, 101, 108, 108, 111, 0, 3, 104, + 97, 115, 104, 0, 19, 0, 0, 0, 16, 97, 0, 1, 0, 0, 0, 16, 98, 0, 2, 0, 0, 0, 0, 9, 100, 97, + 116, 101, 0, 161, 190, 98, 75, 0, 0, 0, 0, 7, 111, 105, 100, 0, 161, 190, 98, 75, 90, 217, 18, + 0, 0, 1, 0, 0, 5, 98, 105, 110, 97, 114, 121, 0, 7, 0, 0, 0, 2, 3, 0, 0, 0, 49, 50, 51, 16, + 105, 110, 116, 0, 42, 0, 0, 0, 1, 102, 108, 111, 97, 116, 0, 223, 224, 11, 147, 169, 170, 64, + 64, 11, 114, 101, 103, 101, 120, 112, 0, 102, 111, 111, 98, 97, 114, 0, 105, 0, 8, 98, 111, + 111, 108, 101, 97, 110, 0, 1, 15, 119, 104, 101, 114, 101, 0, 25, 0, 0, 0, 12, 0, 0, 0, 116, + 104, 105, 115, 46, 120, 32, 61, 61, 32, 51, 0, 5, 0, 0, 0, 0, 3, 100, 98, 114, 101, 102, 0, + 37, 0, 0, 0, 2, 36, 114, 101, 102, 0, 5, 0, 0, 0, 116, 101, 115, 116, 0, 7, 36, 105, 100, 0, + 161, 190, 98, 75, 2, 180, 1, 0, 0, 2, 0, 0, 0, 10, 110, 117, 108, 108, 0, 0 ]; let serialized_data = ''; diff --git a/test/node/db_pointer_tests.js b/test/node/db_pointer_tests.js index 7da81f70..1777a773 100644 --- a/test/node/db_pointer_tests.js +++ b/test/node/db_pointer_tests.js @@ -5,46 +5,18 @@ const BSON = require('../register-bson'); // 0x0C foo\0 \0\0\07 String.fromCharCode(0x41, 0x42, 0xfffd, 0x43, 0x44) 12 const bsonSnippet = Buffer.from([ // Size - 34, - 0, - 0, - 0, + 34, 0, 0, 0, // BSON type for DBPointer 0x0c, // CString Label Foo - 0x66, - 0x6f, - 0x6f, - 0, + 0x66, 0x6f, 0x6f, 0, // Length of UTF8 string "AB�CD" - 8, - 0, - 0, - 0, - 0x41, - 0x42, - 0xef, - 0xbf, - 0xbd, - 0x43, - 0x44, - 0, + 8, 0, 0, 0, 0x41, 0x42, 0xef, 0xbf, 0xbd, 0x43, 0x44, 0, // 12-bit pointer - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9, - 10, - 11, - 12, + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, // null terminator 0 diff --git a/test/node/decimal128_tests.js b/test/node/decimal128_tests.js index 3ed7051f..9789cf8e 100644 --- a/test/node/decimal128_tests.js +++ b/test/node/decimal128_tests.js @@ -5,62 +5,17 @@ const Decimal128 = BSON.Decimal128; var NAN = Buffer.from( [ - 0x7c, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00 + 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ].reverse() ); var INF_NEGATIVE_BUFFER = Buffer.from( [ - 0xf8, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00 + 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ].reverse() ); var INF_POSITIVE_BUFFER = Buffer.from( [ - 0x78, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00 + 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ].reverse() ); @@ -155,21 +110,7 @@ describe('Decimal128', function () { var result = Decimal128.fromString('1'); var bytes = Buffer.from( [ - 0x30, - 0x40, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, + 0x30, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 ].reverse() ); @@ -179,21 +120,7 @@ describe('Decimal128', function () { result = Decimal128.fromString('0'); bytes = Buffer.from( [ - 0x30, - 0x40, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, + 0x30, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ].reverse() ); @@ -203,21 +130,7 @@ describe('Decimal128', function () { result = Decimal128.fromString('-0'); bytes = Buffer.from( [ - 0xb0, - 0x40, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, + 0xb0, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ].reverse() ); @@ -227,21 +140,7 @@ describe('Decimal128', function () { result = Decimal128.fromString('-1'); bytes = Buffer.from( [ - 0xb0, - 0x40, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, + 0xb0, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 ].reverse() ); @@ -251,21 +150,7 @@ describe('Decimal128', function () { result = Decimal128.fromString('12345678901234567'); bytes = Buffer.from( [ - 0x30, - 0x40, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x2b, - 0xdc, - 0x54, - 0x5d, - 0x6b, - 0x4b, + 0x30, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2b, 0xdc, 0x54, 0x5d, 0x6b, 0x4b, 0x87 ].reverse() ); @@ -275,21 +160,7 @@ describe('Decimal128', function () { result = Decimal128.fromString('989898983458'); bytes = Buffer.from( [ - 0x30, - 0x40, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0xe6, - 0x7a, - 0x93, - 0xc8, + 0x30, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe6, 0x7a, 0x93, 0xc8, 0x22 ].reverse() ); @@ -299,21 +170,7 @@ describe('Decimal128', function () { result = Decimal128.fromString('-12345678901234567'); bytes = Buffer.from( [ - 0xb0, - 0x40, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x2b, - 0xdc, - 0x54, - 0x5d, - 0x6b, - 0x4b, + 0xb0, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2b, 0xdc, 0x54, 0x5d, 0x6b, 0x4b, 0x87 ].reverse() ); @@ -323,21 +180,7 @@ describe('Decimal128', function () { result = Decimal128.fromString('0.12345'); bytes = Buffer.from( [ - 0x30, - 0x36, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x30, + 0x30, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x39 ].reverse() ); @@ -347,21 +190,7 @@ describe('Decimal128', function () { result = Decimal128.fromString('0.0012345'); bytes = Buffer.from( [ - 0x30, - 0x32, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x30, + 0x30, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x39 ].reverse() ); @@ -371,21 +200,7 @@ describe('Decimal128', function () { result = Decimal128.fromString('00012345678901234567'); bytes = Buffer.from( [ - 0x30, - 0x40, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x2b, - 0xdc, - 0x54, - 0x5d, - 0x6b, - 0x4b, + 0x30, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2b, 0xdc, 0x54, 0x5d, 0x6b, 0x4b, 0x87 ].reverse() ); @@ -398,21 +213,7 @@ describe('Decimal128', function () { var result = Decimal128.fromString('10e0'); var bytes = Buffer.from( [ - 0x30, - 0x40, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, + 0x30, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a ].reverse() ); @@ -422,21 +223,7 @@ describe('Decimal128', function () { result = Decimal128.fromString('1e1'); bytes = Buffer.from( [ - 0x30, - 0x42, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, + 0x30, 0x42, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 ].reverse() ); @@ -446,21 +233,7 @@ describe('Decimal128', function () { result = Decimal128.fromString('10e-1'); bytes = Buffer.from( [ - 0x30, - 0x3e, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, + 0x30, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a ].reverse() ); @@ -470,21 +243,7 @@ describe('Decimal128', function () { result = Decimal128.fromString('12345678901234567e6111'); bytes = Buffer.from( [ - 0x5f, - 0xfe, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x2b, - 0xdc, - 0x54, - 0x5d, - 0x6b, - 0x4b, + 0x5f, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2b, 0xdc, 0x54, 0x5d, 0x6b, 0x4b, 0x87 ].reverse() ); @@ -494,21 +253,7 @@ describe('Decimal128', function () { result = Decimal128.fromString('1e-6176'); bytes = Buffer.from( [ - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 ].reverse() ); @@ -518,21 +263,7 @@ describe('Decimal128', function () { result = Decimal128.fromString('-100E-10'); bytes = Buffer.from( [ - 0xb0, - 0x2c, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, + 0xb0, 0x2c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x64 ].reverse() ); @@ -542,21 +273,7 @@ describe('Decimal128', function () { result = Decimal128.fromString('10.50E8'); bytes = Buffer.from( [ - 0x30, - 0x4c, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x04, + 0x30, 0x4c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x1a ].reverse() ); @@ -569,21 +286,7 @@ describe('Decimal128', function () { var result = Decimal128.fromString('12345689012345789012345'); var bytes = Buffer.from( [ - 0x30, - 0x40, - 0x00, - 0x00, - 0x00, - 0x00, - 0x02, - 0x9d, - 0x42, - 0xda, - 0x3a, - 0x76, - 0xf9, - 0xe0, - 0xd9, + 0x30, 0x40, 0x00, 0x00, 0x00, 0x00, 0x02, 0x9d, 0x42, 0xda, 0x3a, 0x76, 0xf9, 0xe0, 0xd9, 0x79 ].reverse() ); @@ -593,21 +296,7 @@ describe('Decimal128', function () { result = Decimal128.fromString('1234567890123456789012345678901234'); bytes = Buffer.from( [ - 0x30, - 0x40, - 0x3c, - 0xde, - 0x6f, - 0xff, - 0x97, - 0x32, - 0xde, - 0x82, - 0x5c, - 0xd0, - 0x7e, - 0x96, - 0xaf, + 0x30, 0x40, 0x3c, 0xde, 0x6f, 0xff, 0x97, 0x32, 0xde, 0x82, 0x5c, 0xd0, 0x7e, 0x96, 0xaf, 0xf2 ].reverse() ); @@ -617,21 +306,7 @@ describe('Decimal128', function () { result = Decimal128.fromString('9.999999999999999999999999999999999E+6144'); bytes = Buffer.from( [ - 0x5f, - 0xff, - 0xed, - 0x09, - 0xbe, - 0xad, - 0x87, - 0xc0, - 0x37, - 0x8d, - 0x8e, - 0x63, - 0xff, - 0xff, - 0xff, + 0x5f, 0xff, 0xed, 0x09, 0xbe, 0xad, 0x87, 0xc0, 0x37, 0x8d, 0x8e, 0x63, 0xff, 0xff, 0xff, 0xff ].reverse() ); @@ -641,21 +316,7 @@ describe('Decimal128', function () { result = Decimal128.fromString('9.999999999999999999999999999999999E-6143'); bytes = Buffer.from( [ - 0x00, - 0x01, - 0xed, - 0x09, - 0xbe, - 0xad, - 0x87, - 0xc0, - 0x37, - 0x8d, - 0x8e, - 0x63, - 0xff, - 0xff, - 0xff, + 0x00, 0x01, 0xed, 0x09, 0xbe, 0xad, 0x87, 0xc0, 0x37, 0x8d, 0x8e, 0x63, 0xff, 0xff, 0xff, 0xff ].reverse() ); @@ -665,21 +326,7 @@ describe('Decimal128', function () { result = Decimal128.fromString('5.192296858534827628530496329220095E+33'); bytes = Buffer.from( [ - 0x30, - 0x40, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, + 0x30, 0x40, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff ].reverse() ); @@ -693,21 +340,7 @@ describe('Decimal128', function () { result = Decimal128.fromString('1000000000000000000000000000000000000000'); bytes = Buffer.from( [ - 0x30, - 0x4c, - 0x31, - 0x4d, - 0xc6, - 0x44, - 0x8d, - 0x93, - 0x38, - 0xc1, - 0x5b, - 0x0a, - 0x00, - 0x00, - 0x00, + 0x30, 0x4c, 0x31, 0x4d, 0xc6, 0x44, 0x8d, 0x93, 0x38, 0xc1, 0x5b, 0x0a, 0x00, 0x00, 0x00, 0x00 ].reverse() ); @@ -717,21 +350,7 @@ describe('Decimal128', function () { result = Decimal128.fromString('10000000000000000000000000000000000'); bytes = Buffer.from( [ - 0x30, - 0x42, - 0x31, - 0x4d, - 0xc6, - 0x44, - 0x8d, - 0x93, - 0x38, - 0xc1, - 0x5b, - 0x0a, - 0x00, - 0x00, - 0x00, + 0x30, 0x42, 0x31, 0x4d, 0xc6, 0x44, 0x8d, 0x93, 0x38, 0xc1, 0x5b, 0x0a, 0x00, 0x00, 0x00, 0x00 ].reverse() ); @@ -741,21 +360,7 @@ describe('Decimal128', function () { result = Decimal128.fromString('1000000000000000000000000000000000'); bytes = Buffer.from( [ - 0x30, - 0x40, - 0x31, - 0x4d, - 0xc6, - 0x44, - 0x8d, - 0x93, - 0x38, - 0xc1, - 0x5b, - 0x0a, - 0x00, - 0x00, - 0x00, + 0x30, 0x40, 0x31, 0x4d, 0xc6, 0x44, 0x8d, 0x93, 0x38, 0xc1, 0x5b, 0x0a, 0x00, 0x00, 0x00, 0x00 ].reverse() ); @@ -783,21 +388,7 @@ describe('Decimal128', function () { var result = Decimal128.fromString(str); var bytes = Buffer.from( [ - 0x37, - 0xcc, - 0x31, - 0x4d, - 0xc6, - 0x44, - 0x8d, - 0x93, - 0x38, - 0xc1, - 0x5b, - 0x0a, - 0x00, - 0x00, - 0x00, + 0x37, 0xcc, 0x31, 0x4d, 0xc6, 0x44, 0x8d, 0x93, 0x38, 0xc1, 0x5b, 0x0a, 0x00, 0x00, 0x00, 0x00 ].reverse() ); @@ -836,21 +427,7 @@ describe('Decimal128', function () { var result = Decimal128.fromString('0'); var bytes = Buffer.from( [ - 0x30, - 0x40, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, + 0x30, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ].reverse() ); @@ -860,21 +437,7 @@ describe('Decimal128', function () { result = Decimal128.fromString('0e-611'); bytes = Buffer.from( [ - 0x2b, - 0x7a, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, + 0x2b, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ].reverse() ); @@ -884,21 +447,7 @@ describe('Decimal128', function () { result = Decimal128.fromString('0e+6000'); bytes = Buffer.from( [ - 0x5f, - 0x20, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, + 0x5f, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ].reverse() ); @@ -908,21 +457,7 @@ describe('Decimal128', function () { result = Decimal128.fromString('-0e-1'); bytes = Buffer.from( [ - 0xb0, - 0x3e, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, + 0xb0, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ].reverse() ); @@ -935,21 +470,7 @@ describe('Decimal128', function () { var result = Decimal128.fromString('10E-6177'); var bytes = Buffer.from( [ - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 ].reverse() ); @@ -1288,21 +809,7 @@ describe('Decimal128', function () { var decimal = new Decimal128( Buffer.from( [ - 0x78, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, + 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ].reverse() ) @@ -1312,21 +819,7 @@ describe('Decimal128', function () { decimal = new Decimal128( Buffer.from( [ - 0xf8, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, + 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ].reverse() ) @@ -1339,21 +832,7 @@ describe('Decimal128', function () { var decimal = new Decimal128( Buffer.from( [ - 0x7c, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, + 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ].reverse() ) @@ -1363,21 +842,7 @@ describe('Decimal128', function () { decimal = new Decimal128( Buffer.from( [ - 0xfc, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, + 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ].reverse() ) @@ -1387,21 +852,7 @@ describe('Decimal128', function () { decimal = new Decimal128( Buffer.from( [ - 0x7e, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, + 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ].reverse() ) @@ -1411,21 +862,7 @@ describe('Decimal128', function () { decimal = new Decimal128( Buffer.from( [ - 0xfe, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, + 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ].reverse() ) @@ -1435,21 +872,7 @@ describe('Decimal128', function () { decimal = new Decimal128( Buffer.from( [ - 0x7e, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, + 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12 ].reverse() ) @@ -1462,21 +885,7 @@ describe('Decimal128', function () { var decimal = new Decimal128( Buffer.from( [ - 0x30, - 0x40, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, + 0x30, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 ].reverse() ) @@ -1486,21 +895,7 @@ describe('Decimal128', function () { decimal = new Decimal128( Buffer.from( [ - 0x30, - 0x40, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, + 0x30, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ].reverse() ) @@ -1510,21 +905,7 @@ describe('Decimal128', function () { decimal = new Decimal128( Buffer.from( [ - 0x30, - 0x40, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, + 0x30, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02 ].reverse() ) @@ -1534,21 +915,7 @@ describe('Decimal128', function () { decimal = new Decimal128( Buffer.from( [ - 0xb0, - 0x40, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, + 0xb0, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 ].reverse() ) @@ -1558,21 +925,7 @@ describe('Decimal128', function () { decimal = new Decimal128( Buffer.from( [ - 0xb0, - 0x40, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, + 0xb0, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ].reverse() ) @@ -1582,21 +935,7 @@ describe('Decimal128', function () { decimal = new Decimal128( Buffer.from( [ - 0x30, - 0x3e, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, + 0x30, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 ].reverse() ) @@ -1606,21 +945,7 @@ describe('Decimal128', function () { decimal = new Decimal128( Buffer.from( [ - 0x30, - 0x34, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x04, + 0x30, 0x34, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0xd2 ].reverse() ) @@ -1630,21 +955,7 @@ describe('Decimal128', function () { decimal = new Decimal128( Buffer.from( [ - 0x30, - 0x40, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x1c, - 0xbe, - 0x99, - 0x1a, + 0x30, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0xbe, 0x99, 0x1a, 0x14 ].reverse() ) @@ -1654,21 +965,7 @@ describe('Decimal128', function () { decimal = new Decimal128( Buffer.from( [ - 0x30, - 0x2a, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x07, - 0x5a, - 0xef, + 0x30, 0x2a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x5a, 0xef, 0x40 ].reverse() ) @@ -1678,21 +975,7 @@ describe('Decimal128', function () { decimal = new Decimal128( Buffer.from( [ - 0x2f, - 0xfc, - 0x3c, - 0xde, - 0x6f, - 0xff, - 0x97, - 0x32, - 0xde, - 0x82, - 0x5c, - 0xd0, - 0x7e, - 0x96, - 0xaf, + 0x2f, 0xfc, 0x3c, 0xde, 0x6f, 0xff, 0x97, 0x32, 0xde, 0x82, 0x5c, 0xd0, 0x7e, 0x96, 0xaf, 0xf2 ].reverse() ) @@ -1705,21 +988,7 @@ describe('Decimal128', function () { var decimal = new Decimal128( Buffer.from( [ - 0x5f, - 0xfe, - 0x31, - 0x4d, - 0xc6, - 0x44, - 0x8d, - 0x93, - 0x38, - 0xc1, - 0x5b, - 0x0a, - 0x00, - 0x00, - 0x00, + 0x5f, 0xfe, 0x31, 0x4d, 0xc6, 0x44, 0x8d, 0x93, 0x38, 0xc1, 0x5b, 0x0a, 0x00, 0x00, 0x00, 0x00 ].reverse() ) @@ -1729,21 +998,7 @@ describe('Decimal128', function () { decimal = new Decimal128( Buffer.from( [ - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 ].reverse() ) @@ -1753,21 +1008,7 @@ describe('Decimal128', function () { decimal = new Decimal128( Buffer.from( [ - 0x80, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, + 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 ].reverse() ) @@ -1777,21 +1018,7 @@ describe('Decimal128', function () { decimal = new Decimal128( Buffer.from( [ - 0x31, - 0x08, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x09, - 0x18, - 0x4d, - 0xb6, - 0x3e, + 0x31, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x18, 0x4d, 0xb6, 0x3e, 0xb1 ].reverse() ) @@ -1801,21 +1028,7 @@ describe('Decimal128', function () { decimal = new Decimal128( Buffer.from( [ - 0x5f, - 0xff, - 0xed, - 0x09, - 0xbe, - 0xad, - 0x87, - 0xc0, - 0x37, - 0x8d, - 0x8e, - 0x63, - 0xff, - 0xff, - 0xff, + 0x5f, 0xff, 0xed, 0x09, 0xbe, 0xad, 0x87, 0xc0, 0x37, 0x8d, 0x8e, 0x63, 0xff, 0xff, 0xff, 0xff ].reverse() ) @@ -1825,21 +1038,7 @@ describe('Decimal128', function () { decimal = new Decimal128( Buffer.from( [ - 0x00, - 0x01, - 0xed, - 0x09, - 0xbe, - 0xad, - 0x87, - 0xc0, - 0x37, - 0x8d, - 0x8e, - 0x63, - 0xff, - 0xff, - 0xff, + 0x00, 0x01, 0xed, 0x09, 0xbe, 0xad, 0x87, 0xc0, 0x37, 0x8d, 0x8e, 0x63, 0xff, 0xff, 0xff, 0xff ].reverse() ) @@ -1849,21 +1048,7 @@ describe('Decimal128', function () { decimal = new Decimal128( Buffer.from( [ - 0x30, - 0x40, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, - 0xff, + 0x30, 0x40, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff ].reverse() ) @@ -1873,21 +1058,7 @@ describe('Decimal128', function () { decimal = new Decimal128( Buffer.from( [ - 0x30, - 0x4c, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x04, + 0x30, 0x4c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x1a ].reverse() ) @@ -1897,21 +1068,7 @@ describe('Decimal128', function () { decimal = new Decimal128( Buffer.from( [ - 0x30, - 0x42, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x04, + 0x30, 0x42, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x1a ].reverse() ) @@ -1921,21 +1078,7 @@ describe('Decimal128', function () { decimal = new Decimal128( Buffer.from( [ - 0x30, - 0x40, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, + 0x30, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x69 ].reverse() ) @@ -1945,21 +1088,7 @@ describe('Decimal128', function () { decimal = new Decimal128( Buffer.from( [ - 0x30, - 0x42, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, + 0x30, 0x42, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x69 ].reverse() ) @@ -1969,21 +1098,7 @@ describe('Decimal128', function () { decimal = new Decimal128( Buffer.from( [ - 0x30, - 0x46, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, + 0x30, 0x46, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 ].reverse() ) @@ -1996,21 +1111,7 @@ describe('Decimal128', function () { var decimal = new Decimal128( Buffer.from( [ - 0x30, - 0x40, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, + 0x30, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ].reverse() ) @@ -2020,21 +1121,7 @@ describe('Decimal128', function () { decimal = new Decimal128( Buffer.from( [ - 0x32, - 0x98, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, + 0x32, 0x98, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ].reverse() ) @@ -2044,21 +1131,7 @@ describe('Decimal128', function () { decimal = new Decimal128( Buffer.from( [ - 0x2b, - 0x90, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, + 0x2b, 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ].reverse() )