@wordpress/deprecated
Advanced tools
+16
-60
@@ -1,67 +0,23 @@ | ||
| /** | ||
| * WordPress dependencies | ||
| */ | ||
| import { doAction } from '@wordpress/hooks'; | ||
| /** | ||
| * Object map tracking messages which have been logged, for use in ensuring a | ||
| * message is only logged once. | ||
| */ | ||
| export const logged = Object.create(null); | ||
| /** | ||
| * Logs a message to notify developers about a deprecated feature. | ||
| * | ||
| * @param {string} feature Name of the deprecated feature. | ||
| * @param {DeprecatedOptions} [options] Personalisation options | ||
| * | ||
| * @example | ||
| * ```js | ||
| * import deprecated from '@wordpress/deprecated'; | ||
| * | ||
| * deprecated( 'Eating meat', { | ||
| * since: '2019.01.01', | ||
| * version: '2020.01.01', | ||
| * alternative: 'vegetables', | ||
| * plugin: 'the earth', | ||
| * hint: 'You may find it beneficial to transition gradually.', | ||
| * } ); | ||
| * | ||
| * // Logs: 'Eating meat is deprecated since version 2019.01.01 and will be removed from the earth in version 2020.01.01. Please use vegetables instead. Note: You may find it beneficial to transition gradually.' | ||
| * ``` | ||
| */ | ||
| export default function deprecated(feature, options = {}) { | ||
| const { | ||
| since, | ||
| version, | ||
| alternative, | ||
| plugin, | ||
| link, | ||
| hint | ||
| } = options; | ||
| const pluginMessage = plugin ? ` from ${plugin}` : ''; | ||
| const sinceMessage = since ? ` since version ${since}` : ''; | ||
| const versionMessage = version ? ` and will be removed${pluginMessage} in version ${version}` : ''; | ||
| const useInsteadMessage = alternative ? ` Please use ${alternative} instead.` : ''; | ||
| const linkMessage = link ? ` See: ${link}` : ''; | ||
| const hintMessage = hint ? ` Note: ${hint}` : ''; | ||
| import { doAction } from "@wordpress/hooks"; | ||
| const logged = /* @__PURE__ */ Object.create(null); | ||
| function deprecated(feature, options = {}) { | ||
| const { since, version, alternative, plugin, link, hint } = options; | ||
| const pluginMessage = plugin ? ` from ${plugin}` : ""; | ||
| const sinceMessage = since ? ` since version ${since}` : ""; | ||
| const versionMessage = version ? ` and will be removed${pluginMessage} in version ${version}` : ""; | ||
| const useInsteadMessage = alternative ? ` Please use ${alternative} instead.` : ""; | ||
| const linkMessage = link ? ` See: ${link}` : ""; | ||
| const hintMessage = hint ? ` Note: ${hint}` : ""; | ||
| const message = `${feature} is deprecated${sinceMessage}${versionMessage}.${useInsteadMessage}${linkMessage}${hintMessage}`; | ||
| // Skip if already logged. | ||
| if (message in logged) { | ||
| return; | ||
| } | ||
| /** | ||
| * Fires whenever a deprecated feature is encountered | ||
| * | ||
| * @param {string} feature Name of the deprecated feature. | ||
| * @param {DeprecatedOptions} options Personalisation options | ||
| * @param {string} message Message sent to console.warn | ||
| */ | ||
| doAction('deprecated', feature, options, message); | ||
| // eslint-disable-next-line no-console | ||
| doAction("deprecated", feature, options, message); | ||
| console.warn(message); | ||
| logged[message] = true; | ||
| } | ||
| //# sourceMappingURL=index.js.map | ||
| export { | ||
| deprecated as default, | ||
| logged | ||
| }; | ||
| //# sourceMappingURL=index.js.map |
@@ -1,1 +0,7 @@ | ||
| {"version":3,"names":["doAction","logged","Object","create","deprecated","feature","options","since","version","alternative","plugin","link","hint","pluginMessage","sinceMessage","versionMessage","useInsteadMessage","linkMessage","hintMessage","message","console","warn"],"sources":["@wordpress/deprecated/src/index.ts"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { doAction } from '@wordpress/hooks';\n\n/**\n * Object map tracking messages which have been logged, for use in ensuring a\n * message is only logged once.\n */\nexport const logged: Record< string, true > = Object.create( null );\n\ntype DeprecatedOptions = {\n\t/**\n\t * Version in which the feature was deprecated.\n\t */\n\tsince?: string;\n\t/**\n\t * Version in which the feature will be removed.\n\t */\n\tversion?: string;\n\t/**\n\t * Feature to use instead.\n\t */\n\talternative?: string;\n\t/**\n\t * Plugin name if it's a plugin feature.\n\t */\n\tplugin?: string;\n\t/**\n\t * Link to documentation.\n\t */\n\tlink?: string;\n\t/**\n\t * Additional message to help transition away from the deprecated feature.\n\t */\n\thint?: string;\n};\n\n/**\n * Logs a message to notify developers about a deprecated feature.\n *\n * @param {string} feature Name of the deprecated feature.\n * @param {DeprecatedOptions} [options] Personalisation options\n *\n * @example\n * ```js\n * import deprecated from '@wordpress/deprecated';\n *\n * deprecated( 'Eating meat', {\n * \tsince: '2019.01.01',\n * \tversion: '2020.01.01',\n * \talternative: 'vegetables',\n * \tplugin: 'the earth',\n * \thint: 'You may find it beneficial to transition gradually.',\n * } );\n *\n * // Logs: 'Eating meat is deprecated since version 2019.01.01 and will be removed from the earth in version 2020.01.01. Please use vegetables instead. Note: You may find it beneficial to transition gradually.'\n * ```\n */\nexport default function deprecated(\n\tfeature: string,\n\toptions: DeprecatedOptions = {}\n) {\n\tconst { since, version, alternative, plugin, link, hint } = options;\n\n\tconst pluginMessage = plugin ? ` from ${ plugin }` : '';\n\tconst sinceMessage = since ? ` since version ${ since }` : '';\n\tconst versionMessage = version\n\t\t? ` and will be removed${ pluginMessage } in version ${ version }`\n\t\t: '';\n\tconst useInsteadMessage = alternative\n\t\t? ` Please use ${ alternative } instead.`\n\t\t: '';\n\tconst linkMessage = link ? ` See: ${ link }` : '';\n\tconst hintMessage = hint ? ` Note: ${ hint }` : '';\n\tconst message = `${ feature } is deprecated${ sinceMessage }${ versionMessage }.${ useInsteadMessage }${ linkMessage }${ hintMessage }`;\n\n\t// Skip if already logged.\n\tif ( message in logged ) {\n\t\treturn;\n\t}\n\n\t/**\n\t * Fires whenever a deprecated feature is encountered\n\t *\n\t * @param {string} feature Name of the deprecated feature.\n\t * @param {DeprecatedOptions} options Personalisation options\n\t * @param {string} message Message sent to console.warn\n\t */\n\tdoAction( 'deprecated', feature, options, message );\n\n\t// eslint-disable-next-line no-console\n\tconsole.warn( message );\n\n\tlogged[ message ] = true;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,QAAQ,QAAQ,kBAAkB;;AAE3C;AACA;AACA;AACA;AACA,OAAO,MAAMC,MAA8B,GAAGC,MAAM,CAACC,MAAM,CAAE,IAAK,CAAC;AA6BnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASC,UAAUA,CACjCC,OAAe,EACfC,OAA0B,GAAG,CAAC,CAAC,EAC9B;EACD,MAAM;IAAEC,KAAK;IAAEC,OAAO;IAAEC,WAAW;IAAEC,MAAM;IAAEC,IAAI;IAAEC;EAAK,CAAC,GAAGN,OAAO;EAEnE,MAAMO,aAAa,GAAGH,MAAM,GAAG,SAAUA,MAAM,EAAG,GAAG,EAAE;EACvD,MAAMI,YAAY,GAAGP,KAAK,GAAG,kBAAmBA,KAAK,EAAG,GAAG,EAAE;EAC7D,MAAMQ,cAAc,GAAGP,OAAO,GAC3B,uBAAwBK,aAAa,eAAiBL,OAAO,EAAG,GAChE,EAAE;EACL,MAAMQ,iBAAiB,GAAGP,WAAW,GAClC,eAAgBA,WAAW,WAAY,GACvC,EAAE;EACL,MAAMQ,WAAW,GAAGN,IAAI,GAAG,SAAUA,IAAI,EAAG,GAAG,EAAE;EACjD,MAAMO,WAAW,GAAGN,IAAI,GAAG,UAAWA,IAAI,EAAG,GAAG,EAAE;EAClD,MAAMO,OAAO,GAAG,GAAId,OAAO,iBAAmBS,YAAY,GAAKC,cAAc,IAAMC,iBAAiB,GAAKC,WAAW,GAAKC,WAAW,EAAG;;EAEvI;EACA,IAAKC,OAAO,IAAIlB,MAAM,EAAG;IACxB;EACD;;EAEA;AACD;AACA;AACA;AACA;AACA;AACA;EACCD,QAAQ,CAAE,YAAY,EAAEK,OAAO,EAAEC,OAAO,EAAEa,OAAQ,CAAC;;EAEnD;EACAC,OAAO,CAACC,IAAI,CAAEF,OAAQ,CAAC;EAEvBlB,MAAM,CAAEkB,OAAO,CAAE,GAAG,IAAI;AACzB","ignoreList":[]} | ||
| { | ||
| "version": 3, | ||
| "sources": ["../src/index.ts"], | ||
| "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { doAction } from '@wordpress/hooks';\n\n/**\n * Object map tracking messages which have been logged, for use in ensuring a\n * message is only logged once.\n */\nexport const logged: Record< string, true > = Object.create( null );\n\ntype DeprecatedOptions = {\n\t/**\n\t * Version in which the feature was deprecated.\n\t */\n\tsince?: string;\n\t/**\n\t * Version in which the feature will be removed.\n\t */\n\tversion?: string;\n\t/**\n\t * Feature to use instead.\n\t */\n\talternative?: string;\n\t/**\n\t * Plugin name if it's a plugin feature.\n\t */\n\tplugin?: string;\n\t/**\n\t * Link to documentation.\n\t */\n\tlink?: string;\n\t/**\n\t * Additional message to help transition away from the deprecated feature.\n\t */\n\thint?: string;\n};\n\n/**\n * Logs a message to notify developers about a deprecated feature.\n *\n * @param {string} feature Name of the deprecated feature.\n * @param {DeprecatedOptions} [options] Personalisation options\n *\n * @example\n * ```js\n * import deprecated from '@wordpress/deprecated';\n *\n * deprecated( 'Eating meat', {\n * \tsince: '2019.01.01',\n * \tversion: '2020.01.01',\n * \talternative: 'vegetables',\n * \tplugin: 'the earth',\n * \thint: 'You may find it beneficial to transition gradually.',\n * } );\n *\n * // Logs: 'Eating meat is deprecated since version 2019.01.01 and will be removed from the earth in version 2020.01.01. Please use vegetables instead. Note: You may find it beneficial to transition gradually.'\n * ```\n */\nexport default function deprecated(\n\tfeature: string,\n\toptions: DeprecatedOptions = {}\n) {\n\tconst { since, version, alternative, plugin, link, hint } = options;\n\n\tconst pluginMessage = plugin ? ` from ${ plugin }` : '';\n\tconst sinceMessage = since ? ` since version ${ since }` : '';\n\tconst versionMessage = version\n\t\t? ` and will be removed${ pluginMessage } in version ${ version }`\n\t\t: '';\n\tconst useInsteadMessage = alternative\n\t\t? ` Please use ${ alternative } instead.`\n\t\t: '';\n\tconst linkMessage = link ? ` See: ${ link }` : '';\n\tconst hintMessage = hint ? ` Note: ${ hint }` : '';\n\tconst message = `${ feature } is deprecated${ sinceMessage }${ versionMessage }.${ useInsteadMessage }${ linkMessage }${ hintMessage }`;\n\n\t// Skip if already logged.\n\tif ( message in logged ) {\n\t\treturn;\n\t}\n\n\t/**\n\t * Fires whenever a deprecated feature is encountered\n\t *\n\t * @param {string} feature Name of the deprecated feature.\n\t * @param {DeprecatedOptions} options Personalisation options\n\t * @param {string} message Message sent to console.warn\n\t */\n\tdoAction( 'deprecated', feature, options, message );\n\n\t// eslint-disable-next-line no-console\n\tconsole.warn( message );\n\n\tlogged[ message ] = true;\n}\n"], | ||
| "mappings": "AAGA,SAAS,gBAAgB;AAMlB,MAAM,SAAiC,uBAAO,OAAQ,IAAK;AAkDnD,SAAR,WACN,SACA,UAA6B,CAAC,GAC7B;AACD,QAAM,EAAE,OAAO,SAAS,aAAa,QAAQ,MAAM,KAAK,IAAI;AAE5D,QAAM,gBAAgB,SAAS,SAAU,MAAO,KAAK;AACrD,QAAM,eAAe,QAAQ,kBAAmB,KAAM,KAAK;AAC3D,QAAM,iBAAiB,UACpB,uBAAwB,aAAc,eAAgB,OAAQ,KAC9D;AACH,QAAM,oBAAoB,cACvB,eAAgB,WAAY,cAC5B;AACH,QAAM,cAAc,OAAO,SAAU,IAAK,KAAK;AAC/C,QAAM,cAAc,OAAO,UAAW,IAAK,KAAK;AAChD,QAAM,UAAU,GAAI,OAAQ,iBAAkB,YAAa,GAAI,cAAe,IAAK,iBAAkB,GAAI,WAAY,GAAI,WAAY;AAGrI,MAAK,WAAW,QAAS;AACxB;AAAA,EACD;AASA,WAAU,cAAc,SAAS,SAAS,OAAQ;AAGlD,UAAQ,KAAM,OAAQ;AAEtB,SAAQ,OAAQ,IAAI;AACrB;", | ||
| "names": [] | ||
| } |
+37
-64
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { | ||
| value: true | ||
| var __defProp = Object.defineProperty; | ||
| var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | ||
| var __getOwnPropNames = Object.getOwnPropertyNames; | ||
| var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
| var __export = (target, all) => { | ||
| for (var name in all) | ||
| __defProp(target, name, { get: all[name], enumerable: true }); | ||
| }; | ||
| var __copyProps = (to, from, except, desc) => { | ||
| if (from && typeof from === "object" || typeof from === "function") { | ||
| for (let key of __getOwnPropNames(from)) | ||
| if (!__hasOwnProp.call(to, key) && key !== except) | ||
| __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | ||
| } | ||
| return to; | ||
| }; | ||
| var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | ||
| var index_exports = {}; | ||
| __export(index_exports, { | ||
| default: () => deprecated, | ||
| logged: () => logged | ||
| }); | ||
| exports.default = deprecated; | ||
| exports.logged = void 0; | ||
| var _hooks = require("@wordpress/hooks"); | ||
| /** | ||
| * WordPress dependencies | ||
| */ | ||
| /** | ||
| * Object map tracking messages which have been logged, for use in ensuring a | ||
| * message is only logged once. | ||
| */ | ||
| const logged = exports.logged = Object.create(null); | ||
| /** | ||
| * Logs a message to notify developers about a deprecated feature. | ||
| * | ||
| * @param {string} feature Name of the deprecated feature. | ||
| * @param {DeprecatedOptions} [options] Personalisation options | ||
| * | ||
| * @example | ||
| * ```js | ||
| * import deprecated from '@wordpress/deprecated'; | ||
| * | ||
| * deprecated( 'Eating meat', { | ||
| * since: '2019.01.01', | ||
| * version: '2020.01.01', | ||
| * alternative: 'vegetables', | ||
| * plugin: 'the earth', | ||
| * hint: 'You may find it beneficial to transition gradually.', | ||
| * } ); | ||
| * | ||
| * // Logs: 'Eating meat is deprecated since version 2019.01.01 and will be removed from the earth in version 2020.01.01. Please use vegetables instead. Note: You may find it beneficial to transition gradually.' | ||
| * ``` | ||
| */ | ||
| module.exports = __toCommonJS(index_exports); | ||
| var import_hooks = require("@wordpress/hooks"); | ||
| const logged = /* @__PURE__ */ Object.create(null); | ||
| function deprecated(feature, options = {}) { | ||
| const { | ||
| since, | ||
| version, | ||
| alternative, | ||
| plugin, | ||
| link, | ||
| hint | ||
| } = options; | ||
| const pluginMessage = plugin ? ` from ${plugin}` : ''; | ||
| const sinceMessage = since ? ` since version ${since}` : ''; | ||
| const versionMessage = version ? ` and will be removed${pluginMessage} in version ${version}` : ''; | ||
| const useInsteadMessage = alternative ? ` Please use ${alternative} instead.` : ''; | ||
| const linkMessage = link ? ` See: ${link}` : ''; | ||
| const hintMessage = hint ? ` Note: ${hint}` : ''; | ||
| const { since, version, alternative, plugin, link, hint } = options; | ||
| const pluginMessage = plugin ? ` from ${plugin}` : ""; | ||
| const sinceMessage = since ? ` since version ${since}` : ""; | ||
| const versionMessage = version ? ` and will be removed${pluginMessage} in version ${version}` : ""; | ||
| const useInsteadMessage = alternative ? ` Please use ${alternative} instead.` : ""; | ||
| const linkMessage = link ? ` See: ${link}` : ""; | ||
| const hintMessage = hint ? ` Note: ${hint}` : ""; | ||
| const message = `${feature} is deprecated${sinceMessage}${versionMessage}.${useInsteadMessage}${linkMessage}${hintMessage}`; | ||
| // Skip if already logged. | ||
| if (message in logged) { | ||
| return; | ||
| } | ||
| /** | ||
| * Fires whenever a deprecated feature is encountered | ||
| * | ||
| * @param {string} feature Name of the deprecated feature. | ||
| * @param {DeprecatedOptions} options Personalisation options | ||
| * @param {string} message Message sent to console.warn | ||
| */ | ||
| (0, _hooks.doAction)('deprecated', feature, options, message); | ||
| // eslint-disable-next-line no-console | ||
| (0, import_hooks.doAction)("deprecated", feature, options, message); | ||
| console.warn(message); | ||
| logged[message] = true; | ||
| } | ||
| //# sourceMappingURL=index.js.map | ||
| // Annotate the CommonJS export names for ESM import in node: | ||
| 0 && (module.exports = { | ||
| logged | ||
| }); | ||
| //# sourceMappingURL=index.js.map |
@@ -1,1 +0,7 @@ | ||
| {"version":3,"names":["_hooks","require","logged","exports","Object","create","deprecated","feature","options","since","version","alternative","plugin","link","hint","pluginMessage","sinceMessage","versionMessage","useInsteadMessage","linkMessage","hintMessage","message","doAction","console","warn"],"sources":["@wordpress/deprecated/src/index.ts"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { doAction } from '@wordpress/hooks';\n\n/**\n * Object map tracking messages which have been logged, for use in ensuring a\n * message is only logged once.\n */\nexport const logged: Record< string, true > = Object.create( null );\n\ntype DeprecatedOptions = {\n\t/**\n\t * Version in which the feature was deprecated.\n\t */\n\tsince?: string;\n\t/**\n\t * Version in which the feature will be removed.\n\t */\n\tversion?: string;\n\t/**\n\t * Feature to use instead.\n\t */\n\talternative?: string;\n\t/**\n\t * Plugin name if it's a plugin feature.\n\t */\n\tplugin?: string;\n\t/**\n\t * Link to documentation.\n\t */\n\tlink?: string;\n\t/**\n\t * Additional message to help transition away from the deprecated feature.\n\t */\n\thint?: string;\n};\n\n/**\n * Logs a message to notify developers about a deprecated feature.\n *\n * @param {string} feature Name of the deprecated feature.\n * @param {DeprecatedOptions} [options] Personalisation options\n *\n * @example\n * ```js\n * import deprecated from '@wordpress/deprecated';\n *\n * deprecated( 'Eating meat', {\n * \tsince: '2019.01.01',\n * \tversion: '2020.01.01',\n * \talternative: 'vegetables',\n * \tplugin: 'the earth',\n * \thint: 'You may find it beneficial to transition gradually.',\n * } );\n *\n * // Logs: 'Eating meat is deprecated since version 2019.01.01 and will be removed from the earth in version 2020.01.01. Please use vegetables instead. Note: You may find it beneficial to transition gradually.'\n * ```\n */\nexport default function deprecated(\n\tfeature: string,\n\toptions: DeprecatedOptions = {}\n) {\n\tconst { since, version, alternative, plugin, link, hint } = options;\n\n\tconst pluginMessage = plugin ? ` from ${ plugin }` : '';\n\tconst sinceMessage = since ? ` since version ${ since }` : '';\n\tconst versionMessage = version\n\t\t? ` and will be removed${ pluginMessage } in version ${ version }`\n\t\t: '';\n\tconst useInsteadMessage = alternative\n\t\t? ` Please use ${ alternative } instead.`\n\t\t: '';\n\tconst linkMessage = link ? ` See: ${ link }` : '';\n\tconst hintMessage = hint ? ` Note: ${ hint }` : '';\n\tconst message = `${ feature } is deprecated${ sinceMessage }${ versionMessage }.${ useInsteadMessage }${ linkMessage }${ hintMessage }`;\n\n\t// Skip if already logged.\n\tif ( message in logged ) {\n\t\treturn;\n\t}\n\n\t/**\n\t * Fires whenever a deprecated feature is encountered\n\t *\n\t * @param {string} feature Name of the deprecated feature.\n\t * @param {DeprecatedOptions} options Personalisation options\n\t * @param {string} message Message sent to console.warn\n\t */\n\tdoAction( 'deprecated', feature, options, message );\n\n\t// eslint-disable-next-line no-console\n\tconsole.warn( message );\n\n\tlogged[ message ] = true;\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,MAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACO,MAAMC,MAA8B,GAAAC,OAAA,CAAAD,MAAA,GAAGE,MAAM,CAACC,MAAM,CAAE,IAAK,CAAC;AA6BnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASC,UAAUA,CACjCC,OAAe,EACfC,OAA0B,GAAG,CAAC,CAAC,EAC9B;EACD,MAAM;IAAEC,KAAK;IAAEC,OAAO;IAAEC,WAAW;IAAEC,MAAM;IAAEC,IAAI;IAAEC;EAAK,CAAC,GAAGN,OAAO;EAEnE,MAAMO,aAAa,GAAGH,MAAM,GAAG,SAAUA,MAAM,EAAG,GAAG,EAAE;EACvD,MAAMI,YAAY,GAAGP,KAAK,GAAG,kBAAmBA,KAAK,EAAG,GAAG,EAAE;EAC7D,MAAMQ,cAAc,GAAGP,OAAO,GAC3B,uBAAwBK,aAAa,eAAiBL,OAAO,EAAG,GAChE,EAAE;EACL,MAAMQ,iBAAiB,GAAGP,WAAW,GAClC,eAAgBA,WAAW,WAAY,GACvC,EAAE;EACL,MAAMQ,WAAW,GAAGN,IAAI,GAAG,SAAUA,IAAI,EAAG,GAAG,EAAE;EACjD,MAAMO,WAAW,GAAGN,IAAI,GAAG,UAAWA,IAAI,EAAG,GAAG,EAAE;EAClD,MAAMO,OAAO,GAAG,GAAId,OAAO,iBAAmBS,YAAY,GAAKC,cAAc,IAAMC,iBAAiB,GAAKC,WAAW,GAAKC,WAAW,EAAG;;EAEvI;EACA,IAAKC,OAAO,IAAInB,MAAM,EAAG;IACxB;EACD;;EAEA;AACD;AACA;AACA;AACA;AACA;AACA;EACC,IAAAoB,eAAQ,EAAE,YAAY,EAAEf,OAAO,EAAEC,OAAO,EAAEa,OAAQ,CAAC;;EAEnD;EACAE,OAAO,CAACC,IAAI,CAAEH,OAAQ,CAAC;EAEvBnB,MAAM,CAAEmB,OAAO,CAAE,GAAG,IAAI;AACzB","ignoreList":[]} | ||
| { | ||
| "version": 3, | ||
| "sources": ["../src/index.ts"], | ||
| "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { doAction } from '@wordpress/hooks';\n\n/**\n * Object map tracking messages which have been logged, for use in ensuring a\n * message is only logged once.\n */\nexport const logged: Record< string, true > = Object.create( null );\n\ntype DeprecatedOptions = {\n\t/**\n\t * Version in which the feature was deprecated.\n\t */\n\tsince?: string;\n\t/**\n\t * Version in which the feature will be removed.\n\t */\n\tversion?: string;\n\t/**\n\t * Feature to use instead.\n\t */\n\talternative?: string;\n\t/**\n\t * Plugin name if it's a plugin feature.\n\t */\n\tplugin?: string;\n\t/**\n\t * Link to documentation.\n\t */\n\tlink?: string;\n\t/**\n\t * Additional message to help transition away from the deprecated feature.\n\t */\n\thint?: string;\n};\n\n/**\n * Logs a message to notify developers about a deprecated feature.\n *\n * @param {string} feature Name of the deprecated feature.\n * @param {DeprecatedOptions} [options] Personalisation options\n *\n * @example\n * ```js\n * import deprecated from '@wordpress/deprecated';\n *\n * deprecated( 'Eating meat', {\n * \tsince: '2019.01.01',\n * \tversion: '2020.01.01',\n * \talternative: 'vegetables',\n * \tplugin: 'the earth',\n * \thint: 'You may find it beneficial to transition gradually.',\n * } );\n *\n * // Logs: 'Eating meat is deprecated since version 2019.01.01 and will be removed from the earth in version 2020.01.01. Please use vegetables instead. Note: You may find it beneficial to transition gradually.'\n * ```\n */\nexport default function deprecated(\n\tfeature: string,\n\toptions: DeprecatedOptions = {}\n) {\n\tconst { since, version, alternative, plugin, link, hint } = options;\n\n\tconst pluginMessage = plugin ? ` from ${ plugin }` : '';\n\tconst sinceMessage = since ? ` since version ${ since }` : '';\n\tconst versionMessage = version\n\t\t? ` and will be removed${ pluginMessage } in version ${ version }`\n\t\t: '';\n\tconst useInsteadMessage = alternative\n\t\t? ` Please use ${ alternative } instead.`\n\t\t: '';\n\tconst linkMessage = link ? ` See: ${ link }` : '';\n\tconst hintMessage = hint ? ` Note: ${ hint }` : '';\n\tconst message = `${ feature } is deprecated${ sinceMessage }${ versionMessage }.${ useInsteadMessage }${ linkMessage }${ hintMessage }`;\n\n\t// Skip if already logged.\n\tif ( message in logged ) {\n\t\treturn;\n\t}\n\n\t/**\n\t * Fires whenever a deprecated feature is encountered\n\t *\n\t * @param {string} feature Name of the deprecated feature.\n\t * @param {DeprecatedOptions} options Personalisation options\n\t * @param {string} message Message sent to console.warn\n\t */\n\tdoAction( 'deprecated', feature, options, message );\n\n\t// eslint-disable-next-line no-console\n\tconsole.warn( message );\n\n\tlogged[ message ] = true;\n}\n"], | ||
| "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,mBAAyB;AAMlB,MAAM,SAAiC,uBAAO,OAAQ,IAAK;AAkDnD,SAAR,WACN,SACA,UAA6B,CAAC,GAC7B;AACD,QAAM,EAAE,OAAO,SAAS,aAAa,QAAQ,MAAM,KAAK,IAAI;AAE5D,QAAM,gBAAgB,SAAS,SAAU,MAAO,KAAK;AACrD,QAAM,eAAe,QAAQ,kBAAmB,KAAM,KAAK;AAC3D,QAAM,iBAAiB,UACpB,uBAAwB,aAAc,eAAgB,OAAQ,KAC9D;AACH,QAAM,oBAAoB,cACvB,eAAgB,WAAY,cAC5B;AACH,QAAM,cAAc,OAAO,SAAU,IAAK,KAAK;AAC/C,QAAM,cAAc,OAAO,UAAW,IAAK,KAAK;AAChD,QAAM,UAAU,GAAI,OAAQ,iBAAkB,YAAa,GAAI,cAAe,IAAK,iBAAkB,GAAI,WAAY,GAAI,WAAY;AAGrI,MAAK,WAAW,QAAS;AACxB;AAAA,EACD;AASA,6BAAU,cAAc,SAAS,SAAS,OAAQ;AAGlD,UAAQ,KAAM,OAAQ;AAEtB,SAAQ,OAAQ,IAAI;AACrB;", | ||
| "names": [] | ||
| } |
+12
-4
| { | ||
| "name": "@wordpress/deprecated", | ||
| "version": "4.32.0", | ||
| "version": "4.32.1-next.47f435fc9.0", | ||
| "description": "Deprecation utility for WordPress.", | ||
@@ -27,9 +27,17 @@ "author": "The WordPress Contributors", | ||
| "module": "build-module/index.js", | ||
| "exports": { | ||
| ".": { | ||
| "types": "./build-types/index.d.ts", | ||
| "import": "./build-module/index.js", | ||
| "require": "./build/index.js" | ||
| }, | ||
| "./package.json": "./package.json" | ||
| }, | ||
| "react-native": "src/index", | ||
| "wpScript": true, | ||
| "wpScriptDefaultExport": true, | ||
| "types": "build-types", | ||
| "sideEffects": false, | ||
| "dependencies": { | ||
| "@babel/runtime": "7.25.7", | ||
| "@wordpress/hooks": "^4.32.0" | ||
| "@wordpress/hooks": "^4.32.1-next.47f435fc9.0" | ||
| }, | ||
@@ -39,3 +47,3 @@ "publishConfig": { | ||
| }, | ||
| "gitHead": "a030b4c0e0695239b942c7dc18511782b64f10ed" | ||
| "gitHead": "9720f22c138771d2ed1a0522725c3cdf1c242953" | ||
| } |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
1
-50%78129
-3.58%303
-16.53%1
Infinity%- Removed
- Removed
- Removed