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

builder-amd-css

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

builder-amd-css - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

test/fixtures/css-elsewhere/a/bar.js

9

bower_components/require-css/css-builder.js

@@ -36,5 +36,4 @@ define(['require', './normalize'], function(req, normalize) {

function loadFile(path) {
if ( config.asReference && config.asReference.files ) {
var files = config.asReference.files;
return files[ path.replace( /^\//, "" ) ];
if ( config.asReference && config.asReference.loadFile ) {
return config.asReference.loadFile( path );
} else if (typeof process !== "undefined" && process.versions && !!process.versions.node && require.nodeRequire) {

@@ -71,4 +70,4 @@ var fs = require.nodeRequire('fs');

function saveFile(path, data) {
if ( config.asReference && config.asReference.files ) {
config.asReference.saveFile( path.replace( /^\//, "" ), data );
if ( config.asReference && config.asReference.saveFile ) {
config.asReference.saveFile( path, data );
} else if (typeof process !== "undefined" && process.versions && !!process.versions.node && require.nodeRequire) {

@@ -75,0 +74,0 @@ var fs = require.nodeRequire('fs');

@@ -37,5 +37,8 @@ var mutex, requireCssFiles,

files[ filepath ] = requireCssFiles[ filepath ];
});
function normalizePath( _path ) {
return path.normalize( _path ).replace( /^\//, "" );
}
config = util._extend( {}, config );

@@ -50,5 +53,9 @@ config.appDir = config.appDir || ".";

config.asReference = {
files: files,
saveFile: function( path, data ) {
path = normalizePath( path );
files[ path ] = data;
},
loadFile: function( path ) {
path = normalizePath( path );
return files[ path ];
}

@@ -55,0 +62,0 @@ };

{
"name": "builder-amd-css",
"version": "0.0.1",
"version": "0.0.2",
"main": "index.js",

@@ -5,0 +5,0 @@ "repository": {

@@ -67,1 +67,24 @@ var files,

});
describe( "Using appDir and CSSes located in a different subdir", function() {
var css, files;
files = {
"a/foo.js": fs.readFileSync( __dirname + "/fixtures/css-elsewhere/a/foo.js" ),
"a/bar.js": fs.readFileSync( __dirname + "/fixtures/css-elsewhere/a/bar.js" ),
"b/foo.css": fs.readFileSync( __dirname + "/fixtures/css-elsewhere/b/foo.css" ),
"b/bar.css": fs.readFileSync( __dirname + "/fixtures/css-elsewhere/b/bar.css" ),
};
before(function( done ) {
AmdCssBuilder( files, { appDir: "a", include: [ "foo" ] }, function( error, _css ) {
css = _css;
done( error );
});
});
it( "should work just fine", function() {
expect( css ).to.equal( ".foo {}\n.bar {}\n" );
});
});
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