Skip to content

Commit

Permalink
Merge pull request #280 from mimi89999/lint_scripts
Browse files Browse the repository at this point in the history
chore(project): Fix lint issues in scripts
  • Loading branch information
MrWook authored Sep 30, 2024
2 parents 3c304eb + 8574d6d commit b6045c1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
14 changes: 7 additions & 7 deletions scripts/jsonPlugin.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ const json = () => {

try {
const parsed = JSON.parse(json)
var code
let code
if (Array.isArray(parsed)) {
const data = parsed.join(',')
const data_buf = strToU8(data)
const compressed = compressSync(data_buf, { level: 9, mem: 12 })
const dataBuf = strToU8(data)
const compressed = compressSync(dataBuf, { level: 9, mem: 12 })
const encoded = encodeBase85(compressed)

code = `
Expand All @@ -27,10 +27,10 @@ const json = () => {
const encoded = "${encoded}"
const decoded = decodeBase85(encoded)
const decompressed_buf = decompressSync(decoded)
const decompressed = strFromU8(decompressed_buf);
const decompressed_array = decompressed.split(',')
export default decompressed_array`
const decompressedBuf = decompressSync(decoded)
const decompressed = strFromU8(decompressedBuf);
const decompressedArray = decompressed.split(',')
export default decompressedArray`
} else {
const data = JSON.stringify(parsed)
code = `export default ${data}`
Expand Down
6 changes: 5 additions & 1 deletion scripts/rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,11 @@ const generateConfig = async (type, minify = false) => {
}

if (type === 'iife') {
pluginsOnlyOnce.push(nodeResolve({ resolveOnly: ['fastest-levenshtein', '@alttiri/base85', 'fflate'] }))
pluginsOnlyOnce.push(
nodeResolve({
resolveOnly: ['fastest-levenshtein', '@alttiri/base85', 'fflate'],
}),
)
} else {
external.push('fastest-levenshtein', '@alttiri/base85', 'fflate')
}
Expand Down

0 comments on commit b6045c1

Please sign in to comment.