Ghost/ghost/security/lib/string.js
Vikas Potluri bcafb84c44
refactored security.string to be more readable (#15127)
refs #15126

- Logic can be simplified
- Add JSDoc types
2022-08-02 12:49:17 +01:00

10 lines
274 B
JavaScript

const slugify = require('@tryghost/string').slugify;
/**
* @param {string} string
* @param {{importing?: boolean}} [options]
*/
module.exports.safe = function safe(string, options = {}) {
return slugify(string, {requiredChangesOnly: options.importing === true});
};