update exports

This commit is contained in:
casperlamboo 2017-11-02 17:18:14 +01:00
parent 04cb04b615
commit 8d098829ad
3 changed files with 6 additions and 8 deletions

View File

@ -5,7 +5,7 @@ import { recursivePromiseApply } from '../utils/async.js';
import { base64ToImage, base64ToVectorArray } from '../utils/binaryUtils.js';
import { LEGACY_HEIGHT_STEP } from '../constants/d3Constants.js';
async function JSONToSketchData({ data, appVersion }) {
export default async function JSONToSketchData({ data, appVersion }) {
let sketchData = JSON.parse(data, (key, value) => {
if (semver.lt(appVersion, '0.1.2')) {
if (key === 'imageData') {
@ -72,5 +72,3 @@ async function JSONToSketchData({ data, appVersion }) {
return sketchData;
}
export default JSONToSketchData;

View File

@ -2,7 +2,7 @@ import { blobToJSON } from '../utils/binaryUtils.js';
import JSONToSketchData from './JSONToSketchData.js';
import semver from 'semver';
export async function docToFile(db, doc, { image = false, sketch = false } = {}) {
export default async function docToFile(db, doc, { image = false, sketch = false } = {}) {
// NOTE doc.appVersion can be used to check in which version of the app the file was saved in
const response = {
name: doc.name,
@ -37,7 +37,7 @@ export async function docToFile(db, doc, { image = false, sketch = false } = {})
return response;
}
export async function addAttachments(db, docs, keys) {
function addAttachments(db, docs, keys) {
if (keys) {
keys = keys.reduce((obj, value) => {
obj[value] = null;

View File

@ -1,6 +1,6 @@
import dbToDoc from './dbToDoc.js';
import shapeToPoints from './shapeToPoints.js';
import * as shapeToPoints from './shapeToPoints.js';
import JSONToSketchData from './JSONToSketchData.js';
import ShapeDataUtils from './shapeDataUtils.js';
import * as shapeDataUtils from './shapeDataUtils.js';
export { dbToDoc, shapeToPoints, JSONToSketchData, ShapeDataUtils };
export { dbToDoc, shapeToPoints, JSONToSketchData, shapeDataUtils };