Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@liff/is-api-available

Package Overview
Dependencies
Maintainers
2
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@liff/is-api-available - npm Package Compare versions

Comparing version 2.19.1 to 2.20.0

2

lib/index.cjs.js

@@ -1,1 +0,1 @@

"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@liff/consts"),n=require("@liff/util"),i=require("@liff/store"),r=require("@liff/is-in-client"),t=require("@liff/is-logged-in"),o=require("@liff/get-line-version"),u=["subwindowOpen","shareTargetPicker","multipleLiffTransition","scanCode","scanCodeV2","getAdvertisingId","addToHomeScreen","bluetoothLeFunction","skipChannelVerificationScreen"];function s(e){var n,r=i.getContext();return null===(n=null==r?void 0:r.availability)||void 0===n?void 0:n[e]}function a(e,i){var r=o.getLineVersion();return!!r&&(!(i&&n.compareVersion(r,i)>0)&&n.compareVersion(r,e)>=0)}function c(e){var n=s(e);if(!n)return!1;var i=n.permission,t=n.minVer,o=n.unsupportedFromVer;return!!i&&(!!r.isInClient()&&a(t,o))}var f={shareTargetPicker:function(){if(!t.isLoggedIn())return!1;var e=s("shareTargetPicker");if(!e)return!1;var i=e.permission,u=e.minVer;if(!i)return!1;if(r.isInClient()){var a=o.getLineVersion();return null!==a&&n.compareVersion(a,u)>=0}return!0},multipleLiffTransition:function(){var e=s("multipleLiffTransition");if(!e)return!1;var n=e.permission;return r.isInClient()&&n},subwindowOpen:function(){var e=s("subwindowOpen");return!(!e||!e.permission)&&(!r.isInClient()||a(e.minVer,e.unsupportedFromVer))},scanCode:function(){return c("scanCode")},scanCodeV2:function(){var e=s("scanCodeV2");return!(!e||!e.permission)&&(!r.isInClient()||a(e.minVer))},getAdvertisingId:function(){return c("getAdvertisingId")},addToHomeScreen:function(){return c("addToHomeScreen")},bluetoothLeFunction:function(){return c("bluetoothLeFunction")},skipChannelVerificationScreen:function(){return c("skipChannelVerificationScreen")}};exports.isApiAvailable=function(i){if(!u.includes(i))throw n.createLiffError(e.INVALID_ARGUMENT,"Unexpected API name.");var r=f[i];return!r||r()};
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@liff/consts"),n=require("@liff/util"),i=require("@liff/store"),r=require("@liff/is-in-client"),t=require("@liff/is-logged-in"),o=require("@liff/get-line-version"),u=["subwindowOpen","shareTargetPicker","multipleLiffTransition","scanCode","scanCodeV2","getAdvertisingId","addToHomeScreen","bluetoothLeFunction","skipChannelVerificationScreen"];function s(e){var n,r=i.getContext();return null===(n=null==r?void 0:r.availability)||void 0===n?void 0:n[e]}function a(e,i){var r=o.getLineVersion();return!!r&&(!(i&&n.compareVersion(r,i)>0)&&n.compareVersion(r,e)>=0)}function f(e){var n=s(e);if(!n)return!1;var i=n.permission,t=n.minVer,o=n.unsupportedFromVer;return!!i&&(!!r.isInClient()&&a(t,o))}var c={shareTargetPicker:function(){if(!t.isLoggedIn())return!1;var e=s("shareTargetPicker");if(!e)return!1;var i=e.permission,u=e.minVer;if(!i)return!1;if(r.isInClient()){var a=o.getLineVersion();return null!==a&&n.compareVersion(a,u)>=0}return!0},multipleLiffTransition:function(){var e=s("multipleLiffTransition");if(!e)return!1;var n=e.permission;return r.isInClient()&&n},subwindowOpen:function(){var e=s("subwindowOpen");return!(!e||!e.permission)&&(!r.isInClient()||a(e.minVer,e.unsupportedFromVer))},scanCode:function(){return f("scanCode")},scanCodeV2:function(){if(!t.isLoggedIn())return!1;var e=s("scanCodeV2");return!(!e||!e.permission)&&(!r.isInClient()||a(e.minVer))},getAdvertisingId:function(){return f("getAdvertisingId")},addToHomeScreen:function(){return f("addToHomeScreen")},bluetoothLeFunction:function(){return f("bluetoothLeFunction")},skipChannelVerificationScreen:function(){return f("skipChannelVerificationScreen")}};exports.isApiAvailable=function(i){if(!u.includes(i))throw n.createLiffError(e.INVALID_ARGUMENT,"Unexpected API name.");var r=c[i];return!r||r()};

@@ -1,1 +0,1 @@

