Migrate from CommonJS to ESM (#6651)
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
'use strict'
|
||||
|
||||
const Joi = require('joi')
|
||||
const { nonNegativeInteger } = require('../validators')
|
||||
const KeybaseProfile = require('./keybase-profile')
|
||||
import Joi from 'joi'
|
||||
import { nonNegativeInteger } from '../validators.js'
|
||||
import KeybaseProfile from './keybase-profile.js'
|
||||
|
||||
const bitcoinAddressSchema = Joi.object({
|
||||
status: Joi.object({
|
||||
@@ -28,7 +26,7 @@ const bitcoinAddressSchema = Joi.object({
|
||||
.max(1),
|
||||
}).required()
|
||||
|
||||
module.exports = class KeybaseBTC extends KeybaseProfile {
|
||||
export default class KeybaseBTC extends KeybaseProfile {
|
||||
static route = {
|
||||
base: 'keybase/btc',
|
||||
pattern: ':username',
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
'use strict'
|
||||
|
||||
const { withRegex } = require('../test-validators')
|
||||
const t = (module.exports = require('../tester').createServiceTester())
|
||||
import { withRegex } from '../test-validators.js'
|
||||
import { createServiceTester } from '../tester.js'
|
||||
export const t = await createServiceTester()
|
||||
|
||||
t.create('existing bitcoin address')
|
||||
.get('/skyplabs.json')
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
'use strict'
|
||||
|
||||
const Joi = require('joi')
|
||||
const { nonNegativeInteger } = require('../validators')
|
||||
const KeybaseProfile = require('./keybase-profile')
|
||||
import Joi from 'joi'
|
||||
import { nonNegativeInteger } from '../validators.js'
|
||||
import KeybaseProfile from './keybase-profile.js'
|
||||
|
||||
const keyFingerprintSchema = Joi.object({
|
||||
status: Joi.object({
|
||||
@@ -24,7 +22,7 @@ const keyFingerprintSchema = Joi.object({
|
||||
.max(1),
|
||||
}).required()
|
||||
|
||||
module.exports = class KeybasePGP extends KeybaseProfile {
|
||||
export default class KeybasePGP extends KeybaseProfile {
|
||||
static route = {
|
||||
base: 'keybase/pgp',
|
||||
pattern: ':username',
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
'use strict'
|
||||
|
||||
const Joi = require('joi')
|
||||
const t = (module.exports = require('../tester').createServiceTester())
|
||||
import Joi from 'joi'
|
||||
import { createServiceTester } from '../tester.js'
|
||||
export const t = await createServiceTester()
|
||||
|
||||
t.create('existing key fingerprint')
|
||||
.get('/skyplabs.json')
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
'use strict'
|
||||
import { BaseJsonService, NotFound } from '../index.js'
|
||||
|
||||
const { BaseJsonService } = require('..')
|
||||
const { NotFound } = require('..')
|
||||
|
||||
module.exports = class KeybaseProfile extends BaseJsonService {
|
||||
export default class KeybaseProfile extends BaseJsonService {
|
||||
static get apiVersion() {
|
||||
throw new Error(`apiVersion() is not implemented for ${this.name}`)
|
||||
}
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
'use strict'
|
||||
|
||||
const Joi = require('joi')
|
||||
const { nonNegativeInteger } = require('../validators')
|
||||
const KeybaseProfile = require('./keybase-profile')
|
||||
import Joi from 'joi'
|
||||
import { nonNegativeInteger } from '../validators.js'
|
||||
import KeybaseProfile from './keybase-profile.js'
|
||||
|
||||
const stellarAddressSchema = Joi.object({
|
||||
status: Joi.object({
|
||||
@@ -26,7 +24,7 @@ const stellarAddressSchema = Joi.object({
|
||||
.max(1),
|
||||
}).required()
|
||||
|
||||
module.exports = class KeybaseXLM extends KeybaseProfile {
|
||||
export default class KeybaseXLM extends KeybaseProfile {
|
||||
static route = {
|
||||
base: 'keybase/xlm',
|
||||
pattern: ':username',
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
'use strict'
|
||||
|
||||
const { withRegex } = require('../test-validators')
|
||||
const t = (module.exports = require('../tester').createServiceTester())
|
||||
import { withRegex } from '../test-validators.js'
|
||||
import { createServiceTester } from '../tester.js'
|
||||
export const t = await createServiceTester()
|
||||
|
||||
t.create('existing stellar address')
|
||||
.get('/skyplabs.json')
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
'use strict'
|
||||
|
||||
const Joi = require('joi')
|
||||
const { nonNegativeInteger } = require('../validators')
|
||||
const KeybaseProfile = require('./keybase-profile')
|
||||
import Joi from 'joi'
|
||||
import { nonNegativeInteger } from '../validators.js'
|
||||
import KeybaseProfile from './keybase-profile.js'
|
||||
|
||||
const zcachAddressSchema = Joi.object({
|
||||
status: Joi.object({
|
||||
@@ -28,7 +26,7 @@ const zcachAddressSchema = Joi.object({
|
||||
.max(1),
|
||||
}).required()
|
||||
|
||||
module.exports = class KeybaseZEC extends KeybaseProfile {
|
||||
export default class KeybaseZEC extends KeybaseProfile {
|
||||
static route = {
|
||||
base: 'keybase/zec',
|
||||
pattern: ':username',
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
'use strict'
|
||||
|
||||
const { withRegex } = require('../test-validators')
|
||||
const t = (module.exports = require('../tester').createServiceTester())
|
||||
import { withRegex } from '../test-validators.js'
|
||||
import { createServiceTester } from '../tester.js'
|
||||
export const t = await createServiceTester()
|
||||
|
||||
t.create('existing zcash address')
|
||||
.get('/skyplabs.json')
|
||||
|
||||
Reference in New Issue
Block a user