@wordpress/hooks
Advanced tools
Comparing version 0.1.0-beta.1 to 0.1.0-beta.2
@@ -16,3 +16,3 @@ /** | ||
if (!/^[a-zA-Z][a-zA-Z0-9_.-/]*$/.test(namespace)) { | ||
if (!/^[a-zA-Z][a-zA-Z0-9_.\-/]*$/.test(namespace)) { | ||
console.error('The namespace can only contain numbers, letters, dashes, periods and underscores, plus the forward slash dividing slug and description in the namespace.'); | ||
@@ -22,3 +22,3 @@ return false; | ||
if (!/^[a-zA-Z][a-zA-Z0-9_.-]*\/[a-zA-Z][a-zA-Z0-9_.-]*\/[a-zA-Z][a-zA-Z0-9_.-]*$/.test(namespace)) { | ||
if (!/^[a-zA-Z][a-zA-Z0-9_.\-]*\/[a-zA-Z][a-zA-Z0-9_.\-]*\/[a-zA-Z][a-zA-Z0-9_.\-]*$/.test(namespace)) { | ||
console.error('The namespace must take the form `vendor/plugin/function`.'); | ||
@@ -25,0 +25,0 @@ return false; |
@@ -21,3 +21,3 @@ 'use strict'; | ||
if (!/^[a-zA-Z][a-zA-Z0-9_.-/]*$/.test(namespace)) { | ||
if (!/^[a-zA-Z][a-zA-Z0-9_.\-/]*$/.test(namespace)) { | ||
console.error('The namespace can only contain numbers, letters, dashes, periods and underscores, plus the forward slash dividing slug and description in the namespace.'); | ||
@@ -27,3 +27,3 @@ return false; | ||
if (!/^[a-zA-Z][a-zA-Z0-9_.-]*\/[a-zA-Z][a-zA-Z0-9_.-]*\/[a-zA-Z][a-zA-Z0-9_.-]*$/.test(namespace)) { | ||
if (!/^[a-zA-Z][a-zA-Z0-9_.\-]*\/[a-zA-Z][a-zA-Z0-9_.\-]*\/[a-zA-Z][a-zA-Z0-9_.\-]*$/.test(namespace)) { | ||
console.error('The namespace must take the form `vendor/plugin/function`.'); | ||
@@ -30,0 +30,0 @@ return false; |
{ | ||
"name": "@wordpress/hooks", | ||
"version": "0.1.0-beta.1", | ||
"version": "0.1.0-beta.2", | ||
"repository": { | ||
@@ -5,0 +5,0 @@ "type": "git", |
@@ -153,2 +153,7 @@ /* eslint-disable no-console */ | ||
test( 'Can add filters with dashes in namespaces', () => { | ||
addFilter( 'hook_name', 'my_name/with-dashes/action', () => null ); | ||
expect( console.error ).toHaveBeenCalledTimes( 0 ); | ||
} ); | ||
test( 'Can add filters with capitals in namespaces', () => { | ||
@@ -155,0 +160,0 @@ addFilter( 'hook_name', 'my_name/OhNo/action', () => null ); |
@@ -16,3 +16,3 @@ /** | ||
if ( ! /^[a-zA-Z][a-zA-Z0-9_.-/]*$/.test( namespace ) ) { | ||
if ( ! /^[a-zA-Z][a-zA-Z0-9_.\-/]*$/.test( namespace ) ) { | ||
console.error( 'The namespace can only contain numbers, letters, dashes, periods and underscores, plus the forward slash dividing slug and description in the namespace.' ); | ||
@@ -22,3 +22,3 @@ return false; | ||
if ( ! /^[a-zA-Z][a-zA-Z0-9_.-]*\/[a-zA-Z][a-zA-Z0-9_.-]*\/[a-zA-Z][a-zA-Z0-9_.-]*$/.test( namespace ) ) { | ||
if ( ! /^[a-zA-Z][a-zA-Z0-9_.\-]*\/[a-zA-Z][a-zA-Z0-9_.\-]*\/[a-zA-Z][a-zA-Z0-9_.\-]*$/.test( namespace ) ) { | ||
console.error( 'The namespace must take the form `vendor/plugin/function`.' ); | ||
@@ -25,0 +25,0 @@ return false; |
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
81220
2094