mirror of
https://github.com/dolthub/dolt.git
synced 2026-05-05 19:31:36 -05:00
JS: Use export default for DataStore
This commit is contained in:
+1
-1
@@ -7,7 +7,7 @@ import MemoryStore from './memory-store.js';
|
||||
import test from './async-test.js';
|
||||
import {blobType} from './type.js';
|
||||
import {newBlob, BlobWriter} from './blob.js';
|
||||
import {DataStore} from './data-store.js';
|
||||
import DataStore from './data-store.js';
|
||||
|
||||
suite('Blob', () => {
|
||||
function intSequence(start: number, end: number): Uint8Array {
|
||||
|
||||
@@ -67,7 +67,7 @@ export function getDatasTypes(): DatasTypes {
|
||||
return datasTypes;
|
||||
}
|
||||
|
||||
export class DataStore {
|
||||
export default class DataStore {
|
||||
_cs: ChunkStore;
|
||||
_datasets: Promise<NomsMap<string, Ref>>;
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import Chunk from './chunk.js';
|
||||
import MemoryStore from './memory-store.js';
|
||||
import Ref from './ref.js';
|
||||
import {assert} from 'chai';
|
||||
import {DataStore, getDatasTypes, newCommit} from './data-store.js';
|
||||
import {default as DataStore, getDatasTypes, newCommit} from './data-store.js';
|
||||
import {invariant, notNull} from './assert.js';
|
||||
import {newMap} from './map.js';
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ import {NomsSet, SetLeafSequence} from './set.js';
|
||||
import {registerPackage, Package} from './package.js';
|
||||
import {suite} from 'mocha';
|
||||
import type {Value} from './value.js';
|
||||
import {DataStore} from './data-store.js';
|
||||
import DataStore from './data-store.js';
|
||||
|
||||
suite('Decode', () => {
|
||||
function stringToUint8Array(s): Uint8Array {
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ import {NomsBlob, BlobLeafSequence} from './blob.js';
|
||||
import Chunk from './chunk.js';
|
||||
import Ref from './ref.js';
|
||||
import Struct from './struct.js';
|
||||
import type {DataStore} from './data-store.js';
|
||||
import type DataStore from './data-store.js';
|
||||
import type {NomsKind} from './noms-kind.js';
|
||||
import {decode as decodeBase64} from './base64.js';
|
||||
import {
|
||||
|
||||
@@ -18,7 +18,7 @@ import {MapLeafSequence, NomsMap} from './map.js';
|
||||
import {NomsSet, SetLeafSequence} from './set.js';
|
||||
import {Package, registerPackage} from './package.js';
|
||||
import {newBlob} from './blob.js';
|
||||
import {DataStore} from './data-store.js';
|
||||
import DataStore from './data-store.js';
|
||||
|
||||
suite('Encode', () => {
|
||||
test('write primitives', () => {
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
import Chunk from './chunk.js';
|
||||
import Ref from './ref.js';
|
||||
import Struct from './struct.js';
|
||||
import type {DataStore} from './data-store.js';
|
||||
import type DataStore from './data-store.js';
|
||||
import type {NomsKind} from './noms-kind.js';
|
||||
import {encode as encodeBase64} from './base64.js';
|
||||
import {boolType, EnumDesc, makePrimitiveType, stringType, StructDesc, Type} from './type.js';
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ import Chunk from './chunk.js';
|
||||
import Ref from './ref.js';
|
||||
import {invariant, notNull} from './assert.js';
|
||||
import {Type} from './type.js';
|
||||
import type {DataStore} from './data-store.js';
|
||||
import type DataStore from './data-store.js';
|
||||
|
||||
type encodeFn = (v: any, t: Type, ds: ?DataStore) => Chunk;
|
||||
let encodeNomsValue: ?encodeFn = null;
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@ import {invariant} from './assert.js';
|
||||
import {Kind} from './noms-kind.js';
|
||||
import {ListLeafSequence, newList, NomsList} from './list.js';
|
||||
import {makeCompoundType, makePrimitiveType} from './type.js';
|
||||
import {DataStore} from './data-store.js';
|
||||
import DataStore from './data-store.js';
|
||||
|
||||
const testListSize = 5000;
|
||||
const listOfNRef = 'sha1-11e947e8aacfda8e9052bb57e661da442b26c625';
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
|
||||
import BuzHashBoundaryChecker from './buzhash-boundary-checker.js';
|
||||
import type {BoundaryChecker, makeChunkFn} from './sequence-chunker.js';
|
||||
import type {DataStore} from './data-store.js';
|
||||
import type DataStore from './data-store.js';
|
||||
import type {Splice} from './edit-distance.js';
|
||||
import type {valueOrPrimitive} from './value.js'; // eslint-disable-line no-unused-vars
|
||||
import {AsyncIterator} from './async-iterator.js';
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@ import {flatten, flattenParallel} from './test-util.js';
|
||||
import {makeCompoundType, makePrimitiveType} from './type.js';
|
||||
import {MapLeafSequence, newMap, NomsMap} from './map.js';
|
||||
import {MetaTuple, OrderedMetaSequence} from './meta-sequence.js';
|
||||
import {DataStore} from './data-store';
|
||||
import DataStore from './data-store';
|
||||
|
||||
const testMapSize = 5000;
|
||||
const mapOfNRef = 'sha1-1b9664e55091370996f3af428ffee78f1ad36426';
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@ import {MetaTuple, newOrderedMetaSequenceBoundaryChecker,
|
||||
import {OrderedSequence, OrderedSequenceCursor,
|
||||
OrderedSequenceIterator} from './ordered-sequence.js';
|
||||
import {Type} from './type.js';
|
||||
import type {DataStore} from './data-store.js';
|
||||
import type DataStore from './data-store.js';
|
||||
|
||||
export type MapEntry<K: valueOrPrimitive, V: valueOrPrimitive> = {
|
||||
key: K,
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
import BuzHashBoundaryChecker from './buzhash-boundary-checker.js';
|
||||
import {default as Ref, sha1Size} from './ref.js';
|
||||
import type {BoundaryChecker, makeChunkFn} from './sequence-chunker.js';
|
||||
import type {DataStore} from './data-store.js';
|
||||
import type DataStore from './data-store.js';
|
||||
import type {valueOrPrimitive} from './value.js'; // eslint-disable-line no-unused-vars
|
||||
import {Collection} from './collection.js';
|
||||
import {CompoundDesc, makeCompoundType, makePrimitiveType, Type} from './type.js';
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
// @flow
|
||||
|
||||
export {AsyncIterator} from './async-iterator.js';
|
||||
export {DataStore, newCommit} from './data-store.js';
|
||||
export {default as DataStore, newCommit} from './data-store.js';
|
||||
export {NomsBlob, BlobReader} from './blob.js';
|
||||
export {decodeNomsValue} from './decode.js';
|
||||
export {default as Chunk} from './chunk.js';
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ import Ref from './ref.js';
|
||||
import {invariant} from './assert.js';
|
||||
import {packageType, Type} from './type.js';
|
||||
import {ValueBase} from './value.js';
|
||||
import type {DataStore} from './data-store.js';
|
||||
import type DataStore from './data-store.js';
|
||||
|
||||
export class Package extends ValueBase {
|
||||
types: Array<Type>;
|
||||
|
||||
@@ -8,7 +8,7 @@ import {notNull} from './assert.js';
|
||||
import {makeCompoundType, makePrimitiveType} from './type.js';
|
||||
import {Kind} from './noms-kind.js';
|
||||
import MemoryStore from './memory-store.js';
|
||||
import {DataStore} from './data-store.js';
|
||||
import DataStore from './data-store.js';
|
||||
|
||||
class TestSequence extends Sequence<any> {
|
||||
constructor(ds: ?DataStore, items: Array<any>) {
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
// @flow
|
||||
|
||||
import type {DataStore} from './data-store.js';
|
||||
import type DataStore from './data-store.js';
|
||||
import {invariant, notNull} from './assert.js';
|
||||
import {AsyncIterator} from './async-iterator.js';
|
||||
import type {AsyncIteratorResult} from './async-iterator.js';
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@ import {makeCompoundType, makePrimitiveType} from './type.js';
|
||||
import {MetaTuple, OrderedMetaSequence} from './meta-sequence.js';
|
||||
import {newSet, NomsSet, SetLeafSequence} from './set.js';
|
||||
import {OrderedSequence} from './ordered-sequence.js';
|
||||
import {DataStore} from './data-store.js';
|
||||
import DataStore from './data-store.js';
|
||||
|
||||
const testSetSize = 5000;
|
||||
const setOfNRef = 'sha1-54ff8f84b5f39fe2171572922d067257a57c539c';
|
||||
|
||||
+1
-1
@@ -16,7 +16,7 @@ import {MetaTuple, newOrderedMetaSequenceBoundaryChecker,
|
||||
import {OrderedSequence, OrderedSequenceCursor,
|
||||
OrderedSequenceIterator} from './ordered-sequence.js';
|
||||
import {Type} from './type.js';
|
||||
import type {DataStore} from './data-store.js';
|
||||
import type DataStore from './data-store.js';
|
||||
|
||||
const setWindowSize = 1;
|
||||
const setPattern = ((1 << 6) | 0) - 1;
|
||||
|
||||
@@ -8,7 +8,7 @@ import {Kind} from './noms-kind.js';
|
||||
import {notNull} from './assert.js';
|
||||
import {Package, registerPackage} from './package.js';
|
||||
import {suite, test} from 'mocha';
|
||||
import {DataStore} from './data-store.js';
|
||||
import DataStore from './data-store.js';
|
||||
|
||||
suite('Struct', () => {
|
||||
test('equals', () => {
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ import {Field, makeCompoundType, makePrimitiveType, makeStructType, makeType} fr
|
||||
import {Kind} from './noms-kind.js';
|
||||
import {Package, registerPackage} from './package.js';
|
||||
import {suite, test} from 'mocha';
|
||||
import {DataStore} from './data-store.js';
|
||||
import DataStore from './data-store.js';
|
||||
|
||||
suite('Type', () => {
|
||||
test('types', async () => {
|
||||
|
||||
Reference in New Issue
Block a user