From a3001300b54e7042275734fc885cb1cad33c8dfa Mon Sep 17 00:00:00 2001 From: Viatorus Date: Wed, 11 Jul 2018 21:20:07 +0200 Subject: [PATCH] Rebase again. --- packages/common/types.ts | 4 ++-- .../full-text-search/src/full_text_search.ts | 16 +++++++------- .../full-text-search/src/inverted_index.ts | 4 ++-- packages/loki/spec/generic/migration.spec.ts | 4 ++-- packages/loki/spec/generic/typed.spec.ts | 6 ++--- packages/loki/src/collection.ts | 22 +++++++++---------- packages/loki/src/dynamic_view.ts | 12 +++++----- packages/loki/src/loki.ts | 12 +++++----- packages/loki/src/result_set.ts | 14 ++++++------ packages/loki/src/serialization/migration.ts | 6 ++--- packages/loki/src/serialization/v1_5.ts | 4 ++-- packages/loki/src/serialization/v2_0.ts | 8 +++---- 12 files changed, 56 insertions(+), 56 deletions(-) diff --git a/packages/common/types.ts b/packages/common/types.ts index c19e5d1b..e8c47b41 100644 --- a/packages/common/types.ts +++ b/packages/common/types.ts @@ -1,8 +1,8 @@ /** * @hidden */ -import {Loki} from "../loki/src"; -import {Serialization} from "../loki/src/serialization/migration"; +import { Loki } from "../loki/src"; +import { Serialization } from "../loki/src/serialization/migration"; export interface StorageAdapter { loadDatabase(dbname: string): Promise; diff --git a/packages/full-text-search/src/full_text_search.ts b/packages/full-text-search/src/full_text_search.ts index 1e11f442..7cedee41 100644 --- a/packages/full-text-search/src/full_text_search.ts +++ b/packages/full-text-search/src/full_text_search.ts @@ -1,11 +1,11 @@ -import {InvertedIndex} from "./inverted_index"; -import {IndexSearcher} from "./index_searcher"; -import {Dict} from "../../common/types"; -import {PLUGINS} from "../../common/plugin"; -import {Query} from "./query_types"; -import {Scorer} from "./scorer"; -import {Analyzer} from "./analyzer/analyzer"; -import {Serialization} from "../../loki/src/serialization/migration"; +import { InvertedIndex } from "./inverted_index"; +import { IndexSearcher } from "./index_searcher"; +import { Dict } from "../../common/types"; +import { PLUGINS } from "../../common/plugin"; +import { Query } from "./query_types"; +import { Scorer } from "./scorer"; +import { Analyzer } from "./analyzer/analyzer"; +import { Serialization } from "../../loki/src/serialization/migration"; export class FullTextSearch { /// The id field of each document. diff --git a/packages/full-text-search/src/inverted_index.ts b/packages/full-text-search/src/inverted_index.ts index aeb49e84..b47633a9 100644 --- a/packages/full-text-search/src/inverted_index.ts +++ b/packages/full-text-search/src/inverted_index.ts @@ -1,5 +1,5 @@ -import {Analyzer, StandardAnalyzer, analyze} from "./analyzer/analyzer"; -import {Serialization} from "../../loki/src/serialization/migration"; +import { Analyzer, StandardAnalyzer, analyze } from "./analyzer/analyzer"; +import { Serialization } from "../../loki/src/serialization/migration"; /** * Converts a string into an array of code points. diff --git a/packages/loki/spec/generic/migration.spec.ts b/packages/loki/spec/generic/migration.spec.ts index d447a04d..a88e38e7 100644 --- a/packages/loki/spec/generic/migration.spec.ts +++ b/packages/loki/spec/generic/migration.spec.ts @@ -1,5 +1,5 @@ -import {Loki} from "../../src/loki"; -import {Serialization, mergeRightBiasedWithProxy} from "../../src/serialization/migration"; +import { Loki } from "../../src/loki"; +import { Serialization, mergeRightBiasedWithProxy } from "../../src/serialization/migration"; declare var require: (moduleId: string) => any; const loki = require("../../../lokijs/lokijs.js"); diff --git a/packages/loki/spec/generic/typed.spec.ts b/packages/loki/spec/generic/typed.spec.ts index 814f0e65..00b4a39f 100644 --- a/packages/loki/spec/generic/typed.spec.ts +++ b/packages/loki/spec/generic/typed.spec.ts @@ -1,7 +1,7 @@ /* global describe, it, expect */ -import {Loki} from "../../src/loki"; -import {Doc} from "../../../common/types"; -import {Serialization} from "../../src/serialization/migration"; +import { Loki } from "../../src/loki"; +import { Doc } from "../../../common/types"; +import { Serialization } from "../../src/serialization/migration"; describe("typed", () => { it("works", () => { diff --git a/packages/loki/src/collection.ts b/packages/loki/src/collection.ts index ee42ac6a..ee8dfdb4 100644 --- a/packages/loki/src/collection.ts +++ b/packages/loki/src/collection.ts @@ -1,14 +1,14 @@ -import {LokiEventEmitter} from "./event_emitter"; -import {UniqueIndex} from "./unique_index"; -import {ResultSet, LokiOps} from "./result_set"; -import {DynamicView} from "./dynamic_view"; -import {ltHelper, gtHelper, aeqHelper} from "./helper"; -import {clone, CloneMethod} from "./clone"; -import {Doc, Dict} from "../../common/types"; -import {FullTextSearch} from "../../full-text-search/src/full_text_search"; -import {PLUGINS} from "../../common/plugin"; -import {Analyzer} from "../../full-text-search/src/analyzer/analyzer"; -import {Serialization} from "./serialization/migration"; +import { LokiEventEmitter } from "./event_emitter"; +import { UniqueIndex } from "./unique_index"; +import { ResultSet, LokiOps } from "./result_set"; +import { DynamicView } from "./dynamic_view"; +import { ltHelper, gtHelper, aeqHelper } from "./helper"; +import { clone, CloneMethod } from "./clone"; +import { Doc, Dict } from "../../common/types"; +import { FullTextSearch } from "../../full-text-search/src/full_text_search"; +import { PLUGINS } from "../../common/plugin"; +import { Analyzer } from "../../full-text-search/src/analyzer/analyzer"; +import { Serialization } from "./serialization/migration"; export {CloneMethod} from "./clone"; diff --git a/packages/loki/src/dynamic_view.ts b/packages/loki/src/dynamic_view.ts index 6743e4c3..8b680834 100644 --- a/packages/loki/src/dynamic_view.ts +++ b/packages/loki/src/dynamic_view.ts @@ -1,9 +1,9 @@ -import {LokiEventEmitter} from "./event_emitter"; -import {ResultSet} from "./result_set"; -import {Collection} from "./collection"; -import {Doc} from "../../common/types"; -import {Scorer} from "../../full-text-search/src/scorer"; -import {Serialization} from "./serialization/migration"; +import { LokiEventEmitter } from "./event_emitter"; +import { ResultSet } from "./result_set"; +import { Collection } from "./collection"; +import { Doc } from "../../common/types"; +import { Scorer } from "../../full-text-search/src/scorer"; +import { Serialization } from "./serialization/migration"; /** * DynamicView class is a versatile 'live' view class which can have filters and sorts applied. diff --git a/packages/loki/src/loki.ts b/packages/loki/src/loki.ts index f9d0dc2e..e09544e8 100644 --- a/packages/loki/src/loki.ts +++ b/packages/loki/src/loki.ts @@ -1,10 +1,10 @@ /* global global */ -import {LokiEventEmitter} from "./event_emitter"; -import {Collection} from "./collection"; -import {clone} from "./clone"; -import {Doc, StorageAdapter} from "../../common/types"; -import {PLUGINS} from "../../common/plugin"; -import {Serialization, migrateDatabase} from "./serialization/migration"; +import { LokiEventEmitter } from "./event_emitter"; +import { Collection } from "./collection"; +import { clone } from "./clone"; +import { Doc, StorageAdapter } from "../../common/types"; +import { PLUGINS } from "../../common/plugin"; +import { Serialization, migrateDatabase } from "./serialization/migration"; function getENV(): Loki.Environment { if (global !== undefined && (global["android"] || global["NSObject"])) { diff --git a/packages/loki/src/result_set.ts b/packages/loki/src/result_set.ts index 9a65948f..2d40eb8f 100644 --- a/packages/loki/src/result_set.ts +++ b/packages/loki/src/result_set.ts @@ -1,10 +1,10 @@ -import {Collection} from "./collection"; -import {clone, CloneMethod} from "./clone"; -import {ltHelper, gtHelper, aeqHelper, sortHelper} from "./helper"; -import {Doc} from "../../common/types"; -import {Scorer} from "../../full-text-search/src/scorer"; -import {Query as FullTextSearchQuery} from "../../full-text-search/src/query_types"; -import {Serialization} from "./serialization/migration"; +import { Collection } from "./collection"; +import { clone, CloneMethod } from "./clone"; +import { ltHelper, gtHelper, aeqHelper, sortHelper } from "./helper"; +import { Doc } from "../../common/types"; +import { Scorer } from "../../full-text-search/src/scorer"; +import {Query as FullTextSearchQuery } from "../../full-text-search/src/query_types"; +import { Serialization } from "./serialization/migration"; // used to recursively scan hierarchical transform step object for param substitution function resolveTransformObject(subObj: Collection.Transform, params: object, depth: number = 0): Collection.Transform { diff --git a/packages/loki/src/serialization/migration.ts b/packages/loki/src/serialization/migration.ts index c38a8846..8170f77f 100644 --- a/packages/loki/src/serialization/migration.ts +++ b/packages/loki/src/serialization/migration.ts @@ -1,6 +1,6 @@ -import {V2_0, V2_0 as Serialization} from "./v2_0"; -import {V1_5} from "./v1_5"; -import {Dict} from "../../../common/types"; +import { V2_0, V2_0 as Serialization } from "./v2_0"; +import { V1_5 } from "./v1_5"; +import { Dict } from "../../../common/types"; export {Serialization}; diff --git a/packages/loki/src/serialization/v1_5.ts b/packages/loki/src/serialization/v1_5.ts index c6466dd1..228f0be7 100644 --- a/packages/loki/src/serialization/v1_5.ts +++ b/packages/loki/src/serialization/v1_5.ts @@ -1,4 +1,4 @@ -import {Dict} from "../../../common/types"; +import { Dict } from "../../../common/types"; export namespace V1_5 { @@ -68,7 +68,7 @@ export namespace V1_5 { dataOptions?: ResultSet.DataOptions; } | { type: "mapReduce"; - mapFunction: 2,//(item: Doc, index: number, array: Doc[]) => any; + mapFunction: 2, //(item: Doc, index: number, array: Doc[]) => any; reduceFunction: (array: any[]) => any; } | { type: "update"; diff --git a/packages/loki/src/serialization/v2_0.ts b/packages/loki/src/serialization/v2_0.ts index ad3c3dda..7239a43d 100644 --- a/packages/loki/src/serialization/v2_0.ts +++ b/packages/loki/src/serialization/v2_0.ts @@ -1,4 +1,4 @@ -import {Dict} from "../../../common/types"; +import { Dict } from "../../../common/types"; export namespace V2_0 { @@ -212,9 +212,9 @@ export namespace V2_0 { export type Query = { [P: string]: LokiOps | any } - & { $and?: Query[] } - & { $or?: Query[] } - & { $fts?: FullTextSearch.Query }; + | { $and?: Query[] } + | { $or?: Query[] } + | { $fts?: FullTextSearch.Query }; export interface FullTextSearch { id: string;