diff --git a/packages/core/src/flate.js b/packages/core/src/flate.js new file mode 100644 index 0000000..9ff314a --- /dev/null +++ b/packages/core/src/flate.js @@ -0,0 +1,11 @@ +import {deflateSync, inflateSync} from 'zlib'; + +export function inflate(buffer) { + return inflateSync(buffer); +} + +export function deflate(buffer) { + return deflateSync(buffer, { + level: 9, + }); +} diff --git a/packages/core/src/index.js b/packages/core/src/index.js index 69cca84..e89e81a 100644 --- a/packages/core/src/index.js +++ b/packages/core/src/index.js @@ -1,15 +1,11 @@ export { default as fastApply, } from './fast-apply'; +export * from './flate'; export { default as mapValuesAsync, } from './map-values-async'; -export { - mergeDiff, - mergeDiffArray, - mergeDiffObject, - mergeDiffPrimitive, -} from './merge-diff'; +export * from './merge-diff'; export { default as Property, } from './property'; diff --git a/packages/topdown/src/resources/tiles.js b/packages/topdown/src/resources/tiles.js index 678e1c9..aeabbfa 100644 --- a/packages/topdown/src/resources/tiles.js +++ b/packages/topdown/src/resources/tiles.js @@ -1,3 +1,4 @@ +import {deflate, inflate} from '@avocado/core'; import {Atlas} from '@avocado/graphics'; import { floodwalk2D, @@ -7,23 +8,7 @@ import { } from '@avocado/math'; import {JsonResource} from '@avocado/resource'; import {Synchronized} from '@avocado/s13n'; -import { - compose, - // deflate, - EventEmitter, - // inflate, -} from '@flecks/core'; -import {deflateSync, inflateSync} from 'zlib'; - -export function inflate(buffer) { - return inflateSync(buffer); -} - -export function deflate(buffer) { - return deflateSync(buffer, { - level: 9, - }); -} +import {compose, EventEmitter} from '@flecks/core'; // TODO: rows, with nulls