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

gulp-ng-html2js

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gulp-ng-html2js - npm Package Compare versions

Comparing version 0.1.4 to 0.1.6

test/expected/exampleWithRename.js

6

index.js

@@ -71,2 +71,3 @@ var util = require("util");

* @param [options.prefix] - The prefix which should be added to the start of the url
* @param [options.rename] - A function that takes in the generated url and returns the desired manipulation.
* @returns {string}

@@ -90,2 +91,7 @@ */

// Rename the url
if(options && options.rename){
url = options.rename(url);
}
return url;

@@ -92,0 +98,0 @@ }

2

package.json
{
"name": "gulp-ng-html2js",
"version": "0.1.4",
"version": "0.1.6",
"description": "A Gulp plugin which generates AngularJS modules, which pre-load your HTML code into the $templateCache. This way AngularJS doesn't need to request the actual HTML files anymore.",

@@ -5,0 +5,0 @@ "keywords": [

@@ -74,3 +74,13 @@ # gulp-ng-html2js [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Status][depstat-image]][depstat-url]

#### options.rename
Type: `Function`
A function that allows the generate file url to be manipulated. For example:
```
function (url) {
return url.replace('.tpl.html', '.html');
}
```
## License

@@ -77,0 +87,0 @@

@@ -0,0 +0,0 @@ angular.module('fixtures/example.html', []).run(['$templateCache', function($templateCache) {

@@ -0,0 +0,0 @@ (function(module) {

@@ -0,0 +0,0 @@ angular.module('/partials/fixtures/example.html', []).run(['$templateCache', function($templateCache) {

@@ -0,0 +0,0 @@ angular.module('example.html', []).run(['$templateCache', function($templateCache) {

@@ -70,2 +70,19 @@ /*global describe, it*/

it("should allow a custom function to rename the generate file", function(done){
var expectedFile = new gutil.File({
path: "test/expected/exampleWithRename.js",
cwd: "test/",
base: "test/expected",
contents: fs.readFileSync("test/expected/exampleWithRename.js")
});
var params = {
rename: function () {
return "rename.html";
}
};
testBufferedFile(params, expectedFile, done);
});
function testBufferedFile(params, expectedFile, done){

@@ -72,0 +89,0 @@ var srcFile = new gutil.File({

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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