Skip to content

Commit

Permalink
refactor: format js files
Browse files Browse the repository at this point in the history
  • Loading branch information
paulfouquet committed Dec 4, 2023
1 parent 506782f commit 796f122
Show file tree
Hide file tree
Showing 16 changed files with 51 additions and 36 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import o from 'ospec';
import Ajv from 'ajv';
import { promises as fs } from 'fs';
import o from 'ospec';
import { dirname, join } from 'path';
import { fileURLToPath } from 'url';
import { promises as fs } from 'fs';

import { AjvOptions, DefaultTimeoutMillis } from '../../../validation.mjs';

const __dirname = dirname(fileURLToPath(import.meta.url));
Expand Down
5 changes: 3 additions & 2 deletions extensions/aerial-photo/tests/aerial_photo_item.test.mjs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import o from 'ospec';
import Ajv from 'ajv';
import { promises as fs } from 'fs';
import o from 'ospec';
import { dirname, join } from 'path';
import { fileURLToPath } from 'url';
import { promises as fs } from 'fs';

import { AjvOptions, DefaultTimeoutMillis } from '../../../validation.mjs';

const __dirname = dirname(fileURLToPath(import.meta.url));
Expand Down
5 changes: 3 additions & 2 deletions extensions/camera/tests/camera_collection.test.mjs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import o from 'ospec';
import Ajv from 'ajv';
import { promises as fs } from 'fs';
import o from 'ospec';
import { dirname, join } from 'path';
import { fileURLToPath } from 'url';
import { promises as fs } from 'fs';

import { AjvOptions, DefaultTimeoutMillis } from '../../../validation.js';

const __dirname = dirname(fileURLToPath(import.meta.url));
Expand Down
5 changes: 3 additions & 2 deletions extensions/camera/tests/camera_item.test.mjs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import o from 'ospec';
import Ajv from 'ajv';
import { promises as fs } from 'fs';
import o from 'ospec';
import { dirname, join } from 'path';
import { fileURLToPath } from 'url';
import { promises as fs } from 'fs';

import { AjvOptions, DefaultTimeoutMillis } from '../../../validation.js';

const __dirname = dirname(fileURLToPath(import.meta.url));
Expand Down
5 changes: 3 additions & 2 deletions extensions/film/tests/film_collection.test.mjs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import o from 'ospec';
import Ajv from 'ajv';
import { promises as fs } from 'fs';
import o from 'ospec';
import { dirname, join } from 'path';
import { fileURLToPath } from 'url';
import { promises as fs } from 'fs';

import { AjvOptions, DefaultTimeoutMillis } from '../../../validation.js';

const __dirname = dirname(fileURLToPath(import.meta.url));
Expand Down
5 changes: 3 additions & 2 deletions extensions/film/tests/film_item.test.mjs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import o from 'ospec';
import Ajv from 'ajv';
import { promises as fs } from 'fs';
import o from 'ospec';
import { dirname, join } from 'path';
import { fileURLToPath } from 'url';
import { promises as fs } from 'fs';

import { AjvOptions, DefaultTimeoutMillis } from '../../../validation.js';

const __dirname = dirname(fileURLToPath(import.meta.url));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import o from 'ospec';
import Ajv from 'ajv';
import { promises as fs } from 'fs';
import o from 'ospec';
import { dirname, join } from 'path';
import { fileURLToPath } from 'url';
import { promises as fs } from 'fs';

import { AjvOptions, DefaultTimeoutMillis } from '../../../validation.js';

