Browse Source

formating & code style

Alexander Rose 5 years ago
parent
commit
39b29fe0ea

+ 1 - 1
src/mol-geo/util.ts

@@ -106,7 +106,7 @@ export function computeVertexNormals<T extends NumberArray> (vertices: NumberArr
     const cb = Vec3.zero()
     const ab = Vec3.zero()
 
-     for (let i = 0, il = vertices.length; i < il; i += 9) {
+    for (let i = 0, il = vertices.length; i < il; i += 9) {
         Vec3.fromArray(a, vertices, i)
         Vec3.fromArray(b, vertices, i + 3)
         Vec3.fromArray(c, vertices, i + 6)

+ 4 - 4
src/mol-state/action.ts

@@ -107,13 +107,13 @@ namespace StateAction {
                 display: typeof info.display === 'string'
                     ? { name: info.display }
                     : !!info.display
-                    ? info.display
-                    : { name: 'Unnamed State Action' },
+                        ? info.display
+                        : { name: 'Unnamed State Action' },
                 params: typeof info.params === 'object'
                     ? () => info.params as any
                     : !!info.params
-                    ? info.params as any
-                    : void 0,
+                        ? info.params as any
+                        : void 0,
                 isApplicable: info.isApplicable,
                 ...(typeof def === 'function'
                     ? { run: def }

+ 1 - 1
src/mol-util/async-queue.ts

@@ -29,7 +29,7 @@ export class AsyncQueue<T> {
     remove(v: T) {
         const rem = arrayRemoveInPlace(this.queue, v);
         if (rem)
-        this.signal.next({ v, stillPresent: false })
+            this.signal.next({ v, stillPresent: false })
         return rem;
     }
 

+ 1 - 1
src/mol-util/memoize.ts

@@ -4,7 +4,7 @@
  * @author David Sehnal <david.sehnal@gmail.com>
  */
 
- /** Cache the latest result from calls to a function with any number of arguments */
+/** Cache the latest result from calls to a function with any number of arguments */
 export function memoizeLatest<Args extends any[], T>(f: (...args: Args) => T): (...args: Args) => T {
     let lastArgs: any[] | undefined = void 0, value: any = void 0;
     return (...args) => {

+ 2 - 2
src/mol-util/now.ts

@@ -4,8 +4,8 @@
  * @author David Sehnal <david.sehnal@gmail.com>
  */
 
-declare var process: any;
-declare var window: any;
+declare const process: any;
+declare const window: any;
 
 const now: () => now.Timestamp = (function () {
     if (typeof window !== 'undefined' && window.performance) {

+ 5 - 5
src/mol-util/object.ts

@@ -66,11 +66,11 @@ export function deepClone<T>(source: T): T {
     if (null === source || 'object' !== typeof source) return source;
 
     if (source instanceof Array) {
-      const copy: any[] = [];
-      for (let i = 0, len = source.length; i < len; i++) {
-          copy[i] = deepClone(source[i]);
-      }
-      return copy as any as T;
+        const copy: any[] = [];
+        for (let i = 0, len = source.length; i < len; i++) {
+            copy[i] = deepClone(source[i]);
+        }
+        return copy as any as T;
     }
 
     if (source instanceof Object) {

+ 3 - 3
src/perf-tests/structure.ts

@@ -380,11 +380,11 @@ export namespace PropertyAccess {
     }
 
     export async function run() {
-        // const { structures, models/*, mmcif*/ } = await getBcif('1cbs');
+        // const { structures, models/* , mmcif */ } = await getBcif('1cbs');
         // const { structures, models } = await getBcif('3j3q');
 
-        const { structures, models /*, mmcif*/ } = await readCIF('e:/test/quick/1cbs_updated.cif');
-        // const { structures: s1, /*, mmcif*/ } = await readCIF('e:/test/quick/1tqn_updated.cif');
+        const { structures, models /* , mmcif */ } = await readCIF('e:/test/quick/1cbs_updated.cif');
+        // const { structures: s1, /* , mmcif */ } = await readCIF('e:/test/quick/1tqn_updated.cif');
 
         // testGrouping(structures[0]);
         // console.log('------');