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

stylesheet-loader

Package Overview
Dependencies
Maintainers
6
Versions
117
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

stylesheet-loader - npm Package Compare versions

Comparing version 0.9.0 to 0.9.1-beta.1

lib/__tests__/__snapshots__/getFontFaceContent.ts.snap

1

lib/__tests__/globalCSSVariable.js

@@ -37,1 +37,2 @@ "use strict";

});
//# sourceMappingURL=globalCSSVariable.js.map

@@ -63,1 +63,2 @@ "use strict";

});
//# sourceMappingURL=normalizeColor.js.map

@@ -113,1 +113,2 @@ "use strict";

});
//# sourceMappingURL=particular.js.map

@@ -42,1 +42,2 @@ "use strict";

});
//# sourceMappingURL=prefersColorScheme.js.map

@@ -29,1 +29,2 @@ "use strict";

});
//# sourceMappingURL=PropTypes.js.map

@@ -87,1 +87,2 @@ "use strict";

}
//# sourceMappingURL=transformer.js.map

@@ -46,1 +46,2 @@ "use strict";

exports.default = BoxModelPropTypes;
//# sourceMappingURL=BoxModelPropTypes.js.map

@@ -13,1 +13,2 @@ "use strict";

exports.default = colorProperties;
//# sourceMappingURL=colorProperties.js.map

@@ -19,1 +19,2 @@ "use strict";

exports.default = ColorPropTypes;
//# sourceMappingURL=ColorPropTypes.js.map

@@ -12,1 +12,2 @@ "use strict";

exports.default = CSSTransitionPropTypes;
//# sourceMappingURL=CSSTransitionPropTypes.js.map

@@ -16,1 +16,2 @@ "use strict";

exports.default = FlexboxPropTypes;
//# sourceMappingURL=FlexboxPropTypes.js.map

@@ -28,1 +28,2 @@ "use strict";

exports.default = getGlobalCSSVariable;
//# sourceMappingURL=globalCSSVariable.js.map
declare function styleSheetLoader(source: any): string;
export declare const parse: (parsedQuery: any, stylesheet: any) => {
styles: {};
fontFaceRules: any[];
mediaRules: any[];
};
export declare const getFontFaceContent: (rules: any) => string;
export default styleSheetLoader;

16

lib/index.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getFontFaceContent = exports.parse = void 0;
var css = require("css");

@@ -30,6 +31,7 @@ var loaderUtils = require("loader-utils");

}
var parsedData = parse(parsedQuery, stylesheet);
var parsedData = exports.parse(parsedQuery, stylesheet);
return genStyleContent(parsedData, parsedQuery);
}
var parse = function (parsedQuery, stylesheet) {
// export for test case
exports.parse = function (parsedQuery, stylesheet) {
var styles = {};

@@ -78,3 +80,3 @@ var fontFaceRules = [];

key: rule.media,
data: parse(parsedQuery, rule).styles,
data: exports.parse(parsedQuery, rule).styles,
});

@@ -92,3 +94,3 @@ }

var styles = processPrefersColorScheme_1.processPrefersColorScheme(mediaRules, parsedData.styles, parsedQuery.taskName);
var fontFaceContent = getFontFaceContent(fontFaceRules);
var fontFaceContent = exports.getFontFaceContent(fontFaceRules);
var mediaContent = getMediaContent(mediaRules, parsedQuery);

@@ -121,3 +123,4 @@ var warnMessageOutput = parsedQuery.log ? getWarnMessageOutput() : '';

};
var getFontFaceContent = function (rules) {
// export for test case
exports.getFontFaceContent = function (rules) {
var content = '';

@@ -128,3 +131,3 @@ if (rules.length > 0) {

rules.forEach(function (rule, index) {
content += "\n var fontFace" + index + " = new FontFace('" + rule['font-family'].replace(QUOTES_REG, '') + "', '" + rule.src.replace(QUOTES_REG, '') + "');\n document.fonts.add(fontFace" + index + ");\n ";
content += "\n var fontFace" + index + " = new FontFace('" + rule['font-family'].replace(QUOTES_REG, '') + "', '" + rule.src.replace(QUOTES_REG, '"') + "');\n document.fonts.add(fontFace" + index + ");\n ";
});

@@ -141,1 +144,2 @@ if (rules.length > 0) {

exports.default = styleSheetLoader;
//# sourceMappingURL=index.js.map

@@ -259,1 +259,2 @@ "use strict";

exports.default = normalizeColor;
//# sourceMappingURL=normalizeColor.js.map

@@ -150,1 +150,2 @@ "use strict";

};
//# sourceMappingURL=particular.js.map

@@ -52,1 +52,2 @@ "use strict";

exports.processPrefersColorScheme = processPrefersColorScheme;
//# sourceMappingURL=processPrefersColorScheme.js.map

@@ -24,1 +24,2 @@ "use strict";

};
//# sourceMappingURL=promptMessage.js.map

@@ -70,1 +70,2 @@ "use strict";

exports.default = PropTypes;
//# sourceMappingURL=PropTypes.js.map

@@ -16,1 +16,2 @@ "use strict";

exports.default = TextStylePropTypes;
//# sourceMappingURL=TextStylePropTypes.js.map

@@ -99,1 +99,2 @@ "use strict";

};
//# sourceMappingURL=transformer.js.map

@@ -49,1 +49,2 @@ "use strict";

exports.default = Validation;
//# sourceMappingURL=Validation.js.map
{
"name": "stylesheet-loader",
"version": "0.9.0",
"version": "0.9.1-beta.1",
"description": "Stylesheet loader.",
"license": "BSD-3-Clause",
"main": "lib/index.js",
"files": [
"lib",
"!lib/**/*.map"
],
"repository": {

@@ -8,0 +12,0 @@ "type": "git",

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