@dream-encode/wp-js-plugin-utils 0.2.5 → 0.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -3,9 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.utils = exports.settings = exports.hooks = exports.dataMigrations = exports.components = exports.api = void 0;
7
- var _api = _interopRequireWildcard(require("./api"));
8
- exports.api = _api;
6
+ exports.utils = exports.settings = exports.hooks = exports.dataMigrations = exports.components = void 0;
9
7
  var _components = _interopRequireWildcard(require("./components"));
10
8
  exports.components = _components;
11
9
  var _dataMigrations = _interopRequireWildcard(require("./data-migrations"));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dream-encode/wp-js-plugin-utils",
3
- "version": "0.2.5",
3
+ "version": "0.2.6",
4
4
  "description": "Common JS functionality used by custom WP plugins.",
5
5
  "keywords": [
6
6
  "wordpress",
@@ -1,39 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.fetchPostOptions = exports.fetchGetOptions = void 0;
7
- /**
8
- * Build fetch GET options with the WP REST nonce header.
9
- *
10
- * @param {string} nonce WP REST nonce.
11
- * @return {Object}
12
- */
13
- const fetchGetOptions = nonce => {
14
- return {
15
- headers: {
16
- 'X-WP-Nonce': nonce
17
- }
18
- };
19
- };
20
-
21
- /**
22
- * Build fetch POST options with the WP REST nonce header.
23
- *
24
- * @param {Object} postData Body to JSON-encode.
25
- * @param {string} nonce WP REST nonce.
26
- * @return {Object}
27
- */
28
- exports.fetchGetOptions = fetchGetOptions;
29
- const fetchPostOptions = (postData, nonce) => {
30
- return {
31
- method: 'POST',
32
- headers: {
33
- 'Content-Type': 'application/json',
34
- 'X-WP-Nonce': nonce
35
- },
36
- body: JSON.stringify(postData)
37
- };
38
- };
39
- exports.fetchPostOptions = fetchPostOptions;
package/dist/api/index.js DELETED
@@ -1,16 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- var _fetchOptions = require("./fetchOptions");
7
- Object.keys(_fetchOptions).forEach(function (key) {
8
- if (key === "default" || key === "__esModule") return;
9
- if (key in exports && exports[key] === _fetchOptions[key]) return;
10
- Object.defineProperty(exports, key, {
11
- enumerable: true,
12
- get: function () {
13
- return _fetchOptions[key];
14
- }
15
- });
16
- });