mirror of
https://github.com/Doodle3D/Doodle3D-Core.git
synced 2024-12-22 19:13:49 +01:00
update exports
This commit is contained in:
parent
04cb04b615
commit
8d098829ad
@ -5,7 +5,7 @@ import { recursivePromiseApply } from '../utils/async.js';
|
|||||||
import { base64ToImage, base64ToVectorArray } from '../utils/binaryUtils.js';
|
import { base64ToImage, base64ToVectorArray } from '../utils/binaryUtils.js';
|
||||||
import { LEGACY_HEIGHT_STEP } from '../constants/d3Constants.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) => {
|
let sketchData = JSON.parse(data, (key, value) => {
|
||||||
if (semver.lt(appVersion, '0.1.2')) {
|
if (semver.lt(appVersion, '0.1.2')) {
|
||||||
if (key === 'imageData') {
|
if (key === 'imageData') {
|
||||||
@ -72,5 +72,3 @@ async function JSONToSketchData({ data, appVersion }) {
|
|||||||
|
|
||||||
return sketchData;
|
return sketchData;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default JSONToSketchData;
|
|
||||||
|
@ -2,7 +2,7 @@ import { blobToJSON } from '../utils/binaryUtils.js';
|
|||||||
import JSONToSketchData from './JSONToSketchData.js';
|
import JSONToSketchData from './JSONToSketchData.js';
|
||||||
import semver from 'semver';
|
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
|
// NOTE doc.appVersion can be used to check in which version of the app the file was saved in
|
||||||
const response = {
|
const response = {
|
||||||
name: doc.name,
|
name: doc.name,
|
||||||
@ -37,7 +37,7 @@ export async function docToFile(db, doc, { image = false, sketch = false } = {})
|
|||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function addAttachments(db, docs, keys) {
|
function addAttachments(db, docs, keys) {
|
||||||
if (keys) {
|
if (keys) {
|
||||||
keys = keys.reduce((obj, value) => {
|
keys = keys.reduce((obj, value) => {
|
||||||
obj[value] = null;
|
obj[value] = null;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import dbToDoc from './dbToDoc.js';
|
import dbToDoc from './dbToDoc.js';
|
||||||
import shapeToPoints from './shapeToPoints.js';
|
import * as shapeToPoints from './shapeToPoints.js';
|
||||||
import JSONToSketchData from './JSONToSketchData.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 };
|
||||||
|
Loading…
Reference in New Issue
Block a user