@wordpress/deprecated
Advanced tools
Comparing version 2.6.1 to 2.7.0
### WordPress - Web publishing software | ||
Copyright 2011-2019 by the contributors | ||
Copyright 2011-2020 by the contributors | ||
@@ -5,0 +5,0 @@ This program is free software; you can redistribute it and/or modify |
{ | ||
"name": "@wordpress/deprecated", | ||
"version": "2.6.1", | ||
"version": "2.7.0", | ||
"description": "Deprecation utility for WordPress.", | ||
@@ -25,4 +25,4 @@ "author": "The WordPress Contributors", | ||
"dependencies": { | ||
"@babel/runtime": "^7.4.4", | ||
"@wordpress/hooks": "^2.6.0" | ||
"@babel/runtime": "^7.8.3", | ||
"@wordpress/hooks": "^2.7.0" | ||
}, | ||
@@ -32,3 +32,3 @@ "publishConfig": { | ||
}, | ||
"gitHead": "707754784420a7089ae31ec4d6c756ce9af9c782" | ||
"gitHead": "41fc84af285da696c65c235331ee245dfe23971d" | ||
} |
@@ -40,13 +40,11 @@ /** | ||
export default function deprecated( feature, options = {} ) { | ||
const { | ||
version, | ||
alternative, | ||
plugin, | ||
link, | ||
hint, | ||
} = options; | ||
const { version, alternative, plugin, link, hint } = options; | ||
const pluginMessage = plugin ? ` from ${ plugin }` : ''; | ||
const versionMessage = version ? ` and will be removed${ pluginMessage } in version ${ version }` : ''; | ||
const useInsteadMessage = alternative ? ` Please use ${ alternative } instead.` : ''; | ||
const versionMessage = version | ||
? ` and will be removed${ pluginMessage } in version ${ version }` | ||
: ''; | ||
const useInsteadMessage = alternative | ||
? ` Please use ${ alternative } instead.` | ||
: ''; | ||
const linkMessage = link ? ` See: ${ link }` : ''; | ||
@@ -53,0 +51,0 @@ const hintMessage = hint ? ` Note: ${ hint }` : ''; |
@@ -21,5 +21,3 @@ /** | ||
expect( console ).toHaveWarnedWith( | ||
'Eating meat is deprecated.' | ||
); | ||
expect( console ).toHaveWarnedWith( 'Eating meat is deprecated.' ); | ||
} ); | ||
@@ -36,3 +34,6 @@ | ||
it( 'should show a deprecation warning with an alternative', () => { | ||
deprecated( 'Eating meat', { version: '2020.01.01', alternative: 'vegetables' } ); | ||
deprecated( 'Eating meat', { | ||
version: '2020.01.01', | ||
alternative: 'vegetables', | ||
} ); | ||
@@ -39,0 +40,0 @@ expect( console ).toHaveWarnedWith( |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
43695
290
Updated@babel/runtime@^7.8.3
Updated@wordpress/hooks@^2.7.0