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

block

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

block - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

2

bower.json
{
"name": "block",
"description": "Block-based HTML templating",
"version": "0.0.1",
"version": "0.0.4",
"main": "index.js",

@@ -6,0 +6,0 @@ "scripts": [

{
"name": "block",
"description": "Block-based HTML templating",
"version": "0.0.1",
"repo": "funraiseme/block",
"version": "0.0.4",
"main": "index.js",
"scripts": [
"index.js"
]
}
],
"license": "WTFPL"
}

@@ -215,23 +215,47 @@ ;(function(){

for (var i = 0, l = blocks.length; i < l; i++) {
var block = blocks[i]
if (regex.test(block)) {
var block
for (var i = 0, l = blocks.length; i < l; i++)
if (regex.test(block = blocks[i]))
names[i] = block.match(/(\w+)/)[0]
blocks[i] = null
}
}
}
Block.prototype.local = function (name, value) {
var names = this.names
var j
for (var i in names)
if (names[i] === name && names.hasOwnProperty(i))
j = i
if (j == null)
throw new Error('Name ' + name + ' is not defined.')
delete names[j]
this.blocks[j] = value || ''
return this
}
Block.prototype.locals = function (object) {
for (var name in object)
if (object.hasOwnProperty(name))
this.local(name, object[name])
return this
}
Block.prototype.render = function (locals) {
locals = locals || {}
var blocks = this.blocks
var names = this.names
var l = blocks.length
var buf = new Array(l)
var html = ''
var name
for (var i = 0; i < l; i++)
buf[i] = (name = names[i]) ? locals[name] : blocks[i]
for (var i = 0, l = blocks.length; i < l; i++)
html += (name = names[i]) ? locals[name] : blocks[i]
return buf.join('')
return html
}

@@ -245,8 +269,6 @@

var string = fs.readFileSync(filename, 'utf8')
if (minify)
string = string.replace(/\n\s*/g, '')
return new Block(string)
return new Block(minify ? string.replace(/\n\s*/g, '') : string)
}
} catch (err) {}
});

@@ -260,3 +282,3 @@ require.alias("block/index.js", "block/index.js");

} else {
window["block"] = require("block");
this["block"] = require("block");
}})();
{
"name": "block",
"description": "Block-based HTML templating",
"version": "0.0.3",
"version": "0.0.4",
"devDependencies": {

@@ -11,3 +11,18 @@ "mocha": "*",

"test": "make test"
}
},
"author": {
"name": "Jonathan Ong",
"email": "me@jongleberry.com",
"url": "http://jongleberry.com",
"twitter": "https://twitter.com/jongleberry"
},
"repository": {
"type": "git",
"url": "https://github.com/funraiseme/block.git"
},
"bugs": {
"url": "https://github.com/funraiseme/block/issues",
"email": "me@jongleberry.com"
},
"license": "WTFPL"
}
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