Skip to content

Commit

Permalink
Changing exports a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
srenauld committed Oct 10, 2020
1 parent a1df722 commit 9e66c8c
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 11 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@letstimeit/mdt-compression",
"version": "0.2.3",
"version": "0.2.4",
"main": "dist/src/index.js",
"types": "dist/src/index.d.ts",
"license": "MIT",
Expand Down
4 changes: 3 additions & 1 deletion src/ace/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,6 @@ const Deserialize = (content:string):LuaTypes => {
}
};
const Serialize = (data:Record<string, unknown>):string => V1Serialize(data, false);
export { Serialize, Deserialize };
const exporting = { Serialize, Deserialize };

export default exporting;
3 changes: 2 additions & 1 deletion src/deflate/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ const EncodeForPrint = (input:Array<number>):string => {
}
return buffer.map((e) => String.fromCharCode(e)).join('');
};
export {
const output = {
Deflate, Inflate, DecodeForPrint, EncodeForPrint,
};
export default output;
6 changes: 3 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as Deflate from './deflate';
import * as Ace from './ace';
import Deflate from './deflate';
import Ace from './ace';

export default {
Deflate,
Ace
Ace,
};
2 changes: 1 addition & 1 deletion tests/ace/ace.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import chai, { expect } from 'chai';
import ChaiAsPromised from 'chai-as-promised';
import * as Ace from '../../src/ace';
import Ace from '../../src/ace';

chai.use(ChaiAsPromised);

Expand Down
8 changes: 4 additions & 4 deletions tests/deflate/deflate.test.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import assert from 'assert';
import { DecodeForPrint, EncodeForPrint } from '../../src/deflate/index';
import Deflate from '../../src/deflate/index';

describe('DecodeForPrint', () => {
it('Properly encodes', () => {
const input = Array.from({ length: 255 }, (_, i) => i);
const encoded = EncodeForPrint(input);
const decoded = DecodeForPrint(encoded);
const encoded = Deflate.EncodeForPrint(input);
const decoded = Deflate.DecodeForPrint(encoded);
assert.deepEqual(input, decoded);
});
it('Matches a pre-existing encoded string', () => {
Expand Down Expand Up @@ -56,7 +56,7 @@ describe('DecodeForPrint', () => {
80, 55, 225, 105, 238, 7, 250, 115, 49, 178, 238, 14, 33, 252, 156,
134, 182, 80, 238, 167, 126, 76, 23, 56, 129, 248, 127,
];
const actuallyDecoded = DecodeForPrint(encoded);
const actuallyDecoded = Deflate.DecodeForPrint(encoded);
assert.deepEqual(actuallyDecoded, decoded);
});
});

0 comments on commit 9e66c8c

Please sign in to comment.