Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

smart-preprocessor

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

smart-preprocessor - npm Package Compare versions

Comparing version 0.0.9 to 0.0.10

31

lib/smartPreprocessor.js

@@ -192,18 +192,19 @@ /*

{
var resolvedPath , outputPath , filename ;
var resolvedPath , outputPath , outputFilename , sppId , preprocessedModule ;
if ( ! options || typeof options !== 'object' ) { options = {} ; }
resolvedPath = require.resolve( id ) ;
sppId = resolvedPath = require.resolve( id ) ;
if ( options.multi )
if ( options.multi ) { sppId += JSON.stringify( parameters ) ; }
if ( smartPreprocessor.require.cache[ sppId ] )
{
filename = hash.fingerprint( resolvedPath + JSON.stringify( parameters ) ) ;
//console.log( 'Cache hit!' ) ;
return smartPreprocessor.require.cache[ sppId ] ;
}
else
{
filename = hash.fingerprint( resolvedPath ) ;
}
outputPath = osTmpDir + '/' + filename + '.js' ;
outputFilename = hash.fingerprint( sppId ) ;
outputPath = osTmpDir + '/' + outputFilename + '.js' ;
//console.log( "outputPath: " , outputPath ) ;

@@ -213,3 +214,8 @@

return require( outputPath ) ;
preprocessedModule = require( outputPath ) ;
// Put the preprocecessed module in the cache
smartPreprocessor.require.cache[ sppId ] = preprocessedModule ;
return preprocessedModule ;
} ;

@@ -219,2 +225,7 @@

// The module cache, so same files are not preprocessed again and again
smartPreprocessor.require.cache = {} ;
// Build synchronously: preprocess a file and write the build.

@@ -221,0 +232,0 @@ smartPreprocessor.buildSync = function buildSync( inputPath , outputPath , parameters )

{
"name": "smart-preprocessor",
"version": "0.0.9",
"version": "0.0.10",
"description": "A smart preprocessor for Node.",

@@ -5,0 +5,0 @@ "main": "lib/smartPreprocessor.js",

@@ -538,2 +538,3 @@ /*

it( "Test the cache of .require()" ) ;
} ) ;

@@ -543,1 +544,3 @@

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