Socket
Socket
Sign inDemoInstall

svelte-preprocess

Package Overview
Dependencies
Maintainers
1
Versions
174
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

svelte-preprocess - npm Package Compare versions

Comparing version 2.3.0 to 2.3.1

2

package.json
{
"name": "svelte-preprocess",
"version": "2.3.0",
"version": "2.3.1",
"license": "MIT",

@@ -5,0 +5,0 @@ "main": "src/index.js",

@@ -13,2 +13,3 @@ const stripIndent = require('strip-indent')

sliceReplace,
aliasOverrides,
} = require('./utils.js')

@@ -19,2 +20,4 @@

module.exports = ({ onBefore, transformers = {}, aliases } = {}) => {
const optionsCache = {}
if (aliases && aliases.length) {

@@ -28,11 +31,18 @@ addLanguageAlias(aliases)

}
let opts = transformers[lang] || {}
if (lang !== alias && typeof transformerOpts !== 'function') {
opts = {
...opts,
...(transformers[alias] || {}),
if (typeof optionsCache[alias] === 'undefined') {
let opts = transformers[lang] || {}
if (lang !== alias) {
opts = {
...opts,
...(aliasOverrides[alias] || {}),
...(transformers[alias] || {}),
}
}
optionsCache[alias] = opts
}
return opts
return optionsCache[alias]
}

@@ -57,3 +67,6 @@

if (transformers[lang] === false) {
if (
transformers[lang] === false ||
(lang !== alias && transformers[alias] === false)
) {
throwUnsupportedError(alias, filename)

@@ -60,0 +73,0 @@ }

@@ -18,2 +18,8 @@ const { readFileSync } = require('fs')

exports.aliasOverrides = {
sass: {
indentedSyntax: true,
},
}
exports.throwError = msg => {

@@ -20,0 +26,0 @@ throw new Error(`[svelte-preprocess] ${msg}`)

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc