mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-04-08 02:52:39 -05:00
refactored security.string to be more readable (#15127)
refs #15126 - Logic can be simplified - Add JSDoc types
This commit is contained in:
parent
2f1844e7e9
commit
bcafb84c44
1 changed files with 5 additions and 5 deletions
|
@ -1,9 +1,9 @@
|
|||
const slugify = require('@tryghost/string').slugify;
|
||||
|
||||
/**
|
||||
* @param {string} string
|
||||
* @param {{importing?: boolean}} [options]
|
||||
*/
|
||||
module.exports.safe = function safe(string, options = {}) {
|
||||
let opts = {requiredChangesOnly: true};
|
||||
if (!('importing' in options) || !options.importing) {
|
||||
opts.requiredChangesOnly = false;
|
||||
}
|
||||
return slugify(string, opts);
|
||||
return slugify(string, {requiredChangesOnly: options.importing === true});
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue