Socket
Socket
Sign inDemoInstall

svelte-preprocess

Package Overview
Dependencies
Maintainers
1
Versions
175
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 3.1.3 to 3.1.4

10

CHANGELOG.md

@@ -1,2 +0,2 @@

## [3.1.3](https://github.com/kaisermann/svelte-preprocess/compare/v3.1.1...v3.1.3) (2019-10-23)
## [3.1.4](https://github.com/kaisermann/svelte-preprocess/compare/v3.1.2...v3.1.4) (2019-10-23)

@@ -7,2 +7,10 @@

* :bug: Try to only include files with local paths ([4c2c4e3](https://github.com/kaisermann/svelte-preprocess/commit/4c2c4e317e8de62bc161e7a1626892f08e98ce82))
## [3.1.2](https://github.com/kaisermann/svelte-preprocess/compare/v3.1.1...v3.1.2) (2019-09-25)
### Bug Fixes
* 🐛 import less cjs instead of es6 ([bf8627f](https://github.com/kaisermann/svelte-preprocess/commit/bf8627f3f4bde0d598769a67de10194bbcf04701))

@@ -9,0 +17,0 @@

2

package.json
{
"name": "svelte-preprocess",
"version": "3.1.3",
"version": "3.1.4",
"license": "MIT",

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

@@ -1,2 +0,2 @@

const { readFile } = require('fs');
const { readFile, exists } = require('fs');
const { resolve, dirname, basename } = require('path');

@@ -26,5 +26,7 @@

const resolveSrc = (exports.resolveSrc = (importerFile, srcPath) =>
resolve(dirname(importerFile), srcPath));
const resolveSrc = (importerFile, srcPath) =>
resolve(dirname(importerFile), srcPath);
const doesFileExist = path => new Promise(res => exists(path, res));
const getSrcContent = (exports.getSrcContent = file => {

@@ -44,6 +46,8 @@ return new Promise((resolve, reject) => {

/** Only try to get local files (path starts with ./ or ../) */
if (attributes.src.match(/^\.{1,2}\//)) {
const file = resolveSrc(filename, attributes.src);
content = await getSrcContent(file);
dependencies.push(file);
if (attributes.src.match(/^(https?:)?\/\//) == null) {
const filepath = resolveSrc(filename, attributes.src);
if (await doesFileExist(filepath)) {
content = await getSrcContent(filepath);
dependencies.push(filepath);
}
}

@@ -50,0 +54,0 @@ }

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