@necto/platform 1.1.0 → 1.4.0
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/LICENSE +1 -1
- package/dist/index.d.mts +5 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c)
|
|
3
|
+
Copyright (c) Corinvo, LLC. and affiliates. All rights reserved.
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
package/dist/index.d.mts
CHANGED
|
@@ -9,4 +9,8 @@ declare const isMac: () => boolean;
|
|
|
9
9
|
|
|
10
10
|
declare const isAndroid: () => any;
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
declare const isIPhone: () => boolean;
|
|
13
|
+
declare const isIPad: () => boolean;
|
|
14
|
+
declare const isIOS: () => boolean;
|
|
15
|
+
|
|
16
|
+
export { isAndroid, isIOS, isIPad, isIPhone, isMac };
|
package/dist/index.d.ts
CHANGED
|
@@ -9,4 +9,8 @@ declare const isMac: () => boolean;
|
|
|
9
9
|
|
|
10
10
|
declare const isAndroid: () => any;
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
declare const isIPhone: () => boolean;
|
|
13
|
+
declare const isIPad: () => boolean;
|
|
14
|
+
declare const isIOS: () => boolean;
|
|
15
|
+
|
|
16
|
+
export { isAndroid, isIOS, isIPad, isIPhone, isMac };
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=Object.defineProperty;var
|
|
1
|
+
"use strict";var e=Object.defineProperty;var w=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var p=Object.prototype.hasOwnProperty;var g=(t,n)=>{for(var r in n)e(t,r,{get:n[r],enumerable:!0})},l=(t,n,r,a)=>{if(n&&typeof n=="object"||typeof n=="function")for(let o of u(n))!p.call(t,o)&&o!==r&&e(t,o,{get:()=>n[o],enumerable:!(a=w(n,o))||a.enumerable});return t};var c=t=>l(e({},"__esModule",{value:!0}),t);var A={};g(A,{isAndroid:()=>v,isIOS:()=>P,isIPad:()=>f,isIPhone:()=>d,isMac:()=>i});module.exports=c(A);function x(t){return typeof window<"u"&&window.navigator!=null?t.test(window.navigator.platform):!1}var i=()=>x(/^Mac/i);function m(t){return typeof window>"u"||window.navigator==null?!1:window.navigator.userAgentData?.brands.some(n=>t.test(n.brand))||t.test(window.navigator.userAgent)}var v=()=>m(/Android/i);function s(t){return typeof window<"u"&&window.navigator!=null?t.test(window.navigator.platform):!1}var d=()=>s(/^iPhone/i),f=()=>s(/^iPad/i)||i()&&navigator.maxTouchPoints>1,P=()=>d()||f();0&&(module.exports={isAndroid,isIOS,isIPad,isIPhone,isMac});
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/isMac.ts","../src/isAndroid.ts"],"sourcesContent":["/**\n * Copyright (c) Corinvo, LLC. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n// This is
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/isMac.ts","../src/isAndroid.ts","../src/isIOS.ts"],"sourcesContent":["/**\n * Copyright (c) Corinvo, LLC. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n// WARNING: This code is not recommended for use.\n// It contains significant issues and may lead to unexpected behavior.\n// Please avoid using or referencing this implementation.\n\nexport * from './isMac';\nexport * from './isAndroid';\nexport * from './isIOS';\n","/**\n * Copyright (c) Corinvo, LLC. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n// WARNING: This code is not recommended for use.\n// It contains significant issues and may lead to unexpected behavior.\n// Please avoid using or referencing this implementation.\n\nfunction testPlatform(re: RegExp) {\n return typeof window !== 'undefined' && window.navigator != null\n ? //@ts-ignore\n re.test(window.navigator.platform)\n : false;\n}\n\nexport const isMac = () => testPlatform(/^Mac/i);\n","// WARNING: This code is not recommended for use.\n// It contains significant issues and may lead to unexpected behavior.\n// Please avoid using or referencing this implementation.\n\nfunction testUserAgent(re: RegExp) {\n if (typeof window === 'undefined' || window.navigator == null) {\n return false;\n }\n return (\n //@ts-ignore\n window.navigator.userAgentData?.brands.some(\n (brand: { brand: string; version: string }) => re.test(brand.brand)\n ) || re.test(window.navigator.userAgent)\n );\n}\n\nexport const isAndroid = () => testUserAgent(/Android/i);\n","// WARNING: This code is not recommended for use.\n// It contains significant issues and may lead to unexpected behavior.\n// Please avoid using or referencing this implementation.\n\nimport { isMac } from './isMac';\n\nfunction testPlatform(re: RegExp) {\n return typeof window !== 'undefined' && window.navigator != null\n ? //@ts-ignore\n re.test(window.navigator.platform)\n : false;\n}\n\nexport const isIPhone = () => {\n return testPlatform(/^iPhone/i);\n};\n\nexport const isIPad = () => {\n return (\n testPlatform(/^iPad/i) ||\n // iPadOS 13 lies and says it's a Mac, but we can distinguish by detecting touch support.\n (isMac() && navigator.maxTouchPoints > 1)\n );\n};\n\nexport const isIOS = () => {\n return isIPhone() || isIPad();\n};\n"],"mappings":"yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,eAAAE,EAAA,UAAAC,EAAA,WAAAC,EAAA,aAAAC,EAAA,UAAAC,IAAA,eAAAC,EAAAP,GCYA,SAASQ,EAAaC,EAAY,CAChC,OAAO,OAAO,OAAW,KAAe,OAAO,WAAa,KAExDA,EAAG,KAAK,OAAO,UAAU,QAAQ,EACjC,EACN,CAEO,IAAMC,EAAQ,IAAMF,EAAa,OAAO,ECf/C,SAASG,EAAcC,EAAY,CACjC,OAAI,OAAO,OAAW,KAAe,OAAO,WAAa,KAChD,GAIP,OAAO,UAAU,eAAe,OAAO,KACpCC,GAA8CD,EAAG,KAAKC,EAAM,KAAK,CACpE,GAAKD,EAAG,KAAK,OAAO,UAAU,SAAS,CAE3C,CAEO,IAAME,EAAY,IAAMH,EAAc,UAAU,ECVvD,SAASI,EAAaC,EAAY,CAChC,OAAO,OAAO,OAAW,KAAe,OAAO,WAAa,KAExDA,EAAG,KAAK,OAAO,UAAU,QAAQ,EACjC,EACN,CAEO,IAAMC,EAAW,IACfF,EAAa,UAAU,EAGnBG,EAAS,IAElBH,EAAa,QAAQ,GAEpBI,EAAM,GAAK,UAAU,eAAiB,EAI9BC,EAAQ,IACZH,EAAS,GAAKC,EAAO","names":["index_exports","__export","isAndroid","isIOS","isIPad","isIPhone","isMac","__toCommonJS","testPlatform","re","isMac","testUserAgent","re","brand","isAndroid","testPlatform","re","isIPhone","isIPad","isMac","isIOS"]}
|
package/dist/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
function
|
|
1
|
+
function e(t){return typeof window<"u"&&window.navigator!=null?t.test(window.navigator.platform):!1}var n=()=>e(/^Mac/i);function i(t){return typeof window>"u"||window.navigator==null?!1:window.navigator.userAgentData?.brands.some(r=>t.test(r.brand))||t.test(window.navigator.userAgent)}var f=()=>i(/Android/i);function o(t){return typeof window<"u"&&window.navigator!=null?t.test(window.navigator.platform):!1}var a=()=>o(/^iPhone/i),s=()=>o(/^iPad/i)||n()&&navigator.maxTouchPoints>1,p=()=>a()||s();export{f as isAndroid,p as isIOS,s as isIPad,a as isIPhone,n as isMac};
|
|
2
2
|
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/isMac.ts","../src/isAndroid.ts"],"sourcesContent":["/**\n * Copyright (c) Corinvo, LLC. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nfunction testPlatform(re: RegExp) {\n return typeof window !== 'undefined' && window.navigator != null\n //@ts-ignore\n
|
|
1
|
+
{"version":3,"sources":["../src/isMac.ts","../src/isAndroid.ts","../src/isIOS.ts"],"sourcesContent":["/**\n * Copyright (c) Corinvo, LLC. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n// WARNING: This code is not recommended for use.\n// It contains significant issues and may lead to unexpected behavior.\n// Please avoid using or referencing this implementation.\n\nfunction testPlatform(re: RegExp) {\n return typeof window !== 'undefined' && window.navigator != null\n ? //@ts-ignore\n re.test(window.navigator.platform)\n : false;\n}\n\nexport const isMac = () => testPlatform(/^Mac/i);\n","// WARNING: This code is not recommended for use.\n// It contains significant issues and may lead to unexpected behavior.\n// Please avoid using or referencing this implementation.\n\nfunction testUserAgent(re: RegExp) {\n if (typeof window === 'undefined' || window.navigator == null) {\n return false;\n }\n return (\n //@ts-ignore\n window.navigator.userAgentData?.brands.some(\n (brand: { brand: string; version: string }) => re.test(brand.brand)\n ) || re.test(window.navigator.userAgent)\n );\n}\n\nexport const isAndroid = () => testUserAgent(/Android/i);\n","// WARNING: This code is not recommended for use.\n// It contains significant issues and may lead to unexpected behavior.\n// Please avoid using or referencing this implementation.\n\nimport { isMac } from './isMac';\n\nfunction testPlatform(re: RegExp) {\n return typeof window !== 'undefined' && window.navigator != null\n ? //@ts-ignore\n re.test(window.navigator.platform)\n : false;\n}\n\nexport const isIPhone = () => {\n return testPlatform(/^iPhone/i);\n};\n\nexport const isIPad = () => {\n return (\n testPlatform(/^iPad/i) ||\n // iPadOS 13 lies and says it's a Mac, but we can distinguish by detecting touch support.\n (isMac() && navigator.maxTouchPoints > 1)\n );\n};\n\nexport const isIOS = () => {\n return isIPhone() || isIPad();\n};\n"],"mappings":"AAYA,SAASA,EAAaC,EAAY,CAChC,OAAO,OAAO,OAAW,KAAe,OAAO,WAAa,KAExDA,EAAG,KAAK,OAAO,UAAU,QAAQ,EACjC,EACN,CAEO,IAAMC,EAAQ,IAAMF,EAAa,OAAO,ECf/C,SAASG,EAAcC,EAAY,CACjC,OAAI,OAAO,OAAW,KAAe,OAAO,WAAa,KAChD,GAIP,OAAO,UAAU,eAAe,OAAO,KACpCC,GAA8CD,EAAG,KAAKC,EAAM,KAAK,CACpE,GAAKD,EAAG,KAAK,OAAO,UAAU,SAAS,CAE3C,CAEO,IAAME,EAAY,IAAMH,EAAc,UAAU,ECVvD,SAASI,EAAaC,EAAY,CAChC,OAAO,OAAO,OAAW,KAAe,OAAO,WAAa,KAExDA,EAAG,KAAK,OAAO,UAAU,QAAQ,EACjC,EACN,CAEO,IAAMC,EAAW,IACfF,EAAa,UAAU,EAGnBG,EAAS,IAElBH,EAAa,QAAQ,GAEpBI,EAAM,GAAK,UAAU,eAAiB,EAI9BC,EAAQ,IACZH,EAAS,GAAKC,EAAO","names":["testPlatform","re","isMac","testUserAgent","re","brand","isAndroid","testPlatform","re","isIPhone","isIPad","isMac","isIOS"]}
|