Socket
Socket
Sign inDemoInstall

ecto

Package Overview
Dependencies
452
Maintainers
1
Versions
63
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 3.0.1 to 3.0.2

12

dist/ecto.js

@@ -1,2 +0,2 @@

import * as fs from 'fs-extra';
import fs from 'node:fs';
import { EngineMap } from './engine-map.js';

@@ -115,3 +115,3 @@ import { Markdown } from './engines/markdown.js';

// Get the source
const source = await fs.readFile(filePath, 'utf8');
const source = await fs.promises.readFile(filePath, 'utf8');
result = await this.render(source, data, engineName, rootTemplatePath, filePathOutput);

@@ -136,3 +136,3 @@ return result;

if (!fs.existsSync(directory)) {
await fs.ensureDir(directory);
fs.mkdirSync(directory, { recursive: true });
}

@@ -145,3 +145,3 @@ }

if (!fs.existsSync(directory)) {
fs.ensureDirSync(directory);
fs.mkdirSync(directory, { recursive: true });
}

@@ -162,3 +162,3 @@ }

let result = '';
const files = await fs.readdir(path);
const files = await fs.promises.readdir(path);
for (const file of files) {

@@ -236,3 +236,3 @@ if (file.startsWith(templateName + '.')) {

await this.ensureFilePath(filePath);
await fs.writeFile(filePath, source);
await fs.promises.writeFile(filePath, source);
}

@@ -239,0 +239,0 @@ }

@@ -1,4 +0,5 @@

import * as handlebars from '@jaredwray/fumanchu';
import * as fs from 'fs-extra';
/* eslint-disable @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-argument */
import fs from 'node:fs';
import * as _ from 'underscore';
import fumanchu from '@jaredwray/fumanchu';
import { BaseEngine } from '../base-engine.js';

@@ -11,3 +12,3 @@ export class Handlebars extends BaseEngine {

this.opts = options;
this.engine = handlebars;
this.engine = fumanchu;
this.setExtensions(['hbs', 'hjs', 'handlebars', 'mustache']);

@@ -20,5 +21,3 @@ }

}
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
const template = handlebars.compile(source, this.opts);
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
const template = this.engine.compile(source, this.opts);
let result = template(data, this.opts);

@@ -33,5 +32,3 @@ result = _.unescape(result);

}
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
const template = handlebars.compile(source, this.opts);
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
const template = this.engine.compile(source, this.opts);
let result = template(data, this.opts);

@@ -49,22 +46,17 @@ result = _.unescape(result);

let result = false;
if (fs.pathExistsSync(partialsPath)) {
const partials = fs.readdirSync(partialsPath);
if (fs.existsSync(partialsPath)) {
const partials = fs.readdirSync(partialsPath, { recursive: true, encoding: 'utf8' });
for (const p of partials) {
if (fs.statSync(partialsPath + '/' + p).isDirectory()) {
const directoryPartials = fs.readdirSync(partialsPath + '/' + p);
const directoryPartials = fs.readdirSync(partialsPath + '/' + p, { recursive: true, encoding: 'utf8' });
for (const dp of directoryPartials) {
const source = fs.readFileSync(partialsPath + '/' + p + '/' + dp).toString();
const name = p + '/' + dp.split('.')[0];
// eslint-disable-next-line max-depth
if (handlebars.partials[name] === undefined) {
handlebars.registerPartial(name, handlebars.compile(source));
}
this.engine.registerPartial(name, this.engine.compile(source));
}
}
else {
const source = fs.readFileSync(partialsPath + '/' + p).toString();
const source = fs.readFileSync(partialsPath + '/' + p, 'utf8');
const name = p.split('.')[0];
if (handlebars.partials[name] === undefined) {
handlebars.registerPartial(name, handlebars.compile(source));
}
this.engine.registerPartial(name, this.engine.compile(source));
}

@@ -71,0 +63,0 @@ }

{
"name": "ecto",
"version": "3.0.1",
"version": "3.0.2",
"description": "Modern Template Consolidation Engine for EJS, Markdown, Pug, Nunjucks, Liquid, and Handlebars",

@@ -48,6 +48,7 @@ "type": "module",

"dependencies": {
"@jaredwray/fumanchu": "^1.1.3",
"@jaredwray/fumanchu": "^1.2.1",
"@markdoc/markdoc": "^0.4.0",
"ejs": "^3.1.9",
"fs-extra": "^11.2.0",
"handlebars": "^4.7.8",
"handlebars-helpers": "^0.10.0",
"helper-date": "^1.0.1",

@@ -64,3 +65,3 @@ "liquidjs": "^10.10.1",

"@types/express": "^4.17.21",
"@types/fs-extra": "^11.0.4",
"@types/handlebars-helpers": "^0.5.6",
"@types/mustache": "^4.2.5",

@@ -67,0 +68,0 @@ "@types/node": "^20.11.25",

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc