Socket
Socket
Sign inDemoInstall

@wordpress/hooks

Package Overview
Dependencies
Maintainers
4
Versions
156
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@wordpress/hooks - npm Package Compare versions

Comparing version 0.1.0-beta.1 to 0.1.0-beta.2

4

build-module/validateNamespace.js

@@ -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;

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