Skip to content

Commit

Permalink
Run lint/prettier after dev tools upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
Ib Green committed Mar 14, 2019
1 parent 270df19 commit b1164da
Show file tree
Hide file tree
Showing 19 changed files with 136 additions and 66 deletions.
4 changes: 2 additions & 2 deletions modules/arrow/test/data/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Data File Licenses

* `dictionary.arrow`, `simple.arrow`, `struct.arrow` - Apache 2 License (copied from https://github.com/wesm/arrow-1)
- `dictionary.arrow`, `simple.arrow`, `struct.arrow` - Apache 2 License (copied from https://github.com/wesm/arrow-1)

* `biogrid-nodes.arrow` - from graphistry.
- `biogrid-nodes.arrow` - from graphistry.
30 changes: 14 additions & 16 deletions modules/core/test/bench.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,18 @@ const ARRAY = new Array(LENGTH).fill(0);
// }

export default function coreBench(bench) {
return bench
.group('Core Module - Async Iteration')
.add('Normal Iteration 10K', () => {
let sum = 0;
for (const element of ARRAY) {
sum += element;
}
return sum;
});
// .addAsync('Async Iteration 10K', async () => {
// let sum = 0;
// for await (const element of asyncIterator(ARRAY)) {
// sum += element;
// }
// return sum;
// });
return bench.group('Core Module - Async Iteration').add('Normal Iteration 10K', () => {
let sum = 0;
for (const element of ARRAY) {
sum += element;
}
return sum;
});
// .addAsync('Async Iteration 10K', async () => {
// let sum = 0;
// for await (const element of asyncIterator(ARRAY)) {
// sum += element;
// }
// return sum;
// });
}
5 changes: 4 additions & 1 deletion modules/core/test/binary-utils/memory-copy-utils.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import test from 'tape-promise/tape';
import {
padTo4Bytes, copyArrayBuffer, copyToArray, concatenateArrayBuffers
padTo4Bytes,
copyArrayBuffer,
copyToArray,
concatenateArrayBuffers
} from '../src/binary-utils/memory-copy-utils';

test('padTo4Bytes', t => {
Expand Down
2 changes: 1 addition & 1 deletion modules/core/test/data/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Attributions for Sample Files

* `image1-preview.*` - copied from `binary-gltf-utils` under MIT license: Copyright (c) 2016-17 Karl Cheng
- `image1-preview.*` - copied from `binary-gltf-utils` under MIT license: Copyright (c) 2016-17 Karl Cheng
6 changes: 1 addition & 5 deletions modules/core/test/image-utils/image-loaders.spec.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
import {
ImageBitmapLoader,
HTMLImageLoader,
PlatformImageLoader
} from '@loaders.gl/core';
import {ImageBitmapLoader, HTMLImageLoader, PlatformImageLoader} from '@loaders.gl/core';

import test from 'tape-promise/tape';

Expand Down
14 changes: 8 additions & 6 deletions modules/core/test/load-file/load-image.worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@ import {loadImage} from '@loaders.gl/core';

if (typeof self !== 'undefined') {
/* global self */
self.onmessage = (evt) => {
self.onmessage = evt => {
const url = evt.data;

loadImage(url).then(image => {
self.postMessage({image}, [image]);
}).catch(error => {
self.postMessage({error: error.message});
});
loadImage(url)
.then(image => {
self.postMessage({image}, [image]);
})
.catch(error => {
self.postMessage({error: error.message});
});
};
}
1 change: 0 additions & 1 deletion modules/core/test/mesh-utils/gltf-attribute-utils.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,3 @@ test('getGLTFAttributeMap', t => {
t.ok(getGLTFAttributeMap);
t.end();
});

2 changes: 1 addition & 1 deletion modules/draco/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

[loaders.gl](https://uber-web.github.io/loaders.gl/#/docs) is a collection of framework independent 3D and geospatial parsers and encoders.

This module contains loader and writer for Draco compressed meshes and point clouds.
This module contains loader and writer for Draco compressed meshes and point clouds.
2 changes: 0 additions & 2 deletions modules/draco/test/data/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,3 @@
## DRC

Samples from Google Draco `testdata`:


5 changes: 3 additions & 2 deletions modules/experimental/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
[loaders.gl](https://uber-web.github.io/loaders.gl/#/docs) is a collection of framework independent 3D and geospatial parsers and encoders.

This module contains:
* Experimental loader and writers that may have limitations and may not conform to all loaders.gl conventions.
* Experimental APIs that may go into core or separate modules.

- Experimental loader and writers that may have limitations and may not conform to all loaders.gl conventions.
- Experimental APIs that may go into core or separate modules.
2 changes: 1 addition & 1 deletion modules/gltf/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

[loaders.gl](https://uber-web.github.io/loaders.gl/#/docs) is a collection of framework independent 3D and geospatial parsers and encoders.

This module contains loader and writers for the glTF format.
This module contains loader and writers for the glTF format.
24 changes: 12 additions & 12 deletions modules/gltf/scripts/glbdump.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function printHelp() {
let options;

function main() {
const [,, ...args] = process.argv;
const [, , ...args] = process.argv;

if (args.length === 0) {
printHelp();
Expand Down Expand Up @@ -118,17 +118,17 @@ function parseOptions(args) {
for (const arg of args) {
if (arg.indexOf('--') === 0) {
switch (arg) {
case '--json':
opts.dumpJSON = true;
break;
case '--gltf':
opts.dumpGLTF = true;
break;
case '--help':
printHelp();
break;
default:
console.warn(`Unknown option ${arg}`);
case '--json':
opts.dumpJSON = true;
break;
case '--gltf':
opts.dumpGLTF = true;
break;
case '--help':
printHelp();
break;
default:
console.warn(`Unknown option ${arg}`);
}
}
}
Expand Down
3 changes: 1 addition & 2 deletions modules/gltf/test/data/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@

## gltf-2.0

* `2CylinderEngine.glb` - From [Khronos glTF-Sample-Models](https://github.com/KhronosGroup/glTF-Sample-Models/blob/master/2.0/2CylinderEngine/glTF-Binary/2CylinderEngine.glb)

- `2CylinderEngine.glb` - From [Khronos glTF-Sample-Models](https://github.com/KhronosGroup/glTF-Sample-Models/blob/master/2.0/2CylinderEngine/glTF-Binary/2CylinderEngine.glb)
29 changes: 24 additions & 5 deletions modules/gltf/test/glb/glb-builder.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ const BUFFERS = [
new Float32Array([8, 2, 4, 5])
];

function validateGLBJsonFields(t, builder, {numBuffers = 1, numBufferViews = 0, numAccessors = 0, numImages = 0} = {}) {
function validateGLBJsonFields(
t,
builder,
{numBuffers = 1, numBufferViews = 0, numAccessors = 0, numImages = 0} = {}
) {
const counts = builder._getInternalCounts();
t.equal(counts.buffers, numBuffers, `buffers ${numBufferViews}`);
t.equal(counts.bufferViews, numBufferViews, `bufferViews is ${numBufferViews}`);
Expand Down Expand Up @@ -115,9 +119,16 @@ test('GLBBuilder#encode with nested typed array json', t => {
const arrayBuffer = builder.encodeAsGLB();

const resultJSON = builder.json.extras;
t.equal(arrayBuffer.byteLength, 284, 'nested object with 1 typed array json encoded with size of 284');
t.equal(
arrayBuffer.byteLength,
284,
'nested object with 1 typed array json encoded with size of 284'
);
t.equal(Object.keys(resultJSON).length, 1, 'json has 1 keys in object');
t.ok(typeof resultJSON.nested.typedArray === 'string', 'encoded array should be an accessor string');
t.ok(
typeof resultJSON.nested.typedArray === 'string',
'encoded array should be an accessor string'
);
validateGLBJsonFields(t, builder, {numBufferViews: 1, numAccessors: 1, numImages: 0});

t.end();
Expand Down Expand Up @@ -156,8 +167,16 @@ test('GLBBuilder#encode complex', t => {
// I think this test may be redundant with GLTF tests
test.skip('GLBBuilder#addImageEntry', t => {
const builder = new GLBBuilder();
const firstImageIndex = builder.addImageEntry(3, {mimeType: 'image/png', width: 100, height: 101});
const secondImageIndex = builder.addImageEntry(2, {mimeType: 'image/png', width: 200, height: 201});
const firstImageIndex = builder.addImageEntry(3, {
mimeType: 'image/png',
width: 100,
height: 101
});
const secondImageIndex = builder.addImageEntry(2, {
mimeType: 'image/png',
width: 200,
height: 201
});

t.equal(builder.json.images.length, 2, 'images has 2 entries');

Expand Down
61 changes: 59 additions & 2 deletions modules/gltf/test/gltf/gltf-builder.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,60 @@ import test from 'tape-promise/tape';

import {GLTFBuilder} from '@loaders.gl/gltf';

const PNG1x1 = new Uint8Array([0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x08, 0x06, 0x00, 0x00, 0x00, 0x1f, 0x15, 0xc4, 0x89, 0x00, 0x00, 0x00, 0x0a, 0x49, 0x44, 0x41, 0x54, 0x78, 0x9c, 0x63, 0x00, 0x01, 0x00, 0x00, 0x05, 0x00, 0x01, 0x0a]);
const PNG1x1 = new Uint8Array([
0x89,
0x50,
0x4e,
0x47,
0x0d,
0x0a,
0x1a,
0x0a,
0x00,
0x00,
0x00,
0x0d,
0x49,
0x48,
0x44,
0x52,
0x00,
0x00,
0x00,
0x01,
0x00,
0x00,
0x00,
0x01,
0x08,
0x06,
0x00,
0x00,
0x00,
0x1f,
0x15,
0xc4,
0x89,
0x00,
0x00,
0x00,
0x0a,
0x49,
0x44,
0x41,
0x54,
0x78,
0x9c,
0x63,
0x00,
0x01,
0x00,
0x00,
0x05,
0x00,
0x01,
0x0a
]);

test('GLTFBuilder#ctor', t => {
const gltfBuilder = new GLTFBuilder();
Expand All @@ -17,7 +70,11 @@ test('GLTFBuilder#addImage', t => {
const imageIndex = gltfBuilder.addImage(PNG1x1);
t.equal(imageIndex, 0, 'Image index should be 0');

t.deepEquals(gltfBuilder._getInternalCounts(), {buffers: 1, bufferViews: 1, accessors: 0, images: 1}, 'gltf properties set as expected');
t.deepEquals(
gltfBuilder._getInternalCounts(),
{buffers: 1, bufferViews: 1, accessors: 0, images: 1},
'gltf properties set as expected'
);

const {bufferView, mimeType, width, height} = gltfBuilder.json.images[0];
t.equal(bufferView, 0, 'bufferView index is 0');
Expand Down
2 changes: 1 addition & 1 deletion modules/kml/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

[loaders.gl](https://uber-web.github.io/loaders.gl/#/docs) is a collection of framework independent 3D and geospatial parsers and encoders.

This module contains loader for the KML format.
This module contains loader for the KML format.
2 changes: 1 addition & 1 deletion modules/las/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

[loaders.gl](https://uber-web.github.io/loaders.gl/#/docs) is a collection of framework independent 3D and geospatial parsers and encoders.

This module contains loader and writer for the LAS and LAZ formats.
This module contains loader and writer for the LAS and LAZ formats.
4 changes: 1 addition & 3 deletions modules/pcd/test/data/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@

## PCD

* The sample PCD files were copied from THREE.js `examples/models/pcd` under MIT license


- The sample PCD files were copied from THREE.js `examples/models/pcd` under MIT license
4 changes: 2 additions & 2 deletions modules/ply/test/data/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@

Samples from Google Draco `testdata`:

* bun_zipper.ply
* cube_att.ply
- bun_zipper.ply
- cube_att.ply

0 comments on commit b1164da

Please sign in to comment.