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

gulp-angular-htmlify

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gulp-angular-htmlify - npm Package Compare versions

Comparing version 0.1.0 to 0.2.0

34

index.js

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

var verbose = params.verbose || false;
var customPrefixes = params.customPrefixes || [];
var htmlify = require('angular-html5')({
customPrefixes: params.customPrefixes
});
//find ng-something by default
var prefix = 'ng-';
//optionally add custom prefixes
if (customPrefixes && customPrefixes.length) {
var additions = customPrefixes.join('|');
prefix += '|';
prefix += additions;
}
//wrap around to insert into replace str later
prefix = '(' + prefix + '){1}';
//handle the following:
//1. ' ng-'
//2. '<ng-'
//3. '</ng-'
var allowedPreChars = '(\\s|<|<\/){1}';
//build find/replace regex
//$1 -> allowable pre-chars
//$2 -> prefix match
//$3 -> actual directive (partially)
var replaceRegex = new RegExp(allowedPreChars + prefix + '(\\w+)', 'ig');
//replace with data-ng-something
var replaceStr = '$1data-$2$3';
return through.obj(function (file, enc, cb) {

@@ -53,4 +29,4 @@ //pass through

//if ng-directives exist
if (replaceRegex.test(data)) {
data = data.replace(replaceRegex, replaceStr);
if (htmlify.test(data)) {
data = htmlify.replace(data);
//put contents back

@@ -57,0 +33,0 @@ file.contents = new Buffer(data);

2

license.md
The MIT License (MIT)
Copyright (c) [2014] [Gilad Peleg]
Copyright (©) 2014 Gilad Peleg

@@ -5,0 +5,0 @@ Permission is hereby granted, free of charge, to any person obtaining a copy of

{
"name": "gulp-angular-htmlify",
"description": "Change your ng-attributes to data-ng-attributes for html5 validation",
"version": "0.1.0",
"version": "0.2.0",
"engines": {

@@ -39,8 +39,10 @@ "node": ">=0.10.0"

"devDependencies": {
"mocha": "^1.20.0"
"gulp-util": "^2.2.16",
"mocha": "^1.20.1"
},
"dependencies": {
"angular-html5": "^0.1.1",
"gulp-util": "^2.2.14",
"through2": "^0.4.2"
"through2": "^0.5.1"
}
}

@@ -53,2 +53,4 @@ # [gulp](https://github.com/wearefractal/gulp)-angular-htmlify

*Issues with the output should be reported on the ng-annotate [issue tracker](https://github.com/pgilad/angular-html5/issues).*
## Install

@@ -55,0 +57,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