import{INVALID_ARGUMENT as n}from"@liff/consts";import{createLiffError as r,compareVersion as i}from"@liff/util";import{getContext as e}from"@liff/store";import{isInClient as t}from"@liff/is-in-client";import{isLoggedIn as o}from"@liff/is-logged-in";import{getLineVersion as u}from"@liff/get-line-version";var f=["subwindowOpen","shareTargetPicker","multipleLiffTransition","scanCode","scanCodeV2","getAdvertisingId","addToHomeScreen","bluetoothLeFunction","skipChannelVerificationScreen"];function a(n){var r,i=e();return null===(r=null==i?void 0:i.availability)||void 0===r?void 0:r[n]}function s(n,r){var e=u();return!!e&&(!(r&&i(e,r)>0)&&i(e,n)>=0)}function c(n){var r=a(n);if(!r)return!1;var i=r.permission,e=r.minVer,o=r.unsupportedFromVer;return!!i&&(!!t()&&s(e,o))}var l={shareTargetPicker:function(){if(!o())return!1;var n=a("shareTargetPicker");if(!n)return!1;var r=n.permission,e=n.minVer;if(!r)return!1;if(t()){var f=u();return null!==f&&i(f,e)>=0}return!0},multipleLiffTransition:function(){var n=a("multipleLiffTransition");if(!n)return!1;var r=n.permission;return t()&&r},subwindowOpen:function(){var n=a("subwindowOpen");return!(!n||!n.permission)&&(!t()||s(n.minVer,n.unsupportedFromVer))},scanCode:function(){return c("scanCode")},scanCodeV2:function(){var n=a("scanCodeV2");return!(!n||!n.permission)&&(!t()||s(n.minVer))},getAdvertisingId:function(){return c("getAdvertisingId")},addToHomeScreen:function(){return c("addToHomeScreen")},bluetoothLeFunction:function(){return c("bluetoothLeFunction")},skipChannelVerificationScreen:function(){return c("skipChannelVerificationScreen")}};function m(i){if(!f.includes(i))throw r(n,"Unexpected API name.");var e=l[i];return!e||e()}export{m as isApiAvailable};
import{INVALID_ARGUMENT as n}from"@liff/consts";import{createLiffError as r,compareVersion as i}from"@liff/util";import{getContext as e}from"@liff/store";import{isInClient as t}from"@liff/is-in-client";import{isLoggedIn as o}from"@liff/is-logged-in";import{getLineVersion as u}from"@liff/get-line-version";var f=["subwindowOpen","shareTargetPicker","multipleLiffTransition","scanCode","scanCodeV2","getAdvertisingId","addToHomeScreen","bluetoothLeFunction","skipChannelVerificationScreen"];function a(n){var r,i=e();return null===(r=null==i?void 0:i.availability)||void 0===r?void 0:r[n]}function s(n,r){var e=u();return!!e&&(!(r&&i(e,r)>0)&&i(e,n)>=0)}function c(n){var r=a(n);if(!r)return!1;var i=r.permission,e=r.minVer,o=r.unsupportedFromVer;return!!i&&(!!t()&&s(e,o))}var l={shareTargetPicker:function(){if(!o())return!1;var n=a("shareTargetPicker");if(!n)return!1;var r=n.permission,e=n.minVer;if(!r)return!1;if(t()){var f=u();return null!==f&&i(f,e)>=0}return!0},multipleLiffTransition:function(){var n=a("multipleLiffTransition");if(!n)return!1;var r=n.permission;return t()&&r},subwindowOpen:function(){var n=a("subwindowOpen");return!(!n||!n.permission)&&(!t()||s(n.minVer,n.unsupportedFromVer))},scanCode:function(){return c("scanCode")},scanCodeV2:function(){if(!o())return!1;var n=a("scanCodeV2");return!(!n||!n.permission)&&(!t()||s(n.minVer))},getAdvertisingId:function(){return c("getAdvertisingId")},addToHomeScreen:function(){return c("addToHomeScreen")},bluetoothLeFunction:function(){return c("bluetoothLeFunction")},skipChannelVerificationScreen:function(){return c("skipChannelVerificationScreen")}};function m(i){if(!f.includes(i))throw r(n,"Unexpected API name.");var e=l[i];return!e||e()}export{m as isApiAvailable};
{
"name": "@liff/is-api-available",
"version": "2.19.1",
"version": "2.20.0",
"description": "@liff/is-api-available",

@@ -34,10 +34,10 @@ "license": "SEE LICENSE IN README.md",

"dependencies": {
"@liff/consts": "2.19.1",
"@liff/get-line-version": "2.19.1",
"@liff/is-in-client": "2.19.1",
"@liff/is-logged-in": "2.19.1",
"@liff/store": "2.19.1",
"@liff/util": "2.19.1"
"@liff/consts": "2.20.0",
"@liff/get-line-version": "2.20.0",
"@liff/is-in-client": "2.20.0",
"@liff/is-logged-in": "2.20.0",
"@liff/store": "2.20.0",
"@liff/util": "2.20.0"
},
"gitHead": "83f4036490a2007dd913cbbf20990251099a5153"
"gitHead": "16e650543a0b2b995884e3271d63476d2e83e53e"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc