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

monkberry

Package Overview
Dependencies
Maintainers
1
Versions
49
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

monkberry - npm Package Compare versions

Comparing version 3.4.0 to 3.4.1

13

monkberry.js

@@ -318,2 +318,3 @@ (function (document) {

* @returns {Element}
* @deprecated Use querySelector instead of.
*/

@@ -350,6 +351,12 @@ Monkberry.View.prototype.getElementById = function (id) {

var element = this.nodes[i].querySelector(query);
if (element) {
return element;
if (this.nodes[i].nodeType === 8) {
throw 'Can not use querySelector with non-element nodes on first level.';
}
if (this.nodes[i].querySelector) {
var element = this.nodes[i].querySelector(query);
if (element) {
return element;
}
}
}

@@ -356,0 +363,0 @@ return null;

{
"name": "monkberry",
"version": "3.4.0",
"version": "3.4.1",
"description": "JavaScript DOM Template Engine",

@@ -5,0 +5,0 @@ "bin": "bin/monkberry",

@@ -42,2 +42,3 @@ # Monkberry - JavaScript template engine

- [Parsers](#parsers)
- [Unsafe](#unsafe)
- [Comments](#comments)

@@ -610,8 +611,2 @@ - [API Reference](#api-reference)

#### view.getElementById(id)
Get element by id.
* `id`: `string` - id of element.
#### view.querySelector(query)

@@ -625,3 +620,20 @@

> Note what querySelector can not work with template which have if/for/custom node on first level.
> ```twig
> {% if cond %}
> ...
> {% endif %}
> ```
> You will got exception like this: `Can not use querySelector with non-element nodes on first level.`
>
> Solution is to wrap such statement into another node:
> ```twig
> <div>
> {% if cond %}
> ...
> {% endif %}
> </div>
> ```
## Tests

@@ -628,0 +640,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