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

barhandles

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

barhandles - npm Package Compare versions

Comparing version 0.3.1 to 0.4.0

2

package.json
{
"name": "barhandles",
"version": "0.3.1",
"version": "0.4.0",
"description": "Extract references from Handlebars templates",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -11,15 +11,19 @@ # README

barhandles.extract('{{foo.bar}}', callback);
// Callback will be invoked with ['foo', 'bar']
// Callback will be invoked with ['foo', 'bar'], false
barhandles.extract('{{#with foo}}{{bar}}{{/with}}', callback);
// Callback will be invoked with ['foo', 'bar']
// Callback will be invoked with ['foo', 'bar'], false
barhandles.extract('{{#each foo}}{{bar}}{{/each}}', callback);
// Callback will be invoked with ['foo', '#', 'bar']
// Callback will be invoked with ['foo', '#', 'bar'], false
barhandles.extract('{{#with foo}}{{#each bar}}{{../baz}}{{/each}}{{/with}}', callback);
// Callback will be invoked with ['foo','baz']
// Callback will be invoked with ['foo','baz'], false
```
The second parameter passed to the callback is only present in version 0.4.0 and upwards. It indicates if the field
is considered to be optional. Barhandles by default assumes everything is required. Only in case of conditional sections
such as when using `{{#if}}…{{/if}}` it will mark attributs to be optional.
Barhandles also allows you to generate a hierarchical schema from your object model.

@@ -37,4 +41,6 @@

"_type": "object",
"_optional": false,
"bar": {
"_type": "any"
"_optional": false
}

@@ -47,4 +53,5 @@ }

* `v0.4.0`: Support for `{{#if}}` and optionals.
* `v0.3.0`: Support for extracting a schema.
* `v0.2.0`: Initial version

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc