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

@magento/directive-parser

Package Overview
Dependencies
Maintainers
5
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@magento/directive-parser - npm Package Compare versions

Comparing version 0.1.6 to 0.1.7

2

package.json

@@ -6,3 +6,3 @@ {

},
"version": "0.1.6",
"version": "0.1.7",
"description": "Parses Magento PWA Studio directives",

@@ -9,0 +9,0 @@ "main": "src/index.js",

@@ -10,6 +10,32 @@ const parseDirective = require('..');

`);
expect(errors.length).toBe(0);
expect(errors[0]).toBeFalsy();
expect(directives.length).toBe(1);
});
test('Can parse a single directive in a file with single-line comments', () => {
const { errors, directives } = parseDirective(`
/**
* @RootComponent
* pageTypes = foo, bizz
*/
module.exports = () => {};
// a single line comment
`);
expect(errors[0]).toBeFalsy();
expect(directives.length).toBe(1);
});
test('Can parse a single directive in a file with source map annotations', () => {
const { errors, directives } = parseDirective(`
/**
* @RootComponent
* pageTypes = foo, bizz
*/
module.exports = () => {};
//# sourceMappingURL=index.js.map
`);
expect(errors[0]).toBeFalsy();
expect(directives.length).toBe(1);
});
test('Can parse a single directive in a file, and report error below it', () => {

@@ -16,0 +42,0 @@ const { errors, directives } = parseDirective(`

const reWhitespace = /\s/;
const reIdentifierChar = /[\w-]/;
const reIdentifierChar = /[^'"@=,\*\/\s]/;
const reNewLine = /\n/;

@@ -4,0 +4,0 @@

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