const __dirname = dirname(fileURLToPath(import.meta.url));
Expand Down Expand Up @@ -98,7 +99,7 @@ o.spec('Historical Imagery Extension Collection', () => {
// given
for (const role of ['producer', 'licensor', 'processor', 'host']) {
const example = JSON.parse(await fs.readFile(examplePath));
example.providers = example.providers.filter((provider) => !role in provider.roles);
example.providers = example.providers.filter((provider) => (!role) in provider.roles);

// when
let valid = validate(example);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import o from 'ospec';
import Ajv from 'ajv';
import { promises as fs } from 'fs';
import o from 'ospec';
import { dirname, join } from 'path';
import { fileURLToPath } from 'url';
import { promises as fs } from 'fs';

import { AjvOptions, DefaultTimeoutMillis } from '../../../validation.js';

const __dirname = dirname(fileURLToPath(import.meta.url));
Expand Down
9 changes: 5 additions & 4 deletions extensions/linz/tests/linz_collection.test.mjs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import o from 'ospec';
import Ajv from 'ajv';
import { promises as fs } from 'fs';
import o from 'ospec';
import { dirname, join } from 'path';
import { fileURLToPath } from 'url';
import { promises as fs } from 'fs';

import { AjvOptions, DefaultTimeoutMillis } from '../../../validation.js';

const __dirname = dirname(fileURLToPath(import.meta.url));
Expand Down Expand Up @@ -404,7 +405,7 @@ o.spec('LINZ collection', () => {
// given
for (const role of ['producer', 'licensor']) {
const example = JSON.parse(await fs.readFile(examplePath));
example.providers = example.providers.filter((provider) => !role in provider.roles);
example.providers = example.providers.filter((provider) => (!role) in provider.roles);

// when
let valid = validate(example);
Expand All @@ -423,7 +424,7 @@ o.spec('LINZ collection', () => {
// given
for (const role of ['manager', 'custodian']) {
const example = JSON.parse(await fs.readFile(examplePath));
example['linz:providers'] = example['linz:providers'].filter((provider) => !role in provider.roles);
example['linz:providers'] = example['linz:providers'].filter((provider) => (!role) in provider.roles);

// when
let valid = validate(example);
Expand Down
7 changes: 4 additions & 3 deletions extensions/linz/tests/linz_item.test.mjs
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import Ajv from 'ajv';
import { promises as fs } from 'fs';
import o from 'ospec';
import { AjvOptions, DefaultTimeoutMillis } from '../../../validation.js';
import { dirname, join } from 'path';
import { fileURLToPath } from 'url';
import { promises as fs } from 'fs';
import Ajv from 'ajv';

import { AjvOptions, DefaultTimeoutMillis } from '../../../validation.js';

const __dirname = dirname(fileURLToPath(import.meta.url));
const schemaPath = join(__dirname, '..', 'schema.json');
Expand Down
5 changes: 3 additions & 2 deletions extensions/quality/tests/quality_collection.test.mjs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import o from 'ospec';
import Ajv from 'ajv';
import { promises as fs } from 'fs';
import o from 'ospec';
import { dirname, join } from 'path';
import { fileURLToPath } from 'url';
import { promises as fs } from 'fs';

import { AjvOptions, DefaultTimeoutMillis } from '../../../validation.js';

const __dirname = dirname(fileURLToPath(import.meta.url));
Expand Down
5 changes: 3 additions & 2 deletions extensions/scanning/tests/scanning_collection.test.mjs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import o from 'ospec';
import Ajv from 'ajv';
import { promises as fs } from 'fs';
import o from 'ospec';
import { dirname, join } from 'path';
import { fileURLToPath } from 'url';
import { promises as fs } from 'fs';

import { AjvOptions, DefaultTimeoutMillis } from '../../../validation.js';

const __dirname = dirname(fileURLToPath(import.meta.url));
Expand Down
5 changes: 3 additions & 2 deletions extensions/scanning/tests/scanning_item.test.mjs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import o from 'ospec';
import Ajv from 'ajv';
import { promises as fs } from 'fs';
import o from 'ospec';
import { dirname, join } from 'path';
import { fileURLToPath } from 'url';
import { promises as fs } from 'fs';

import { AjvOptions, DefaultTimeoutMillis } from '../../../validation.js';

const __dirname = dirname(fileURLToPath(import.meta.url));
Expand Down
5 changes: 3 additions & 2 deletions extensions/template/tests/template_collection.test.mjs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import o from 'ospec';
import Ajv from 'ajv';
import { promises as fs } from 'fs';
import o from 'ospec';
import { dirname, join } from 'path';
import { fileURLToPath } from 'url';
import { promises as fs } from 'fs';

import { AjvOptions, DefaultTimeoutMillis } from '../../../validation.js';

const __dirname = dirname(fileURLToPath(import.meta.url));
Expand Down
5 changes: 3 additions & 2 deletions extensions/template/tests/template_item.test.mjs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import o from 'ospec';
import Ajv from 'ajv';
import { promises as fs } from 'fs';
import o from 'ospec';
import { dirname, join } from 'path';
import { fileURLToPath } from 'url';
import { promises as fs } from 'fs';

import { AjvOptions, DefaultTimeoutMillis } from '../../../validation.js';

const __dirname = dirname(fileURLToPath(import.meta.url));
Expand Down
4 changes: 2 additions & 2 deletions validation.mjs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import axios from 'axios';
import { promises as fs } from 'fs';
import { dirname, join } from 'path';
import { fileURLToPath } from 'url';
import { promises as fs } from 'fs';
const __dirname = dirname(fileURLToPath(import.meta.url));
import iriFormats from 'stac-node-validator/iri.js';
import { fastFormats } from 'ajv-formats/dist/formats.js';
import iriFormats from 'stac-node-validator/iri.js';

const Schemas = new Map();
export function loadSchema(uri) {
Expand Down

0 comments on commit 796f122

Please sign in to comment.