Socket
Socket
Sign inDemoInstall

detective-sass

Package Overview
Dependencies
Maintainers
3
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

detective-sass - npm Package Compare versions

Comparing version 4.1.3 to 5.0.0

15

index.js

@@ -12,3 +12,3 @@ 'use strict';

*
* @param {String} fileContent
* @param {String} content
* @param {Object} options

@@ -18,12 +18,11 @@ * @param {Boolean} options.url - detect any url() references to images, fonts, etc.

*/
module.exports = function detective(fileContent, options) {
if (typeof fileContent === 'undefined') throw new Error('content not given');
if (typeof fileContent !== 'string') throw new Error('content is not a string');
module.exports = function detective(content, options) {
if (content === undefined) throw new Error('content not given');
if (typeof content !== 'string') throw new Error('content is not a string');
const isUrlEnabled = options && options.url;
let ast = {};
try {
debug('content: %s', fileContent);
ast = sass.parse(fileContent, { syntax: 'sass' });
debug('content: %s', content);
ast = sass.parse(content, { syntax: 'sass' });
} catch (error) {

@@ -44,3 +43,3 @@ debug('parse error: %s', error.message);

if (isUrlEnabled && node.type === 'uri') {
if (options?.url && node.type === 'uri') {
dependencies = [...dependencies, ...extractUriDependencies(node)];

@@ -47,0 +46,0 @@ }

{
"name": "detective-sass",
"version": "4.1.3",
"version": "5.0.0",
"description": "Find the dependencies of a sass file",

@@ -33,7 +33,7 @@ "main": "index.js",

"engines": {
"node": ">=12"
"node": ">=14"
},
"dependencies": {
"gonzales-pe": "^4.3.0",
"node-source-walk": "^5.0.1"
"node-source-walk": "^6.0.0"
},

@@ -43,3 +43,3 @@ "devDependencies": {

"uvu": "^0.5.6",
"xo": "^0.52.4"
"xo": "^0.54.2"
},

@@ -46,0 +46,0 @@ "xo": {

@@ -1,3 +0,7 @@

### detective-sass [![CI](https://img.shields.io/github/actions/workflow/status/dependents/node-detective-sass/ci.yml?branch=main&label=CI&logo=github)](https://github.com/dependents/node-detective-sass/actions/workflows/ci.yml?query=branch%3Amain) [![npm version](https://img.shields.io/npm/v/detective-sass?logo=npm&logoColor=fff)](https://www.npmjs.com/package/detective-sass) [![npm downloads](https://img.shields.io/npm/dm/detective-sass)](https://www.npmjs.com/package/detective-sass)
# detective-sass
[![CI](https://img.shields.io/github/actions/workflow/status/dependents/node-detective-sass/ci.yml?branch=main&label=CI&logo=github)](https://github.com/dependents/node-detective-sass/actions/workflows/ci.yml?query=branch%3Amain)
[![npm version](https://img.shields.io/npm/v/detective-sass?logo=npm&logoColor=fff)](https://www.npmjs.com/package/detective-sass)
[![npm downloads](https://img.shields.io/npm/dm/detective-sass)](https://www.npmjs.com/package/detective-sass)
> Find the dependencies of a sass file

@@ -15,3 +19,3 @@

### Usage
## Usage

@@ -31,3 +35,3 @@ ```js

### Related
## Related

@@ -37,4 +41,4 @@ * [node-sass-lookup](https://github.com/dependents/node-sass-lookup) if you want to map a sass/scss dependency to a file on your filesystem.

### License
## License
[MIT](LICENSE)
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