angular-html5
Advanced tools
Comparing version 0.2.0 to 0.3.0
17
index.js
'use strict'; | ||
var defaultPrefix = 'ng-'; | ||
module.exports = function (params) { | ||
params = params || {}; | ||
var customPrefixes = params.customPrefixes || []; | ||
//find ng-something by default | ||
var prefix = 'ng-'; | ||
var prefix = defaultPrefix; | ||
var customPrefixes = params.customPrefixes; | ||
//optionally add custom prefixes | ||
if (Array.isArray(customPrefixes) && customPrefixes.length) { | ||
var additions = customPrefixes.join('|'); | ||
prefix += '|'; | ||
prefix += additions; | ||
prefix += '|' + customPrefixes.join('|'); | ||
} | ||
@@ -34,11 +33,5 @@ | ||
test: function (str) { | ||
if (typeof str !== 'string') { | ||
throw new Error('Input to test function must be a string'); | ||
} | ||
return replaceRegex.test(str); | ||
}, | ||
replace: function (str) { | ||
if (typeof str !== 'string') { | ||
throw new Error('Input to replace function must be a string'); | ||
} | ||
return str.replace(replaceRegex, replaceStr); | ||
@@ -45,0 +38,0 @@ } |
{ | ||
"name": "angular-html5", | ||
"description": "Change your ng-attributes to data-ng-attributes for html5 validation", | ||
"version": "0.2.0", | ||
"version": "0.3.0", | ||
"engines": { | ||
@@ -6,0 +6,0 @@ "node": ">=0.10.0" |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6712
34