Socket
Socket
Sign inDemoInstall

gulp-angular-htmlify

Package Overview
Dependencies
87
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.0.4 to 0.0.5

23

index.js

@@ -9,7 +9,24 @@ 'use strict';

var verbose = params.verbose || false;
var customPrefixes = params.customPrefixes || [];
//find ng-something
var replaceRegex = /([\s<\/]+)ng-(\w+)/ig;
//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}';
//build find/replace regex
//$1 -> allowable pre-chars
//$2 -> prefix match
//$3 -> actual directive (partially)
var replaceRegex = new RegExp('([\\s<\/]+)' + prefix + '(\\w+)', 'ig');
//replace with data-ng-something
var replaceStr = '$1data-ng-$2';
var replaceStr = '$1data-$2$3';

@@ -16,0 +33,0 @@ return through.obj(function (file, enc, cb) {

2

package.json
{
"name": "gulp-angular-htmlify",
"description": "Change your ng-attributes to data-ng-attributes for html5 validation",
"version": "0.0.4",
"version": "0.0.5",
"engines": {

@@ -6,0 +6,0 @@ "node": ">=0.10.0"

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

<ng-directive />
<!-- custom directive prefix -->
<ui-router></ui-router>
<!-- your name prefix -->
<gilad-cool-loader></gilad-cool-loader>
```

@@ -73,2 +77,14 @@

#### customPrefixes
Type: `Array`
An array to optionally add custom prefixes to the list of converted directives.
For example: `['ui-', 'gijo-']`
*Note: for this to work - you will need to make sure your directives **can** load with a `data-` prefix.*
Defaults to **[]**
#### verbose

@@ -86,3 +102,4 @@

.pipe(htmlify({
verbose:true
verbose:true,
customPrefixes: ['ui-']
}))

@@ -89,0 +106,0 @@ // --> [gulp] Found and replaced ng-directives in index.html

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc