@smpx/koa-request 1.0.0 → 1.0.1

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.
Files changed (2) hide show
  1. package/Request.js +7 -0
  2. package/package.json +1 -1
package/Request.js CHANGED
@@ -834,6 +834,13 @@ class Request {
834
834
  return false;
835
835
  }
836
836
 
837
+ platform() {
838
+ if (this.isApp()) return 'mobile_app';
839
+ if (this.isMobile()) return 'mobile_web';
840
+ if (this.isAPI()) return 'api';
841
+ return 'desktop';
842
+ }
843
+
837
844
  /**
838
845
  * @typedef {Object} UTMObject
839
846
  * @property {string} source
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smpx/koa-request",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Handle basic tasks for koajs",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",