mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-18 16:01:40 +03:00
58084ac96e
refs #10618 - Updated lib safe string security method
12 lines
358 B
JavaScript
12 lines
358 B
JavaScript
const _ = require('lodash');
|
|
const slugify = require('@tryghost/string').slugify;
|
|
|
|
module.exports.safe = function safe(string, options) {
|
|
options = options || {};
|
|
let opts = {requiredChangesOnly: true};
|
|
if (!_.has(options, 'importing') || !options.importing) {
|
|
opts.requiredChangesOnly = false;
|
|
}
|
|
return slugify(string, opts);
|
|
};
|