Skip to content

Commit

Permalink
Lint JavaScript
Browse files Browse the repository at this point in the history
  • Loading branch information
paulrobertlloyd committed Nov 14, 2024
1 parent 4851552 commit f8b21be
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions lib/utils.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
const { join } = require('node:path')

const get = require('lodash.get')
const toPath = require('lodash.topath')

/**
* Get path to fork
*
* @param {object} forks - All the possible forks for a given path
* @param {object} req - Express request
* @returns {string} Path to fork to if conditions are met
Expand Down Expand Up @@ -47,6 +49,7 @@ const getFork = (forks, req) => {

/**
* Get path with combined search params
*
* @param {string} originalUrl - Original URL path
* @param {string} path - Path to add params to
* @param {string} [baseUrl] - Base URL
Expand All @@ -73,6 +76,7 @@ const getPathWithSearchParams = (originalUrl, path, baseUrl) => {

/**
* Get search parameters
*
* @param {string} originalUrl - Original URL path
* @returns {URLSearchParams} Search parameters
*/
Expand Down
1 change: 1 addition & 0 deletions test/utils.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const assert = require('node:assert/strict')
const { describe, it } = require('node:test')

const utils = require('../lib/utils.js')

describe('Utility functions', () => {
Expand Down
1 change: 1 addition & 0 deletions test/wizard-with-base-url.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const assert = require('node:assert/strict')
const { describe, it } = require('node:test')

const wizard = require('../wizard.js')

describe('GOV.UK Prototype Wizard (with baseUrl)', () => {
Expand Down
1 change: 1 addition & 0 deletions test/wizard.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const assert = require('node:assert/strict')
const { describe, it } = require('node:test')

const wizard = require('../wizard.js')

describe('GOV.UK Prototype Wizard', () => {
Expand Down
3 changes: 2 additions & 1 deletion wizard.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
const utils = require('./lib/utils.js')

/**
* Get next, back and current paths in user journey.
* Get next, back and current paths in user journey
*
* @param {object} journey - Sequence of paths in user journey
* @param {object} req - Express request
* @returns {object} Next and back paths
Expand Down

0 comments on commit f8b21be

Please sign in to comment.