build/scripts/warning
index.js
1.6 KB
4 months ago
index.js.map
1.7 KB
4 months ago
index.min.asset.php
83 B
7 months ago
index.min.js
758 B
9 months ago
index.min.js.map
1.7 KB
4 months ago
| 1 | "use strict"; |
| 2 | var wp; |
| 3 | (wp ||= {}).warning = (() => { |
| 4 | var __defProp = Object.defineProperty; |
| 5 | var __getOwnPropDesc = Object.getOwnPropertyDescriptor; |
| 6 | var __getOwnPropNames = Object.getOwnPropertyNames; |
| 7 | var __hasOwnProp = Object.prototype.hasOwnProperty; |
| 8 | var __export = (target, all) => { |
| 9 | for (var name in all) |
| 10 | __defProp(target, name, { get: all[name], enumerable: true }); |
| 11 | }; |
| 12 | var __copyProps = (to, from, except, desc) => { |
| 13 | if (from && typeof from === "object" || typeof from === "function") { |
| 14 | for (let key of __getOwnPropNames(from)) |
| 15 | if (!__hasOwnProp.call(to, key) && key !== except) |
| 16 | __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); |
| 17 | } |
| 18 | return to; |
| 19 | }; |
| 20 | var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); |
| 21 | |
| 22 | // packages/warning/build-module/index.mjs |
| 23 | var index_exports = {}; |
| 24 | __export(index_exports, { |
| 25 | default: () => warning |
| 26 | }); |
| 27 | |
| 28 | // packages/warning/build-module/utils.mjs |
| 29 | var logged = /* @__PURE__ */ new Set(); |
| 30 | |
| 31 | // packages/warning/build-module/index.mjs |
| 32 | function isDev() { |
| 33 | return true; |
| 34 | } |
| 35 | function warning(message) { |
| 36 | if (!isDev()) { |
| 37 | return; |
| 38 | } |
| 39 | if (logged.has(message)) { |
| 40 | return; |
| 41 | } |
| 42 | console.warn(message); |
| 43 | try { |
| 44 | throw Error(message); |
| 45 | } catch { |
| 46 | } |
| 47 | logged.add(message); |
| 48 | } |
| 49 | return __toCommonJS(index_exports); |
| 50 | })(); |
| 51 | if (typeof wp.warning === 'object' && wp.warning.default) { wp.warning = wp.warning.default; } |
| 52 | //# sourceMappingURL=index.js.map |
| 53 |