@thinkpixellab-public/px-vue 3.0.1 → 3.0.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thinkpixellab-public/px-vue",
3
- "version": "3.0.1",
3
+ "version": "3.0.2",
4
4
  "description": "General purpose Vue components and helpers that can be used across projects.",
5
5
  "author": "Pixel Lab",
6
6
  "license": "MIT",
package/plugins/common.js CHANGED
@@ -4,6 +4,7 @@
4
4
  */
5
5
 
6
6
  import bem from '../utils/bem';
7
+ import isServer from '../utils/isServer.js';
7
8
  import { cssPx, cssEm, cssPcnt, cssUrl } from '../utils/cssStr.js';
8
9
  import aspect from './filters/aspect.js';
9
10
  import kebab from './filters/kebab.js';
@@ -20,6 +21,7 @@ export default {
20
21
  Vue.prototype.cssEm = cssEm;
21
22
  Vue.prototype.cssPcnt = cssPcnt;
22
23
  Vue.prototype.cssUrl = cssUrl;
24
+ Vue.prototype.isServer = isServer;
23
25
 
24
26
  // filters
25
27
  Vue.filter('aspect', aspect);
@@ -0,0 +1,5 @@
1
+ const isServer = function () {
2
+ return (typeof process !== 'undefined' && process.server) || typeof window == 'undefined';
3
+ };
4
+
5
+ export default isServer;
package/utils/utils.js CHANGED
@@ -1,5 +1,6 @@
1
1
  // Common utility functions. Anything in here must be static and must be small and must be common
2
2
  // enough to warrant inclusion.
3
+ import isServer from './isServer.js';
3
4
 
4
5
  export default {
5
6
  /**
@@ -84,7 +85,7 @@ export default {
84
85
  * Returns an object representing the current query string parameters.
85
86
  */
86
87
  getQueryParams() {
87
- if (process.server || typeof window == undefined) {
88
+ if (isServer()) {
88
89
  return {};
89
90
  }
90
91
  return new Proxy(new URLSearchParams(window.location.search), {