Skip to content

Commit 9e9f294

Browse files
author
Henrik Ruscon
committed
swap out mjs with esm
1 parent 4cf7060 commit 9e9f294

File tree

15 files changed

+22
-14
lines changed

15 files changed

+22
-14
lines changed

.eslintrc.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,8 @@ module.exports = {
1414
SwitchCase: 1
1515
}
1616
],
17-
'space-before-function-paren': [
18-
'error',
19-
{ anonymous: 'always', named: 'never' }
20-
],
17+
'space-before-function-paren': ['error', { anonymous: 'always', named: 'never' }],
18+
'no-global-assign': 'off',
2119
'no-console': 'off',
2220
'vue/html-indent': ['error', 4]
2321
},

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@ import Hapi from 'hapi'
2828
import Inert from 'inert'
2929
import Joi from 'joi'
3030
import HapiDocs from '@surveylegend/hapi-docs'
31-
import Package from './package'
31+
import { version } from './package'
3232

3333
const options = {
3434
info: {
3535
title: 'Test API Reference',
36-
version: Package.version
36+
version
3737
}
3838
}
3939

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
import Hapi from 'hapi'
22
import Inert from 'inert'
33
import Joi from 'joi'
4-
import Package from '../package'
4+
import { name, version } from '../package'
55
import plugin from '../lib'
66

77
const options = {
8+
sortTags: 'ordered',
89
sortEndpoints: 'ordered',
910
info: {
1011
description:
@@ -14,17 +15,20 @@ const options = {
1415
{
1516
name: 'customers',
1617
description:
17-
'`Customer` objects allow you to perform recurring charges, and to track multiple charges, that are associated with the same customer. The API allows you to create, delete, and update your customers. You can retrieve individual customers as well as a list of all your customers.'
18+
'`Customer` objects allow you to perform recurring charges, and to track multiple charges, that are associated with the same customer. The API allows you to create, delete, and update your customers. You can retrieve individual customers as well as a list of all your customers.',
19+
order: 1
1820
},
1921
{
2022
name: 'refunds',
2123
description:
22-
'`Refund` objects allow you to refund a charge that has previously been created but not yet refunded. Funds will be refunded to the credit or debit card that was originally charged.'
24+
'`Refund` objects allow you to refund a charge that has previously been created but not yet refunded. Funds will be refunded to the credit or debit card that was originally charged.',
25+
order: 2
2326
},
2427
{
2528
name: 'recipients',
2629
description:
2730
'With `Recipient` objects, you can transfer money from your Stripe account to a third-party bank account or debit card. The API allows you to create, delete, and update your recipients. You can retrieve individual recipients as well as a list of all your recipients.',
31+
order: 3,
2832
deprecated: true
2933
}
3034
]
@@ -370,7 +374,7 @@ const startServer = async () => {
370374

371375
await server.start()
372376

373-
console.log(`${Package.name} (v.${Package.version}) server listening on ${server.info.uri}`)
377+
console.log(`${name} (v.${version}) server listening on ${server.info.uri}`)
374378
}
375379

376380
startServer().catch(console.error)

index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
require = require('esm')(module /*, options */)
2+
module.exports = require('./lib')
File renamed without changes.
File renamed without changes.
File renamed without changes.

lib/index.mjs renamed to lib/index.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,6 @@ const plugin = {
6666

6767
await server.dependency('inert')
6868

69-
const __dirname = Path.dirname(new URL(import.meta.url).pathname)
70-
7169
server.route([
7270
{
7371
method: 'GET',
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)