diff --git a/.eslintrc.js b/.eslintrc.js index 993f5ed2e..b5d706119 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -70,7 +70,6 @@ module.exports = { 'no-empty': 'off', 'no-unsafe-finally': 'off', 'no-dupe-keys': 'off', - 'no-irregular-whitespace': 'off', - 'no-regex-spaces': 'off' + 'no-irregular-whitespace': 'off' } }; diff --git a/src/stable-diffusion.js b/src/stable-diffusion.js index fd6a9c8fb..049685280 100644 --- a/src/stable-diffusion.js +++ b/src/stable-diffusion.js @@ -12,9 +12,7 @@ const writeFileAtomicSync = require('write-file-atomic').sync; */ function safeStr(x) { x = String(x); - for (let i = 0; i < 16; i++) { - x = x.replace(/ /g, ' '); - } + x = x.replace(/ +/g, ' '); x = x.trim(); x = x.replace(/^[\s,.]+|[\s,.]+$/g, ''); return x;