New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@bookshop/ejs-engine

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bookshop/ejs-engine - npm Package Compare versions

Comparing version 1.6.1 to 1.6.2

4

package.json
{
"name": "@bookshop/ejs-engine",
"version": "1.6.1",
"version": "1.6.2",
"description": "",

@@ -24,3 +24,3 @@ "main": "src/index.js",

},
"gitHead": "2d429629b50313d39113da07a2392473c4b7b40c"
"gitHead": "32599ab66bf4de6c1e0ac825a462f5bbbd87a13d"
}

@@ -15,3 +15,4 @@ const ejs = require("./ejs");

options.renderRoot.innerHTML = ejs.render(
`<% include = window.include %>${fetchComponent(
// Include override (legacy)
`<% include = window.include%>${fetchComponent(
`components/${name}/${lastPart}.ejs`

@@ -26,3 +27,3 @@ )}`,

*
* Storybook handling for `include`
* Storybook handling for including other components
*

@@ -34,11 +35,31 @@ * @param {string} filename

*/
window.component = (path, props) => {
// Handle that the full path is not provided (just component-name, e.g, component("button"))
const modifiedPathParts = path.split('/');
const lastPart = modifiedPathParts[modifiedPathParts.length - 1];
const newPath = `${path.replace('.ejs', '')}/${lastPart}.ejs`;
const ejsComponent = fetchComponent(
`components/${newPath.toLowerCase()}`
);
// include tag is necessary for a new component that imports a legacy component
return ejs.render(`<% include = window.include %>${ejsComponent}`, { props });
};
/**
*
* Legacy syntax support
*
* @deprecated
* @param {string} filename
* @param {Record<string, any>} props
*
* @return {string} EJS component string
*/
window.include = (path, props) => {
const parts = path.split("/");
const lastPart = parts[parts.length - 1].replace(".ejs", "");
const ejsComponent = fetchComponent(
`${path.toLowerCase()}`
// path.replace('Components', 'components')
);
return ejs.render(ejsComponent, { props });
return ejs.render(`<% include = window.include%>${ejsComponent}`, { props });
};

@@ -45,0 +66,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