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

ajs

Package Overview
Dependencies
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ajs - npm Package Compare versions

Comparing version 1.2.20 to 1.3.0

2

lib/compiler.js

@@ -48,3 +48,3 @@ "use strict";

this.compiled = "var include = function (request, customLocals) {\n" + " __ajs.inc(request, customLocals, __locals)\n" + " }" + " , render = __ajs.ren\n" + " , print = __ajs.out;\n" + "with(__locals) {\n" + "try {\n" + this._make(this.tree) + ";\n" + this._endFunc + "();\n" + "} catch(e) { " + this._errFunc + "(e, __filename) }\n" + "}";
this.compiled = "var include = function (request, customLocals) {\n" + " __ajs.inc(request, customLocals, __locals)\n" + " }" + " , mod = function (request, customLocals) {\n" + " __ajs.modInclude(request, customLocals, __locals)\n" + " }" + " , render = __ajs.ren\n" + " , print = __ajs.out;\n" + "with(__locals) {\n" + "try {\n" + this._make(this.tree) + ";\n" + this._endFunc + "();\n" + "} catch(e) { " + this._errFunc + "(e, __filename) }\n" + "}";

@@ -51,0 +51,0 @@ var fn = new Function('__ajs, __locals', this.compiled);

@@ -106,2 +106,3 @@ "use strict";

_this._vmContext_.inc = _this._include.bind(_this);
_this._vmContext_.modInclude = _this._moduleInclude.bind(_this);
}

@@ -204,2 +205,25 @@

/**
* _moduleInclude
* Include an ajs template from node_modules
*
* @name _moduleInclude
* @function
* @param {String} request The path to the included ajs file.
* @param {Object} locals The template data.
* @param {Object} pLocals The parent template data.
*/
}, {
key: '_moduleInclude',
value: function _moduleInclude(request, locals, pLocals) {
if (!request.endsWith(".ajs")) {
request += ".ajs";
}
var filename = path.resolve(VM.ROOT, request);
return this._include(filename, locals, pLocals);
}
/**
* _render

@@ -462,2 +486,3 @@ * Renders the template.

inc: this._include.bind(this),
modInclude: this._moduleInclude.bind(this),
ren: this._render.bind(this),

@@ -498,2 +523,5 @@ flush: this._flush.bind(this),

VM.ROOT = process.cwd();
Template.VM = VM;
module.exports = Template;

@@ -14,3 +14,3 @@ {

],
"version": "1.2.20",
"version": "1.3.0",
"author": "Ionică Bizău <bizauionica@gmail.com> (https://ionicabizau.net)",

@@ -17,0 +17,0 @@ "contributors": [

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