@liff/util
Advanced tools
Comparing version 2.19.0 to 2.19.1
@@ -1,1 +0,1 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var r=require("@liff/logger"),e=require("tslib"),t=require("@liff/consts");function n(r){return window.atob(r.replace(/-/g,"+").replace(/_/g,"/"))}var o={decode:n,encode:function(r){return window.btoa(r).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")},decodeUnicode:function(r){var e=n(r).split("").map((function(r){return"%"+("00"+r.charCodeAt(0).toString(16)).slice(-2)})).join("");return decodeURIComponent(e)}};function i(r){return parseInt(r,16)}var a={get:function(r){var e=new RegExp("(?:(?:^|.*;\\s*)"+r+"\\s*\\=\\s*([^;]*).*$)|^.*$");return document.cookie.replace(e,"$1")},set:function(e,t,n){var o=e+"="+t;if(n)for(var i in n){o+="; "+i+(n[i]?"="+n[i]:"")}r.logger.debug("set cookie",o),document.cookie=o},remove:function(r,e){var t=r+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT";if(e)for(var n in e)t+="; "+n+"="+e[n];document.cookie=t}},u=new Set(["400","401","403","404","429","500"]),c=function(r){function t(e,t){var n=r.call(this,t)||this;return n.code=e,n}return e.__extends(t,r),t}(Error);var s=new(function(){function r(){this.map={}}return r.prototype.clear=function(){this.map={}},r.prototype.getItem=function(r){var e=this.map[r];return void 0===e?null:e},r.prototype.setItem=function(r,e){this.map[r]=e},r.prototype.removeItem=function(r){delete this.map[r]},r.prototype.key=function(r){var e=Object.keys(this.map)[r];return void 0===e?null:e},Object.defineProperty(r.prototype,"length",{get:function(){return Object.keys(this.map).length},enumerable:!1,configurable:!0}),r}());var f={parse:function(r){return r.replace(/^\?/,"").replace(/^#\/?/,"").split(/&+/).filter((function(r){return r.length>0})).reduce((function(r,t){var n=e.__read(t.split("=").map(decodeURIComponent),2),o=n[0],i=n[1],a=r[o];return Array.isArray(a)?a.push(i):Object.prototype.hasOwnProperty.call(r,o)?r[o]=[a,i]:r[o]=i,r}),{})},stringify:function(r){return Object.keys(r).map((function(e){var t=r[e],n=function(r){return void 0!==r?encodeURIComponent(e)+"="+encodeURIComponent(r):encodeURIComponent(e)};return Array.isArray(t)?t.map((function(r){return n(r)})).join("&"):n(t)})).join("&")}},p="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function l(){return window.crypto.getRandomValues(new Uint32Array(1))[0]/4294967296}function d(r){var e=new URL(r),n=e.hash.slice(1).split("&").filter((function(r){return!t.CREDENTIAL_KEYS.some((function(e){return r.includes(e+"=")}))})).join("&");return e.hash=n,e.toString()}function v(r){var t=new URL(r);return t.toString().replace(new RegExp(String.raw(g||(g=e.__makeTemplateObject(["^",""],["^",""])),t.origin)),"")}var g;function h(){return new RegExp("^"+t.PERMANENT_LINK_ORIGIN+"(\\d+-\\w+)")}exports.HTTPStatusCodes=u,exports.LiffError=c,exports.addParamsToUrl=function(r,t){if(!r)throw new Error("addParamsToUrl: invalid URL");var n=new URL(r);return Object.entries(t).forEach((function(r){var t=e.__read(r,2),o=t[0],i=t[1];n.searchParams.set(o,i)})),n.toString()},exports.base64Url=o,exports.compareVersion=function(r,e){if(r===e)return 0;for(var t=r.split("."),n=e.split("."),o=Math.max(t.length,n.length),i=0;i<o;i++){t[i]||(t[i]="0"),n[i]||(n[i]="0");var a=parseInt(t[i])-parseInt(n[i]);if(0!==a)return a>0?1:-1}return 0},exports.convertArgbToRgba=function(e){var t=e.replace("#","").match(/.{2}/g)||[];if(4!==t.length)return r.logger.warn("convertArgbToRgba: Received invalid ARGB color"),"";var n=function(r){var e=i(r);return Math.round(e/255*100)/100}(t[0]);return"rgba("+i(t[1])+", "+i(t[2])+", "+i(t[3])+", "+n+")"},exports.convertArrayBuffer=function(r){for(var e=r.length,t=new ArrayBuffer(e),n=new Uint8Array(t),o=0;o<e;o++)n[o]=r.charCodeAt(o);return t},exports.convertHexToRgb=function(e){var t=e.replace("#","").match(/.{2}/g)||[];return 3!==t.length?(r.logger.warn("convertArgbToRgba: Received invalid hex color"),""):i(t[0])+", "+i(t[1])+", "+i(t[2])},exports.cookie=a,exports.createLiffError=function(r,e){return new c(r,e||"")},exports.extractChannelIdFromLiffId=function(r){var e=r.match(/([^-]+)-[^-]+/);return e&&e[1]},exports.extractLiffId=function(r){var e=r.match(h());return e&&e[1]},exports.getOriginOfUrl=function(r){var e=r.match(/^(https?:\/\/.*?)\//);return e&&e[1]||""},exports.getRandomValue=l,exports.hexToBase64=function(r){var e="";return r.replace(/\r|\n/g,"").replace(/([\da-fA-F]{2}) ?/g,"0x$1 ").replace(/ +$/,"").split(" ").forEach((function(r){e+=String.fromCharCode(parseInt(r))})),window.btoa(e)},exports.inMemoryStorage=s,exports.isIE=function(r){void 0===r&&(r=window.navigator.userAgent);var e=r.toLowerCase();return-1!==e.indexOf("msie")||-1!==e.indexOf("trident")},exports.isIpad=function(r){return void 0===r&&(r=window.navigator.userAgent),/ipad/.test(r.toLowerCase())},exports.isLIFFBrowser=function(r){return void 0===r&&(r=window.navigator.userAgent),/Line\/\d+\.\d+\.\d+ LIFF/.test(r)},exports.isLINEBrowser=function(r){return void 0===r&&(r=window.navigator.userAgent),/Line\/\d+\.\d+\.\d+/.test(r)},exports.isLiffUrl=function(r){return h().test(r)},exports.isSubWindow=function(r){return void 0===r&&(r=window.navigator.userAgent),/LIFF\/SubWindow/.test(r)},exports.objectAssignKeyOnlyWithValue=function(r){for(var t,n,o=[],i=1;i<arguments.length;i++)o[i-1]=arguments[i];var a=function(e){Object.keys(e).filter((function(r){return null!==e[r]&&void 0!==e[r]})).forEach((function(t){r[t]=e[t]}))};try{for(var u=e.__values(o),c=u.next();!c.done;c=u.next()){var s=c.value;a(s)}}catch(f){t={error:f}}finally{try{c&&!c.done&&(n=u.return)&&n.call(u)}finally{if(t)throw t.error}}return r},exports.qs=f,exports.randomAlphaNumericString=function(r){for(var e="",t=0;t<r;t++)e+=p[Math.floor(l()*p.length)];return e},exports.removeCredential=d,exports.removeOrigin=v,exports.replaceUrlCredentialRemoved=function(r){var e=v(d(r));window.history.replaceState(history.state,"",e)}; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var r=require("@liff/logger"),e=require("tslib"),t=require("@liff/consts");function n(r){return window.atob(r.replace(/-/g,"+").replace(/_/g,"/"))}var o={decode:n,encode:function(r){return window.btoa(r).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")},decodeUnicode:function(r){var e=n(r).split("").map((function(r){return"%"+("00"+r.charCodeAt(0).toString(16)).slice(-2)})).join("");return decodeURIComponent(e)}};function i(r){return parseInt(r,16)}var a={get:function(r){var e=new RegExp("(?:(?:^|.*;\\s*)"+r+"\\s*\\=\\s*([^;]*).*$)|^.*$");return document.cookie.replace(e,"$1")},set:function(e,t,n){var o=e+"="+t;if(n)for(var i in n){o+="; "+i+(n[i]?"="+n[i]:"")}r.logger.debug("set cookie",o),document.cookie=o},remove:function(r,e){var t=r+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT";if(e)for(var n in e)t+="; "+n+"="+e[n];document.cookie=t}},c=new Set(["400","401","403","404","429","500"]),u=function(r){function t(e,t){var n=r.call(this,t)||this;return n.code=e,n}return e.__extends(t,r),t}(Error);var s=new(function(){function r(){this.map={}}return r.prototype.clear=function(){this.map={}},r.prototype.getItem=function(r){var e=this.map[r];return void 0===e?null:e},r.prototype.setItem=function(r,e){this.map[r]=e},r.prototype.removeItem=function(r){delete this.map[r]},r.prototype.key=function(r){var e=Object.keys(this.map)[r];return void 0===e?null:e},Object.defineProperty(r.prototype,"length",{get:function(){return Object.keys(this.map).length},enumerable:!1,configurable:!0}),r}());var f={parse:function(r){return r.replace(/^\?/,"").replace(/^#\/?/,"").split(/&+/).filter((function(r){return r.length>0})).reduce((function(r,t){var n=e.__read(t.split("=").map(decodeURIComponent),2),o=n[0],i=n[1],a=r[o];return Array.isArray(a)?a.push(i):Object.prototype.hasOwnProperty.call(r,o)?r[o]=[a,i]:r[o]=i,r}),{})},stringify:function(r){return Object.keys(r).map((function(e){var t=r[e],n=function(r){return void 0!==r?encodeURIComponent(e)+"="+encodeURIComponent(r):encodeURIComponent(e)};return Array.isArray(t)?t.map((function(r){return n(r)})).join("&"):n(t)})).join("&")}},p="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function l(){return window.crypto.getRandomValues(new Uint32Array(1))[0]/4294967296}function d(r){var e=new URL(r),n=e.hash.slice(1).split("&").filter((function(r){return!t.CREDENTIAL_KEYS.some((function(e){return r.includes(e+"=")}))})).join("&");return e.hash=n,e.toString()}function v(r){var t=new URL(r);return t.toString().replace(new RegExp(String.raw(g||(g=e.__makeTemplateObject(["^",""],["^",""])),t.origin)),"")}var g;exports.HTTPStatusCodes=c,exports.LiffError=u,exports.addParamsToUrl=function(r,t){if(!r)throw new Error("addParamsToUrl: invalid URL");var n=new URL(r);return Object.entries(t).forEach((function(r){var t=e.__read(r,2),o=t[0],i=t[1];n.searchParams.set(o,i)})),n.toString()},exports.base64Url=o,exports.compareVersion=function(r,e){if(r===e)return 0;for(var t=r.split("."),n=e.split("."),o=Math.max(t.length,n.length),i=0;i<o;i++){t[i]||(t[i]="0"),n[i]||(n[i]="0");var a=parseInt(t[i])-parseInt(n[i]);if(0!==a)return a>0?1:-1}return 0},exports.convertArgbToRgba=function(e){var t=e.replace("#","").match(/.{2}/g)||[];if(4!==t.length)return r.logger.warn("convertArgbToRgba: Received invalid ARGB color"),"";var n=function(r){var e=i(r);return Math.round(e/255*100)/100}(t[0]);return"rgba("+i(t[1])+", "+i(t[2])+", "+i(t[3])+", "+n+")"},exports.convertArrayBuffer=function(r){for(var e=r.length,t=new ArrayBuffer(e),n=new Uint8Array(t),o=0;o<e;o++)n[o]=r.charCodeAt(o);return t},exports.convertHexToRgb=function(e){var t=e.replace("#","").match(/.{2}/g)||[];return 3!==t.length?(r.logger.warn("convertArgbToRgba: Received invalid hex color"),""):i(t[0])+", "+i(t[1])+", "+i(t[2])},exports.cookie=a,exports.createLiffError=function(r,e){return new u(r,e||"")},exports.extractChannelIdFromLiffId=function(r){var e=r.match(/([^-]+)-[^-]+/);return e&&e[1]},exports.extractLiffId=function(r){var e,n,o=r.match((n=t.PERMANENT_LINK_ORIGIN,e=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),new RegExp("^"+e+"(\\d+-\\w+)")));return o&&o[1]},exports.getOriginOfUrl=function(r){var e=r.match(/^(https?:\/\/.*?)\//);return e&&e[1]||""},exports.getRandomValue=l,exports.hexToBase64=function(r){var e="";return r.replace(/\r|\n/g,"").replace(/([\da-fA-F]{2}) ?/g,"0x$1 ").replace(/ +$/,"").split(" ").forEach((function(r){e+=String.fromCharCode(parseInt(r))})),window.btoa(e)},exports.inMemoryStorage=s,exports.isIE=function(r){void 0===r&&(r=window.navigator.userAgent);var e=r.toLowerCase();return-1!==e.indexOf("msie")||-1!==e.indexOf("trident")},exports.isIpad=function(r){return void 0===r&&(r=window.navigator.userAgent),/ipad/.test(r.toLowerCase())},exports.isLIFFBrowser=function(r){return void 0===r&&(r=window.navigator.userAgent),/Line\/\d+\.\d+\.\d+ LIFF/.test(r)},exports.isLINEBrowser=function(r){return void 0===r&&(r=window.navigator.userAgent),/Line\/\d+\.\d+\.\d+/.test(r)},exports.isSubWindow=function(r){return void 0===r&&(r=window.navigator.userAgent),/LIFF\/SubWindow/.test(r)},exports.objectAssignKeyOnlyWithValue=function(r){for(var t,n,o=[],i=1;i<arguments.length;i++)o[i-1]=arguments[i];var a=function(e){Object.keys(e).filter((function(r){return null!==e[r]&&void 0!==e[r]})).forEach((function(t){r[t]=e[t]}))};try{for(var c=e.__values(o),u=c.next();!u.done;u=c.next()){var s=u.value;a(s)}}catch(f){t={error:f}}finally{try{u&&!u.done&&(n=c.return)&&n.call(c)}finally{if(t)throw t.error}}return r},exports.qs=f,exports.randomAlphaNumericString=function(r){for(var e="",t=0;t<r;t++)e+=p[Math.floor(l()*p.length)];return e},exports.removeCredential=d,exports.removeOrigin=v,exports.replaceUrlCredentialRemoved=function(r){var e=v(d(r));window.history.replaceState(history.state,"",e)}; |
@@ -1,1 +0,1 @@ | ||
import{logger as n}from"@liff/logger";import{__extends as r,__read as t,__makeTemplateObject as e,__values as o}from"tslib";import{CREDENTIAL_KEYS as i,PERMANENT_LINK_ORIGIN as a}from"@liff/consts";function u(n){return window.atob(n.replace(/-/g,"+").replace(/_/g,"/"))}var c={decode:u,encode:function(n){return window.btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")},decodeUnicode:function(n){var r=u(n).split("").map((function(n){return"%"+("00"+n.charCodeAt(0).toString(16)).slice(-2)})).join("");return decodeURIComponent(r)}};function f(n,r){if(n===r)return 0;for(var t=n.split("."),e=r.split("."),o=Math.max(t.length,e.length),i=0;i<o;i++){t[i]||(t[i]="0"),e[i]||(e[i]="0");var a=parseInt(t[i])-parseInt(e[i]);if(0!==a)return a>0?1:-1}return 0}function l(r){var t=r.replace("#","").match(/.{2}/g)||[];if(4!==t.length)return n.warn("convertArgbToRgba: Received invalid ARGB color"),"";var e=function(n){var r=p(n);return Math.round(r/255*100)/100}(t[0]);return"rgba("+p(t[1])+", "+p(t[2])+", "+p(t[3])+", "+e+")"}function p(n){return parseInt(n,16)}function s(r){var t=r.replace("#","").match(/.{2}/g)||[];return 3!==t.length?(n.warn("convertArgbToRgba: Received invalid hex color"),""):p(t[0])+", "+p(t[1])+", "+p(t[2])}function d(n){for(var r=n.length,t=new ArrayBuffer(r),e=new Uint8Array(t),o=0;o<r;o++)e[o]=n.charCodeAt(o);return t}var v={get:function(n){var r=new RegExp("(?:(?:^|.*;\\s*)"+n+"\\s*\\=\\s*([^;]*).*$)|^.*$");return document.cookie.replace(r,"$1")},set:function(r,t,e){var o=r+"="+t;if(e)for(var i in e){o+="; "+i+(e[i]?"="+e[i]:"")}n.debug("set cookie",o),document.cookie=o},remove:function(n,r){var t=n+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT";if(r)for(var e in r)t+="; "+e+"="+r[e];document.cookie=t}},g=new Set(["400","401","403","404","429","500"]),h=function(n){function t(r,t){var e=n.call(this,t)||this;return e.code=r,e}return r(t,n),t}(Error);function m(n,r){return new h(n,r||"")}function w(n){var r=n.match(/([^-]+)-[^-]+/);return r&&r[1]}function y(n){var r="";return n.replace(/\r|\n/g,"").replace(/([\da-fA-F]{2}) ?/g,"0x$1 ").replace(/ +$/,"").split(" ").forEach((function(n){r+=String.fromCharCode(parseInt(n))})),window.btoa(r)}var b=new(function(){function n(){this.map={}}return n.prototype.clear=function(){this.map={}},n.prototype.getItem=function(n){var r=this.map[n];return void 0===r?null:r},n.prototype.setItem=function(n,r){this.map[n]=r},n.prototype.removeItem=function(n){delete this.map[n]},n.prototype.key=function(n){var r=Object.keys(this.map)[n];return void 0===r?null:r},Object.defineProperty(n.prototype,"length",{get:function(){return Object.keys(this.map).length},enumerable:!1,configurable:!0}),n}());var A={parse:function(n){return n.replace(/^\?/,"").replace(/^#\/?/,"").split(/&+/).filter((function(n){return n.length>0})).reduce((function(n,r){var e=t(r.split("=").map(decodeURIComponent),2),o=e[0],i=e[1],a=n[o];return Array.isArray(a)?a.push(i):Object.prototype.hasOwnProperty.call(n,o)?n[o]=[a,i]:n[o]=i,n}),{})},stringify:function(n){return Object.keys(n).map((function(r){var t=n[r],e=function(n){return void 0!==n?encodeURIComponent(r)+"="+encodeURIComponent(n):encodeURIComponent(r)};return Array.isArray(t)?t.map((function(n){return e(n)})).join("&"):e(t)})).join("&")}},R="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function I(){return window.crypto.getRandomValues(new Uint32Array(1))[0]/4294967296}function U(n){for(var r="",t=0;t<n;t++)r+=R[Math.floor(I()*R.length)];return r}function x(n){var r=new URL(n),t=r.hash.slice(1).split("&").filter((function(n){return!i.some((function(r){return n.includes(r+"=")}))})).join("&");return r.hash=t,r.toString()}function j(n){var r=new URL(n);return r.toString().replace(new RegExp(String.raw(C||(C=e(["^",""],["^",""])),r.origin)),"")}var C,L=function(n){var r=j(x(n));window.history.replaceState(history.state,"",r)};function O(n,r){if(!n)throw new Error("addParamsToUrl: invalid URL");var e=new URL(n);return Object.entries(r).forEach((function(n){var r=t(n,2),o=r[0],i=r[1];e.searchParams.set(o,i)})),e.toString()}function k(n){return E().test(n)}function S(n){var r=n.match(E());return r&&r[1]}function E(){return new RegExp("^"+a+"(\\d+-\\w+)")}function F(n){var r=n.match(/^(https?:\/\/.*?)\//);return r&&r[1]||""}function T(n){void 0===n&&(n=window.navigator.userAgent);var r=n.toLowerCase();return-1!==r.indexOf("msie")||-1!==r.indexOf("trident")}function $(n){return void 0===n&&(n=window.navigator.userAgent),/ipad/.test(n.toLowerCase())}function M(n){return void 0===n&&(n=window.navigator.userAgent),/Line\/\d+\.\d+\.\d+/.test(n)}function P(n){return void 0===n&&(n=window.navigator.userAgent),/Line\/\d+\.\d+\.\d+ LIFF/.test(n)}function B(n){return void 0===n&&(n=window.navigator.userAgent),/LIFF\/SubWindow/.test(n)}function G(n){for(var r,t,e=[],i=1;i<arguments.length;i++)e[i-1]=arguments[i];var a=function(r){Object.keys(r).filter((function(n){return null!==r[n]&&void 0!==r[n]})).forEach((function(t){n[t]=r[t]}))};try{for(var u=o(e),c=u.next();!c.done;c=u.next()){var f=c.value;a(f)}}catch(l){r={error:l}}finally{try{c&&!c.done&&(t=u.return)&&t.call(u)}finally{if(r)throw r.error}}return n}export{g as HTTPStatusCodes,h as LiffError,O as addParamsToUrl,c as base64Url,f as compareVersion,l as convertArgbToRgba,d as convertArrayBuffer,s as convertHexToRgb,v as cookie,m as createLiffError,w as extractChannelIdFromLiffId,S as extractLiffId,F as getOriginOfUrl,I as getRandomValue,y as hexToBase64,b as inMemoryStorage,T as isIE,$ as isIpad,P as isLIFFBrowser,M as isLINEBrowser,k as isLiffUrl,B as isSubWindow,G as objectAssignKeyOnlyWithValue,A as qs,U as randomAlphaNumericString,x as removeCredential,j as removeOrigin,L as replaceUrlCredentialRemoved}; | ||
import{logger as n}from"@liff/logger";import{__extends as r,__read as e,__makeTemplateObject as t,__values as o}from"tslib";import{CREDENTIAL_KEYS as i,PERMANENT_LINK_ORIGIN as a}from"@liff/consts";function c(n){return window.atob(n.replace(/-/g,"+").replace(/_/g,"/"))}var u={decode:c,encode:function(n){return window.btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")},decodeUnicode:function(n){var r=c(n).split("").map((function(n){return"%"+("00"+n.charCodeAt(0).toString(16)).slice(-2)})).join("");return decodeURIComponent(r)}};function f(n,r){if(n===r)return 0;for(var e=n.split("."),t=r.split("."),o=Math.max(e.length,t.length),i=0;i<o;i++){e[i]||(e[i]="0"),t[i]||(t[i]="0");var a=parseInt(e[i])-parseInt(t[i]);if(0!==a)return a>0?1:-1}return 0}function l(r){var e=r.replace("#","").match(/.{2}/g)||[];if(4!==e.length)return n.warn("convertArgbToRgba: Received invalid ARGB color"),"";var t=function(n){var r=p(n);return Math.round(r/255*100)/100}(e[0]);return"rgba("+p(e[1])+", "+p(e[2])+", "+p(e[3])+", "+t+")"}function p(n){return parseInt(n,16)}function d(r){var e=r.replace("#","").match(/.{2}/g)||[];return 3!==e.length?(n.warn("convertArgbToRgba: Received invalid hex color"),""):p(e[0])+", "+p(e[1])+", "+p(e[2])}function s(n){for(var r=n.length,e=new ArrayBuffer(r),t=new Uint8Array(e),o=0;o<r;o++)t[o]=n.charCodeAt(o);return e}var v={get:function(n){var r=new RegExp("(?:(?:^|.*;\\s*)"+n+"\\s*\\=\\s*([^;]*).*$)|^.*$");return document.cookie.replace(r,"$1")},set:function(r,e,t){var o=r+"="+e;if(t)for(var i in t){o+="; "+i+(t[i]?"="+t[i]:"")}n.debug("set cookie",o),document.cookie=o},remove:function(n,r){var e=n+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT";if(r)for(var t in r)e+="; "+t+"="+r[t];document.cookie=e}},g=new Set(["400","401","403","404","429","500"]),h=function(n){function e(r,e){var t=n.call(this,e)||this;return t.code=r,t}return r(e,n),e}(Error);function m(n,r){return new h(n,r||"")}function w(n){var r=n.match(/([^-]+)-[^-]+/);return r&&r[1]}function y(n){var r="";return n.replace(/\r|\n/g,"").replace(/([\da-fA-F]{2}) ?/g,"0x$1 ").replace(/ +$/,"").split(" ").forEach((function(n){r+=String.fromCharCode(parseInt(n))})),window.btoa(r)}var b=new(function(){function n(){this.map={}}return n.prototype.clear=function(){this.map={}},n.prototype.getItem=function(n){var r=this.map[n];return void 0===r?null:r},n.prototype.setItem=function(n,r){this.map[n]=r},n.prototype.removeItem=function(n){delete this.map[n]},n.prototype.key=function(n){var r=Object.keys(this.map)[n];return void 0===r?null:r},Object.defineProperty(n.prototype,"length",{get:function(){return Object.keys(this.map).length},enumerable:!1,configurable:!0}),n}());var A={parse:function(n){return n.replace(/^\?/,"").replace(/^#\/?/,"").split(/&+/).filter((function(n){return n.length>0})).reduce((function(n,r){var t=e(r.split("=").map(decodeURIComponent),2),o=t[0],i=t[1],a=n[o];return Array.isArray(a)?a.push(i):Object.prototype.hasOwnProperty.call(n,o)?n[o]=[a,i]:n[o]=i,n}),{})},stringify:function(n){return Object.keys(n).map((function(r){var e=n[r],t=function(n){return void 0!==n?encodeURIComponent(r)+"="+encodeURIComponent(n):encodeURIComponent(r)};return Array.isArray(e)?e.map((function(n){return t(n)})).join("&"):t(e)})).join("&")}},R="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function I(){return window.crypto.getRandomValues(new Uint32Array(1))[0]/4294967296}function U(n){for(var r="",e=0;e<n;e++)r+=R[Math.floor(I()*R.length)];return r}function x(n){var r=new URL(n),e=r.hash.slice(1).split("&").filter((function(n){return!i.some((function(r){return n.includes(r+"=")}))})).join("&");return r.hash=e,r.toString()}function j(n){var r=new URL(n);return r.toString().replace(new RegExp(String.raw(C||(C=t(["^",""],["^",""])),r.origin)),"")}var C,L=function(n){var r=j(x(n));window.history.replaceState(history.state,"",r)};function O(n,r){if(!n)throw new Error("addParamsToUrl: invalid URL");var t=new URL(n);return Object.entries(r).forEach((function(n){var r=e(n,2),o=r[0],i=r[1];t.searchParams.set(o,i)})),t.toString()}function k(n){var r,e=n.match((r=a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),new RegExp("^"+r+"(\\d+-\\w+)")));return e&&e[1]}function S(n){var r=n.match(/^(https?:\/\/.*?)\//);return r&&r[1]||""}function E(n){void 0===n&&(n=window.navigator.userAgent);var r=n.toLowerCase();return-1!==r.indexOf("msie")||-1!==r.indexOf("trident")}function $(n){return void 0===n&&(n=window.navigator.userAgent),/ipad/.test(n.toLowerCase())}function F(n){return void 0===n&&(n=window.navigator.userAgent),/Line\/\d+\.\d+\.\d+/.test(n)}function T(n){return void 0===n&&(n=window.navigator.userAgent),/Line\/\d+\.\d+\.\d+ LIFF/.test(n)}function M(n){return void 0===n&&(n=window.navigator.userAgent),/LIFF\/SubWindow/.test(n)}function P(n){for(var r,e,t=[],i=1;i<arguments.length;i++)t[i-1]=arguments[i];var a=function(r){Object.keys(r).filter((function(n){return null!==r[n]&&void 0!==r[n]})).forEach((function(e){n[e]=r[e]}))};try{for(var c=o(t),u=c.next();!u.done;u=c.next()){var f=u.value;a(f)}}catch(l){r={error:l}}finally{try{u&&!u.done&&(e=c.return)&&e.call(c)}finally{if(r)throw r.error}}return n}export{g as HTTPStatusCodes,h as LiffError,O as addParamsToUrl,u as base64Url,f as compareVersion,l as convertArgbToRgba,s as convertArrayBuffer,d as convertHexToRgb,v as cookie,m as createLiffError,w as extractChannelIdFromLiffId,k as extractLiffId,S as getOriginOfUrl,I as getRandomValue,y as hexToBase64,b as inMemoryStorage,E as isIE,$ as isIpad,T as isLIFFBrowser,F as isLINEBrowser,M as isSubWindow,P as objectAssignKeyOnlyWithValue,A as qs,U as randomAlphaNumericString,x as removeCredential,j as removeOrigin,L as replaceUrlCredentialRemoved}; |
@@ -24,4 +24,3 @@ /** | ||
}): string; | ||
export declare function isLiffUrl(url: string): boolean; | ||
export declare function extractLiffId(url: string): string | null; | ||
export declare function getOriginOfUrl(url: string): string; |
{ | ||
"name": "@liff/util", | ||
"version": "2.19.0", | ||
"version": "2.19.1", | ||
"description": "@liff/util", | ||
@@ -31,4 +31,4 @@ "license": "SEE LICENSE IN README.md", | ||
"dependencies": { | ||
"@liff/consts": "2.19.0", | ||
"@liff/logger": "2.19.0" | ||
"@liff/consts": "2.19.1", | ||
"@liff/logger": "2.19.1" | ||
}, | ||
@@ -41,3 +41,3 @@ "devDependencies": { | ||
}, | ||
"gitHead": "9fa27153b4b470c95e025501d90f8b24d67cc5fb" | ||
"gitHead": "83f4036490a2007dd913cbbf20990251099a5153" | ||
} |
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
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
21388
273
+ Added@liff/consts@2.19.1(transitive)
+ Added@liff/logger@2.19.1(transitive)
- Removed@liff/consts@2.19.0(transitive)
- Removed@liff/logger@2.19.0(transitive)
Updated@liff/consts@2.19.1
Updated@liff/logger@2.19.1