Skip to content

Commit 8e77a86

Browse files
authored
Switched to more correct JSDoc types for primitives (TryGhost#27430)
no ref This is a types-only change that should have no user impact. This is, effectively, the whole diff: ```diff -@param {String} foo +@param {string} foo ``` `String` is less correct than `string`, and [will not be supported by TypeScript in an upcoming version][0]. All I did was run `sed` on a bunch of files. [0]: https://devblogs.microsoft.com/typescript/progress-on-typescript-7-december-2025/#javascript-checking-and-jsdoc-compatibility
1 parent 434af39 commit 8e77a86

79 files changed

Lines changed: 269 additions & 269 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

ghost/admin/app/utils/currency.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,8 @@ export function getCurrencyOptions() {
167167
* Returns the minimum charge amount for a given currency,
168168
* based on Stripe's requirements. Values here are double the Stripe limits, to take conversions to the settlement currency into account.
169169
* @see https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts
170-
* @param {String} currency — Currency in the 3-letter ISO format (e.g. "USD", "EUR")
171-
* @returns {Number} — Minimum amount
170+
* @param {string} currency — Currency in the 3-letter ISO format (e.g. "USD", "EUR")
171+
* @returns {number} — Minimum amount
172172
*/
173173
export function minimumAmountForCurrency(currency) {
174174
const isoCurrency = currency?.toUpperCase();

ghost/admin/app/validators/mixins/password.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ export default Mixin.create({
1717
/**
1818
* Counts repeated characters if a string. When 50% or more characters are the same,
1919
* we return false and therefore invalidate the string.
20-
* @param {String} stringToTest The password string to check.
21-
* @return {Boolean}
20+
* @param {string} stringToTest The password string to check.
21+
* @return {boolean}
2222
*/
2323
_characterOccurance(stringToTest) {
2424
let chars = {};

ghost/core/core/boot.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,8 @@ async function initFrontend(dataService) {
225225
* What we want is to be able to optionally load various components and mount them
226226
* So eventually this function should go away
227227
* @param {Object} options
228-
* @param {Boolean} options.backend
229-
* @param {Boolean} options.frontend
228+
* @param {boolean} options.backend
229+
* @param {boolean} options.frontend
230230
* @param {Object} options.config
231231
*/
232232
async function initExpressApps({frontend, backend, config}) {

ghost/core/core/frontend/helpers/collection.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ function parseOptions(options) {
3636

3737
/**
3838
*
39-
* @param {String} resource
40-
* @param {String} controllerName
41-
* @param {String} action
39+
* @param {string} resource
40+
* @param {string} controllerName
41+
* @param {string} action
4242
* @param {Object} apiOptions
4343
* @returns {Promise<Object>}
4444
*/

ghost/core/core/frontend/helpers/get.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,8 @@ function isBrowse(options) {
150150
* Find and resolve path strings
151151
*
152152
* @param {Object} data
153-
* @param {String} value
154-
* @returns {String}
153+
* @param {string} value
154+
* @returns {string}
155155
*/
156156
function resolvePaths(globals, data, value) {
157157
const regex = /\{\{(.*?)\}\}/g;
@@ -285,9 +285,9 @@ function optimiseFilterCacheability(resource, options) {
285285

286286
/**
287287
*
288-
* @param {String} resource
289-
* @param {String} controllerName
290-
* @param {String} action
288+
* @param {string} resource
289+
* @param {string} controllerName
290+
* @param {string} action
291291
* @param {GetHelperAPIOptions} apiOptions
292292
* @returns {Promise<Object>}
293293
*/
@@ -381,7 +381,7 @@ function renderResponse(response, resource, options, data) {
381381

382382
/**
383383
* ## Get
384-
* @param {String} resource
384+
* @param {string} resource
385385
* @param {Object} options
386386
* @returns {Promise<any>}
387387
*/

ghost/core/core/frontend/helpers/has.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,8 @@ function evaluateStringMatch(expr, str, ci) {
101101

102102
/**
103103
*
104-
* @param {String} type - either some or every - the lodash function to use
105-
* @param {String} expr - the attribute value passed into {{#has}}
104+
* @param {string} type - either some or every - the lodash function to use
105+
* @param {string} expr - the attribute value passed into {{#has}}
106106
* @param {Object} obj - "this" context from the helper
107107
* @param {Object} data - global params
108108
*/

ghost/core/core/frontend/services/data/entry-lookup.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const routeMatch = require('path-match')();
55

66
/**
77
* Query API for a single entry/resource.
8-
* @param {String} postUrl
8+
* @param {string} postUrl
99
* @param {Object} routerOptions
1010
* @param {Object} locals
1111
* @returns {*}

ghost/core/core/frontend/services/data/fetch-data.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ defaultPostQuery.options = defaultQueryOptions.options;
3939
* Converts the query config to a promise for the result
4040
*
4141
* @param {Object} query
42-
* @param {String} slugParam
42+
* @param {string} slugParam
4343
* @returns {Promise}
4444
*/
4545
function processQuery(query, slugParam, locals) {

ghost/core/core/frontend/services/rendering/templates.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ _private.getEntryTemplateHierarchy = function getEntryTemplateHierarchy(postObje
107107
* Cycle through and find the first one which has a match in the theme
108108
*
109109
* @param {Array|String} templateList
110-
* @param {String} fallback - a fallback template
110+
* @param {string} fallback - a fallback template
111111
*/
112112
_private.pickTemplate = function pickTemplate(templateList, fallback) {
113113
let template;

ghost/core/core/frontend/services/routing/collection-router.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ class CollectionRouter extends ParentRouter {
135135
/**
136136
* @description Get index route e.g. /, /blog/
137137
* @param {Object} options
138-
* @returns {String}
138+
* @returns {string}
139139
*/
140140
getRoute(options) {
141141
options = options || {};
@@ -146,7 +146,7 @@ class CollectionRouter extends ParentRouter {
146146
/**
147147
* @description Generate rss url.
148148
* @param {Object} options
149-
* @returns {String}
149+
* @returns {string}
150150
*/
151151
getRssUrl(options) {
152152
if (!this.rss) {

0 commit comments

Comments
 (0)