<NME> typedarray_builder.template.ts
<BEF> /**
 * @license
 * Copyright 2016 Google Inc.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

export class $TYPE$Builder {
  length = 0;
  data: $TYPE$;

  constructor (initialCapacity: number = 16) {
    this.data = new $TYPE$(initialCapacity);
  }

  resize(newLength: number) {
    let {data} = this;
    if (newLength > data.length) {
      let newData = new $TYPE$(Math.max(newLength, data.length * 2));
      newData.set(data.subarray(0, this.length));
      this.data = newData;
    }
    this.length = newLength;
  }

  get view () {
    let {data} = this;
    return new $TYPE$(data.buffer, data.byteOffset, this.length);
  }

  shrinkToFit () {
    this.data = new $TYPE$(this.view);
  }

  clear () {
    this.length = 0;
  }

  appendArray (other: ArrayLike<number>) {
    let {length} = this;
    this.resize(length + other.length);
    this.data.set(other, length);
  }

  eraseRange(start: number, end: number) {
    this.data.copyWithin(start, end, this.length);
    this.length -= (end - start);
  }
}

<MSG> style: eliminate ".ts" extension in imported module names

<DFF> @@ -18,7 +18,7 @@ export class $TYPE$Builder {
   length = 0;
   data: $TYPE$;
 
-  constructor (initialCapacity: number = 16) {
+  constructor(initialCapacity: number = 16) {
     this.data = new $TYPE$(initialCapacity);
   }
 
@@ -32,20 +32,20 @@ export class $TYPE$Builder {
     this.length = newLength;
   }
 
-  get view () {
+  get view() {
     let {data} = this;
     return new $TYPE$(data.buffer, data.byteOffset, this.length);
   }
 
-  shrinkToFit () {
+  shrinkToFit() {
     this.data = new $TYPE$(this.view);
   }
 
-  clear () {
+  clear() {
     this.length = 0;
   }
 
-  appendArray (other: ArrayLike<number>) {
+  appendArray(other: ArrayLike<number>) {
     let {length} = this;
     this.resize(length + other.length);
     this.data.set(other, length);

style: eliminate ".ts" extension in imported module names