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

css-modules-typescript-loader

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

css-modules-typescript-loader - npm Package Compare versions

Comparing version 2.0.1 to 2.0.2

test/emit-declaration/common.css

12

index.js

@@ -60,3 +60,3 @@ const fs = require('fs');

if (!validModes.includes(mode)) {
return callback(new Error(`Invalid mode option: ${mode}`));
return failed(new Error(`Invalid mode option: ${mode}`));
}

@@ -67,7 +67,13 @@

const keyRegex = /"([^\\"]+)":\s*"(?:[^\\"]+)",?$/gm;
const keyRegex = /"([^\\"]+)":/g;
let match;
const cssModuleKeys = [];
while ((match = keyRegex.exec(content))) {
const localExports = content.split('exports.locals')[1];
if (!localExports) {
return failed(new Error(`No exported locals found for ${filename}`));
}
while ((match = keyRegex.exec(localExports))) {
if (cssModuleKeys.indexOf(match[1]) < 0) {

@@ -74,0 +80,0 @@ cssModuleKeys.push(match[1]);

{
"name": "css-modules-typescript-loader",
"version": "2.0.1",
"version": "2.0.2",
"description": "Webpack loader to create TypeScript declarations for CSS Modules",

@@ -40,3 +40,3 @@ "main": "index.js",

"husky": "^1.1.2",
"jest": "^23.6.0",
"jest": "^24.7.1",
"memory-fs": "^0.4.1",

@@ -43,0 +43,0 @@ "semantic-release": "^15.9.17",

@@ -23,15 +23,4 @@ const fs = require('fs');

expect(declaration).toMatchInlineSnapshot(`
"// This file is automatically generated.
// Please do not change this file!
interface CssExports {
'otherClass': string;
'someClass': string;
'validClass': string;
}
declare var cssExports: CssExports;
export = cssExports;
"
`);
expect(declaration).toMatchSnapshot();
});

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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