@ued2345/octopus-util
Advanced tools
Comparing version 1.1.1 to 1.1.2-1
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.octopus=t():e.octopus=t()}(window,(function(){return function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(i,r,function(t){return e[t]}.bind(null,r));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){"use strict";n.r(t);var i,r=function(){var e=navigator.userAgent;return{trident:e.indexOf("Trident")>-1,presto:e.indexOf("Presto")>-1,webKit:e.indexOf("AppleWebKit")>-1,gecko:e.indexOf("Gecko")>-1&&-1===e.indexOf("KHTML"),mobile:!!e.match(/AppleWebKit.*Mobile.*/)||e.indexOf("Mobile")>-1,ios:!!e.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),android:e.indexOf("Android")>-1||e.indexOf("Linux")>-1,iPhone:e.indexOf("iPhone")>-1,iPad:e.indexOf("iPad")>-1,webApp:-1===e.indexOf("Safari"),weixin:e.indexOf("MicroMessenger")>-1,qq:null!==e.match(/\sQQ/i),wpApp:e.indexOf("WangPaiMobile")>-1}},o=r(),c=function(){function e(){this.isIOS=o.ios}return e.prototype.init=function(e){if(this.isIOS){if(window.WebViewJavascriptBridge)return e(window.WebViewJavascriptBridge);if(window.WVJBCallbacks)return window.WVJBCallbacks.push(e);window.WVJBCallbacks=[e];var t=document.createElement("iframe");t.style.display="none",t.src="wvjbscheme://__BRIDGE_LOADED__",document.documentElement.appendChild(t),setTimeout((function(){document.documentElement.removeChild(t)}),0)}else window.WebViewJavascriptBridge?e(window.WebViewJavascriptBridge):document.addEventListener("WebViewJavascriptBridgeReady",(function(){e(window.WebViewJavascriptBridge)}),!1)},e.prototype.first=function(){this.isIOS||this.init((function(e){e.init((function(e,t){t()}))}))},e}(),u=(i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),a=new(function(e){function t(){return e.call(this)||this}return u(t,e),t.prototype.callHandler=function(t,n){e.prototype.init.call(this,(function(e){e.callHandler("jsCallJavaAllInOne",t,n)}))},t.prototype.registerHandler=function(t,n){e.prototype.init.call(this,(function(e){e.registerHandler(t,n)}))},t}(c));a.first();var d={callHandler:a.callHandler,registerHandler:a.registerHandler};n.d(t,"getBrowser",(function(){return r})),n.d(t,"JsBridge",(function(){return d}))}])})); | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.octopus=t():e.octopus=t()}(window,(function(){return function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(i,r,function(t){return e[t]}.bind(null,r));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){"use strict";n.r(t);var i=function(){var e=navigator.userAgent;return{trident:e.indexOf("Trident")>-1,presto:e.indexOf("Presto")>-1,webKit:e.indexOf("AppleWebKit")>-1,gecko:e.indexOf("Gecko")>-1&&-1===e.indexOf("KHTML"),mobile:!!e.match(/AppleWebKit.*Mobile.*/)||e.indexOf("Mobile")>-1,ios:!!e.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),android:e.indexOf("Android")>-1||e.indexOf("Linux")>-1,iPhone:e.indexOf("iPhone")>-1,iPad:e.indexOf("iPad")>-1,webApp:-1===e.indexOf("Safari"),weixin:e.indexOf("MicroMessenger")>-1,qq:null!==e.match(/\sQQ/i)}};var r,o=function(e){return!!(navigator.userAgent.indexOf(e)>-1)},u=i(),c=function(){function e(){this.isIOS=u.ios}return e.prototype.init=function(e){if(this.isIOS){if(window.WebViewJavascriptBridge)return e(window.WebViewJavascriptBridge);if(window.WVJBCallbacks)return window.WVJBCallbacks.push(e);window.WVJBCallbacks=[e];var t=document.createElement("iframe");t.style.display="none",t.src="wvjbscheme://__BRIDGE_LOADED__",document.documentElement.appendChild(t),setTimeout((function(){document.documentElement.removeChild(t)}),0)}else window.WebViewJavascriptBridge?e(window.WebViewJavascriptBridge):document.addEventListener("WebViewJavascriptBridgeReady",(function(){e(window.WebViewJavascriptBridge)}),!1)},e.prototype.first=function(){this.isIOS||this.init((function(e){e.init((function(e,t){t()}))}))},e}(),a=(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),d=new(function(e){function t(){return e.call(this)||this}return a(t,e),t.prototype.callHandler=function(t,n){e.prototype.init.call(this,(function(e){e.callHandler("jsCallJavaAllInOne",t,n)}))},t.prototype.registerHandler=function(t,n){e.prototype.init.call(this,(function(e){e.registerHandler(t,n)}))},t}(c));d.first();var f={callHandler:d.callHandler,registerHandler:d.registerHandler};var l=function(e){for(var t=document.cookie.replace(/\s/g,"").split(";"),n=0;n<t.length;n++){var i=t[n].split("=");if(i[0]==e)return decodeURIComponent(i[1])}return""};var s=function(e,t,n){var i=new Date;i.setTime(i.getTime()+24*n*60*60*1e3);var r="expires="+i.toUTCString();document.cookie=e+"="+t+";path=/;;"+r};var p=function(e){s(e,"",-1)};n.d(t,"getBrowser",(function(){return i})),n.d(t,"getInApp",(function(){return o})),n.d(t,"JsBridge",(function(){return f})),n.d(t,"getCookie",(function(){return l})),n.d(t,"setCookie",(function(){return s})),n.d(t,"delCookie",(function(){return p}))}])})); |
{ | ||
"name": "@ued2345/octopus-util", | ||
"version": "1.1.1", | ||
"version": "1.1.2-1", | ||
"description": "ued2345 utils", | ||
@@ -5,0 +5,0 @@ "main": "dist/octopus.min.js", |
@@ -53,2 +53,5 @@ ### 技术选型 | ||
}, | ||
// 通过userAgent 判断是否在APP内 | ||
getInApp: (uName) => {return boolean}, | ||
// JsBridge 与原生通信 | ||
JsBridge: { | ||
@@ -59,3 +62,7 @@ // js调用webview事件 | ||
registerHandle: (method, callback) => {}, | ||
} | ||
}, | ||
// cookie 操作 | ||
setCookie: (name, value, days) => {}, | ||
getCookie: (name) => {}, | ||
delCookie: (name) => {} | ||
} | ||
@@ -65,3 +72,3 @@ ``` | ||
``` | ||
npm install --save-dev @ued2345/octopus | ||
npm install --save-dev @ued2345/octopus-util | ||
``` | ||
@@ -79,7 +86,7 @@ | ||
```javascript | ||
import * as octopus from '@ued2345/octopus' | ||
import * as octopus from '@ued2345/octopus-util' | ||
const browser = octopus.getBrowser() | ||
// 或单独引用方法 | ||
import {getBrowser} from '@ued2345/octopus' | ||
import {getBrowser} from '@ued2345/octopus-util' | ||
``` | ||
@@ -86,0 +93,0 @@ |
@@ -16,5 +16,4 @@ function getBrowser(): any{ | ||
qq: u.match(/\sQQ/i) !== null, // 是否QQ | ||
wpApp: u.indexOf('WangPaiMobile') > -1 // 是否在王牌移动联盟APP内 | ||
} | ||
} | ||
export default getBrowser; |
@@ -5,7 +5,15 @@ /** | ||
import getBrowser from "./device/getBrowser"; | ||
import getInApp from "./device/getInApp"; | ||
import JsBridge from "./jsbrige/jsBridge"; | ||
import getCookie from "./cookie/getCookie"; | ||
import setCookie from "./cookie/setCookie"; | ||
import delCookie from "./cookie/delCookie"; | ||
export { | ||
getBrowser, // 获取操作系统类型 | ||
getInApp, // 通过userAgent判断是否在app内 | ||
JsBridge, // jsBridge 对象 | ||
getCookie, | ||
setCookie, | ||
delCookie, | ||
}; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
15058
17
284
0
96
2