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

pug-attrs

Package Overview
Dependencies
Maintainers
2
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pug-attrs - npm Package Compare versions

Comparing version 0.0.1 to 2.0.1

4

index.js

@@ -9,6 +9,6 @@ 'use strict';

function isConstant(src) {
return constantinople(src, {jade: runtime, 'jade_interp': undefined});
return constantinople(src, {pug: runtime, 'pug_interp': undefined});
}
function toConstant(src) {
return constantinople.toConstant(src, {jade: runtime, 'jade_interp': undefined});
return constantinople.toConstant(src, {pug: runtime, 'pug_interp': undefined});
}

@@ -15,0 +15,0 @@

{
"name": "pug-attrs",
"version": "0.0.1",
"description": "Generate code for jade attributes",
"version": "2.0.1",
"description": "Generate code for Pug attributes",
"keywords": [
"jade"
"pug"
],
"dependencies": {
"constantinople": "^3.0.1",
"pug-runtime": "^0.0.0",
"pug-runtime": "^2.0.0",
"js-stringify": "^1.0.1"

@@ -23,3 +23,3 @@ },

"type": "git",
"url": "https://github.com/jadejs/jade-attrs.git"
"url": "https://github.com/pugjs/pug-attrs.git"
},

@@ -26,0 +26,0 @@ "author": "Forbes Lindesay",

@@ -1,12 +0,12 @@

# jade-attrs
# pug-attrs
Generate code for Jade attributes
Generate code for Pug attributes
[![Build Status](https://img.shields.io/travis/jadejs/jade-attrs/master.svg)](https://travis-ci.org/jadejs/jade-attrs)
[![Dependency Status](https://img.shields.io/gemnasium/jadejs/jade-attrs.svg)](https://gemnasium.com/jadejs/jade-attrs)
[![NPM version](https://img.shields.io/npm/v/jade-attrs.svg)](https://www.npmjs.org/package/jade-attrs)
[![Build Status](https://img.shields.io/travis/pugjs/pug-attrs/master.svg)](https://travis-ci.org/pugjs/pug-attrs)
[![Dependency Status](https://img.shields.io/david/pugjs/pug-attrs.svg)](https://david-dm.org/pugjs/pug-attrs)
[![NPM version](https://img.shields.io/npm/v/pug-attrs.svg)](https://www.npmjs.org/package/pug-attrs)
## Installation
npm install jade-attrs
npm install pug-attrs

@@ -16,3 +16,3 @@ ## Usage

```js
var compileAttrs = require('jade-attrs');
var compileAttrs = require('pug-attrs');
```

@@ -33,4 +33,4 @@

```js
var compileAttrs = require('jade-attrs');
var jadeRuntime = require('jade-runtime');
var compileAttrs = require('pug-attrs');
var pugRuntime = require('pug-runtime');

@@ -50,10 +50,10 @@ function getBaz () { return 'baz<>'; }

format: 'html',
runtime: function (name) { return 'jadeRuntime.' + name; }
runtime: function (name) { return 'pugRuntime.' + name; }
});
//=> '" foo=\\"bar\\"" + jadeRuntime.attr("baz", getBaz(), true, true) + " quux"'
//=> '" foo=\\"bar\\"" + pugRuntime.attr("baz", getBaz(), true, true) + " quux"'
finalResult = Function('jadeRuntime, getBaz',
finalResult = Function('pugRuntime, getBaz',
'return (' + result + ');'
);
finalResult(jadeRuntime, getBaz);
finalResult(pugRuntime, getBaz);
// => ' foo="bar" baz="baz&lt;&gt;" quux'

@@ -65,10 +65,10 @@

format: 'object',
runtime: function (name) { return 'jadeRuntime.' + name; }
runtime: function (name) { return 'pugRuntime.' + name; }
});
//=> '{"foo": "bar","baz": jadeRuntime.escape(getBaz()),"quux": true}'
//=> '{"foo": "bar","baz": pugRuntime.escape(getBaz()),"quux": true}'
finalResult = Function('jadeRuntime, getBaz',
finalResult = Function('pugRuntime, getBaz',
'return (' + result + ');'
);
finalResult(jadeRuntime, getBaz);
finalResult(pugRuntime, getBaz);
//=> { foo: 'bar', baz: 'baz&lt;&gt;', quux: true }

@@ -75,0 +75,0 @@ ```

@@ -12,3 +12,3 @@ 'use strict';

locals = locals || {};
locals.jade = locals.jade || require('pug-runtime');
locals.pug = locals.pug || require('pug-runtime');
testit(utils.inspect(input).replace(/\n/g, '') + ' => ' + utils.inspect(expected), function () {

@@ -32,3 +32,3 @@ var src = attrs(input, opts);

withOptions({terse: true, format: 'html', runtime: function (name) { return 'jade.' + name; }}, function () {
withOptions({terse: true, format: 'html', runtime: function (name) { return 'pug.' + name; }}, function () {
test([], '');

@@ -58,3 +58,3 @@ test([{name: 'foo', val: 'false', mustEscape: true}], '');

});
withOptions({terse: false, format: 'html', runtime: function (name) { return 'jade.' + name; }}, function () {
withOptions({terse: false, format: 'html', runtime: function (name) { return 'pug.' + name; }}, function () {
test([{name: 'foo', val: 'false', mustEscape: true}], '');

@@ -68,3 +68,3 @@ test([{name: 'foo', val: 'true', mustEscape: true}], ' foo="foo"');

withOptions({terse: true, format: 'object', runtime: function (name) { return 'jade.' + name; }}, function () {
withOptions({terse: true, format: 'object', runtime: function (name) { return 'pug.' + name; }}, function () {
test([], {});

@@ -94,3 +94,3 @@ test([{name: 'foo', val: 'false', mustEscape: true}], {foo: false});

});
withOptions({terse: false, format: 'object', runtime: function (name) { return 'jade.' + name; }}, function () {
withOptions({terse: false, format: 'object', runtime: function (name) { return 'pug.' + name; }}, function () {
test([{name: 'foo', val: 'false', mustEscape: true}], {foo: false});

@@ -97,0 +97,0 @@ test([{name: 'foo', val: 'true', mustEscape: true}], {foo: true});

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