@take-out/helpers 0.4.15 → 0.4.16
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/dist/cjs/constants.cjs +8 -8
- package/dist/cjs/constants.native.js +8 -8
- package/dist/cjs/constants.native.js.map +1 -1
- package/dist/cjs/platform.cjs +36 -0
- package/dist/cjs/platform.native.js +40 -0
- package/dist/cjs/platform.native.js.map +1 -0
- package/dist/esm/constants.mjs +2 -2
- package/dist/esm/constants.native.js +2 -2
- package/dist/esm/platform.mjs +7 -0
- package/dist/esm/platform.mjs.map +1 -0
- package/dist/esm/platform.native.js +8 -0
- package/dist/esm/platform.native.js.map +1 -0
- package/package.json +1 -2
- package/src/constants.ts +2 -2
- package/src/platform.native.ts +15 -0
- package/src/platform.ts +14 -0
- package/types/constants.d.ts +1 -1
- package/types/constants.d.ts.map +1 -1
- package/types/platform.d.ts +7 -0
- package/types/platform.d.ts.map +11 -0
- package/types/platform.native.d.ts +7 -0
- package/types/platform.native.d.ts.map +11 -0
package/dist/cjs/constants.cjs
CHANGED
|
@@ -27,19 +27,19 @@ __export(constants_exports, {
|
|
|
27
27
|
EMPTY_OBJECT: () => EMPTY_OBJECT,
|
|
28
28
|
IS_MAC_DESKTOP: () => IS_MAC_DESKTOP,
|
|
29
29
|
IS_SAFARI: () => IS_SAFARI,
|
|
30
|
-
isAndroid: () =>
|
|
31
|
-
isBrowser: () =>
|
|
32
|
-
isIos: () =>
|
|
30
|
+
isAndroid: () => import_platform2.isAndroid,
|
|
31
|
+
isBrowser: () => import_platform2.isBrowser,
|
|
32
|
+
isIos: () => import_platform2.isIos,
|
|
33
33
|
isNative: () => isNative,
|
|
34
|
-
isServer: () =>
|
|
34
|
+
isServer: () => import_platform2.isServer,
|
|
35
35
|
isTauri: () => isTauri,
|
|
36
|
-
isWeb: () =>
|
|
36
|
+
isWeb: () => import_platform2.isWeb
|
|
37
37
|
});
|
|
38
38
|
module.exports = __toCommonJS(constants_exports);
|
|
39
|
-
var
|
|
40
|
-
var
|
|
39
|
+
var import_platform = require("./platform.cjs");
|
|
40
|
+
var import_platform2 = require("./platform.cjs");
|
|
41
41
|
const isTauri = typeof window !== "undefined" && "__TAURI__" in window;
|
|
42
|
-
const isNative = !
|
|
42
|
+
const isNative = !import_platform.isWeb && !isTauri;
|
|
43
43
|
const IS_MAC_DESKTOP = typeof navigator !== "undefined" && /Macintosh|MacIntel/.test(navigator.platform);
|
|
44
44
|
const IS_SAFARI = isTauri || typeof navigator !== "undefined" && /Version\/[\d.]+.*Safari/.test(navigator.userAgent) && typeof navigator.vendor === "string" && navigator.vendor.includes("Apple Computer");
|
|
45
45
|
const EMPTY_ARRAY = [];
|
|
@@ -29,19 +29,19 @@ __export(constants_exports, {
|
|
|
29
29
|
EMPTY_OBJECT: () => EMPTY_OBJECT,
|
|
30
30
|
IS_MAC_DESKTOP: () => IS_MAC_DESKTOP,
|
|
31
31
|
IS_SAFARI: () => IS_SAFARI,
|
|
32
|
-
isAndroid: () =>
|
|
33
|
-
isBrowser: () =>
|
|
34
|
-
isIos: () =>
|
|
32
|
+
isAndroid: () => import_platform2.isAndroid,
|
|
33
|
+
isBrowser: () => import_platform2.isBrowser,
|
|
34
|
+
isIos: () => import_platform2.isIos,
|
|
35
35
|
isNative: () => isNative,
|
|
36
|
-
isServer: () =>
|
|
36
|
+
isServer: () => import_platform2.isServer,
|
|
37
37
|
isTauri: () => isTauri,
|
|
38
|
-
isWeb: () =>
|
|
38
|
+
isWeb: () => import_platform2.isWeb
|
|
39
39
|
});
|
|
40
40
|
module.exports = __toCommonJS(constants_exports);
|
|
41
|
-
var
|
|
42
|
-
var
|
|
41
|
+
var import_platform = require("./platform.native.js");
|
|
42
|
+
var import_platform2 = require("./platform.native.js");
|
|
43
43
|
var isTauri = typeof window !== "undefined" && "__TAURI__" in window;
|
|
44
|
-
var isNative = !
|
|
44
|
+
var isNative = !import_platform.isWeb && !isTauri;
|
|
45
45
|
var IS_MAC_DESKTOP = typeof navigator !== "undefined" && /Macintosh|MacIntel/.test(navigator.platform);
|
|
46
46
|
var IS_SAFARI = isTauri || typeof navigator !== "undefined" && /Version\/[\d.]+.*Safari/.test(navigator.userAgent) && typeof navigator.vendor === "string" && navigator.vendor.includes("Apple Computer");
|
|
47
47
|
var EMPTY_ARRAY = [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","constants_exports","__export","DEBUG_LEVEL","EMPTY_ARRAY","EMPTY_OBJECT","IS_MAC_DESKTOP","IS_SAFARI","isAndroid","
|
|
1
|
+
{"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","constants_exports","__export","DEBUG_LEVEL","EMPTY_ARRAY","EMPTY_OBJECT","IS_MAC_DESKTOP","IS_SAFARI","isAndroid","import_platform2","isBrowser","isIos","isNative","isServer","isTauri","isWeb","module","exports","import_platform","require","window","navigator","test","platform","userAgent","vendor","includes","getDebugLevelFromUrl","_window_location_search","_window_location","match","location","search","parseInt"],"sources":["../../src/constants.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,iBAAA;AAAAC,QAAA,CAAAD,iBAAA;EAAAE,WAAA,EAAAA,CAAA,KAAAA,WAAA;EAAAC,WAAA,EAAAA,CAAA,KAAAA,WAAA;EAAAC,YAAA,EAAAA,CAAA,KAAAA,YAAA;EAAAC,cAAA,EAAAA,CAAA,KAAAA,cAAA;EAAAC,SAAA,EAAAA,CAAA,KAAAA,SAAA;EAAAC,SAAA,EAAAA,CAAA,KAAAC,gBAAA,CAAAD,SAAA;EAAAE,SAAA,EAAAA,CAAA,KAAAD,gBAAA,CAAAC,SAAA;EAAAC,KAAA,EAAAA,CAAA,KAAAF,gBAAA,CAAAE,KAAA;EAAAC,QAAA,EAAAA,CAAA,KAAAA,QAAA;EAAAC,QAAA,EAAAA,CAAA,KAAAJ,gBAAA,CAAAI,QAAA;EAAAC,OAAA,EAAAA,CAAA,KAAAA,OAAA;EAAAC,KAAA,EAAAA,CAAA,KAAAN,gBAAA,CAAAM;AAAA;AAAAC,MAAA,CAAAC,OAAA,GAAArB,YAAsB,CAAAK,iBAAA;AAkBtB,IAAAiB,eAAA,GAAAC,OAA6D;AAhBtD,IAAAV,gBAAyB,GAAOU,OAAA,uBAAW;AAE3C,IAAAL,OAAM,UAAqBM,MAAA,gBAAS,IAAC,eAAAA,MAAA;AAIrC,IAAAR,QAAM,IAAAM,eACJ,CAAAH,KAAA,KAAAD,OAAc;AAEhB,IAAAR,cACL,UAAAe,SACQ,gBAAc,wBACpB,CAAAC,IAAA,CAAAD,SAA0B,CAAAE,QAAK;AAM5B,IAAAhB,SAAM,GAAAO,OAAe,WAAAO,SAAA,8CAAAC,IAAA,CAAAD,SAAA,CAAAG,SAAA,YAAAH,SAAA,CAAAI,MAAA,iBAAAJ,SAAA,CAAAI,MAAA,CAAAC,QAAA;AACrB,IAAAtB,WAAM;AAEb,IAAAC,YAAM;AACJ,IAAAsB,oBAAsB,YAAAA,CAAA,EAAa;EACnC,IAAAC,uBAAqB,EAAAC,gBAAwB;EAC7C,WAAOT,MAAS,KAAI,WAAS,EAAM,OAAM,IAAI;EAC/C,IAAAU,KAAA,IAAAD,gBAAA,GAAAT,MAAA,CAAAW,QAAA,cAAAF,gBAAA,wBAAAD,uBAAA,GAAAC,gBAAA,CAAAG,MAAA,cAAAJ,uBAAA,uBAAAA,uBAAA,CAAAE,KAAA;EAEO,OAAM,CAAAA,KAAA,KAAsB,QAAQA,KAAI,cAC1C,SAAQA,KAAI,OAAAG,QACZ,CAAAH,KAAA,eAAqB","ignoreList":[]}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all) __defProp(target, name, {
|
|
7
|
+
get: all[name],
|
|
8
|
+
enumerable: true
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
14
|
+
get: () => from[key],
|
|
15
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
21
|
+
value: true
|
|
22
|
+
}), mod);
|
|
23
|
+
var platform_exports = {};
|
|
24
|
+
__export(platform_exports, {
|
|
25
|
+
isAndroid: () => isAndroid,
|
|
26
|
+
isBrowser: () => isBrowser,
|
|
27
|
+
isIos: () => isIos,
|
|
28
|
+
isServer: () => isServer,
|
|
29
|
+
isWeb: () => isWeb
|
|
30
|
+
});
|
|
31
|
+
module.exports = __toCommonJS(platform_exports);
|
|
32
|
+
const isWeb = true;
|
|
33
|
+
const isBrowser = typeof navigator !== "undefined" && typeof location !== "undefined";
|
|
34
|
+
const isServer = !isBrowser;
|
|
35
|
+
const isAndroid = false;
|
|
36
|
+
const isIos = false;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all) __defProp(target, name, {
|
|
9
|
+
get: all[name],
|
|
10
|
+
enumerable: true
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
16
|
+
get: () => from[key],
|
|
17
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
22
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
23
|
+
value: true
|
|
24
|
+
}), mod);
|
|
25
|
+
var platform_native_exports = {};
|
|
26
|
+
__export(platform_native_exports, {
|
|
27
|
+
isAndroid: () => isAndroid,
|
|
28
|
+
isBrowser: () => isBrowser,
|
|
29
|
+
isIos: () => isIos,
|
|
30
|
+
isServer: () => isServer,
|
|
31
|
+
isWeb: () => isWeb
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(platform_native_exports);
|
|
34
|
+
var import_react_native = require("react-native");
|
|
35
|
+
var isWeb = false;
|
|
36
|
+
var isBrowser = false;
|
|
37
|
+
var isServer = false;
|
|
38
|
+
var isAndroid = (import_react_native.Platform === null || import_react_native.Platform === void 0 ? void 0 : import_react_native.Platform.OS) === "android";
|
|
39
|
+
var isIos = (import_react_native.Platform === null || import_react_native.Platform === void 0 ? void 0 : import_react_native.Platform.OS) === "ios";
|
|
40
|
+
//# sourceMappingURL=platform.native.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["platform_native_exports","__export","isAndroid","isBrowser","isIos","isServer","isWeb","module","exports","__toCommonJS","import_react_native","require","Platform","OS"],"sources":["../../src/platform.native.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,uBAAA;AAAAC,QAAA,CAAAD,uBAAA;EAAAE,SAAA,EAAAA,CAAA,KAAAA,SAAA;EAAAC,SAAA,EAAAA,CAAA,KAAAA,SAAA;EAAAC,KAAA,EAAAA,CAAA,KAAAA,KAAA;EAAAC,QAAA,EAAAA,CAAA,KAAAA,QAAA;EAAAC,KAAA,EAAAA,CAAA,KAAAA;AAAA;AAAAC,MAAA,CAAAC,OAAA,GAAAC,YAAA,CAAAT,uBAAA;AAGA,IAAAU,mBAAA,GAAyBC,OAAA;AAClB,IAAIL,KAAA,GAAQ;AACZ,IAAIH,SAAA,GAAY;AAChB,IAAIE,QAAA,GAAW;AACf,IAAIH,SAAA,IAAaQ,mBAAA,CAAAE,QAAA,KAAa,QAAQF,mBAAA,CAAAE,QAAA,KAAa,SAAS,SAASF,mBAAA,CAAAE,QAAA,CAASC,EAAA,MAAQ;AACtF,IAAIT,KAAA,IAASM,mBAAA,CAAAE,QAAA,KAAa,QAAQF,mBAAA,CAAAE,QAAA,KAAa,SAAS,SAASF,mBAAA,CAAAE,QAAA,CAASC,EAAA,MAAQ","ignoreList":[]}
|
package/dist/esm/constants.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { isWeb } from "
|
|
2
|
-
import { isAndroid, isBrowser, isIos, isServer, isWeb as isWeb2 } from "
|
|
1
|
+
import { isWeb } from "./platform.mjs";
|
|
2
|
+
import { isAndroid, isBrowser, isIos, isServer, isWeb as isWeb2 } from "./platform.mjs";
|
|
3
3
|
const isTauri = typeof window !== "undefined" && "__TAURI__" in window;
|
|
4
4
|
const isNative = !isWeb && !isTauri;
|
|
5
5
|
const IS_MAC_DESKTOP = typeof navigator !== "undefined" && /Macintosh|MacIntel/.test(navigator.platform);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { isWeb } from "
|
|
2
|
-
import { isAndroid, isBrowser, isIos, isServer, isWeb as isWeb2 } from "
|
|
1
|
+
import { isWeb } from "./platform.native.js";
|
|
2
|
+
import { isAndroid, isBrowser, isIos, isServer, isWeb as isWeb2 } from "./platform.native.js";
|
|
3
3
|
var isTauri = typeof window !== "undefined" && "__TAURI__" in window;
|
|
4
4
|
var isNative = !isWeb && !isTauri;
|
|
5
5
|
var IS_MAC_DESKTOP = typeof navigator !== "undefined" && /Macintosh|MacIntel/.test(navigator.platform);
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
const isWeb = true;
|
|
2
|
+
const isBrowser = typeof navigator !== "undefined" && typeof location !== "undefined";
|
|
3
|
+
const isServer = !isBrowser;
|
|
4
|
+
const isAndroid = false;
|
|
5
|
+
const isIos = false;
|
|
6
|
+
export { isAndroid, isBrowser, isIos, isServer, isWeb };
|
|
7
|
+
//# sourceMappingURL=platform.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["isWeb","isBrowser","navigator","location","isServer","isAndroid","isIos"],"sources":["../../src/platform.ts"],"sourcesContent":[null],"mappings":"AAIO,MAAMA,KAAA,GAAiB;AAEvB,MAAMC,SAAA,GACX,OAAOC,SAAA,KAAc,eAAe,OAAOC,QAAA,KAAa;AAEnD,MAAMC,QAAA,GAAoB,CAACH,SAAA;AAE3B,MAAMI,SAAA,GAAqB;AAE3B,MAAMC,KAAA,GAAiB","ignoreList":[]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Platform } from "react-native";
|
|
2
|
+
var isWeb = false;
|
|
3
|
+
var isBrowser = false;
|
|
4
|
+
var isServer = false;
|
|
5
|
+
var isAndroid = (Platform === null || Platform === void 0 ? void 0 : Platform.OS) === "android";
|
|
6
|
+
var isIos = (Platform === null || Platform === void 0 ? void 0 : Platform.OS) === "ios";
|
|
7
|
+
export { isAndroid, isBrowser, isIos, isServer, isWeb };
|
|
8
|
+
//# sourceMappingURL=platform.native.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Platform","isWeb","isBrowser","isServer","isAndroid","OS","isIos"],"sources":["../../src/platform.native.ts"],"sourcesContent":[null],"mappings":"AAGA,SAASA,QAAA,QAAgB;AAClB,IAAIC,KAAA,GAAQ;AACZ,IAAIC,SAAA,GAAY;AAChB,IAAIC,QAAA,GAAW;AACf,IAAIC,SAAA,IAAaJ,QAAA,KAAa,QAAQA,QAAA,KAAa,SAAS,SAASA,QAAA,CAASK,EAAA,MAAQ;AACtF,IAAIC,KAAA,IAASN,QAAA,KAAa,QAAQA,QAAA,KAAa,SAAS,SAASA,QAAA,CAASK,EAAA,MAAQ","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@take-out/helpers",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.16",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"source": "src/index.ts",
|
|
@@ -46,7 +46,6 @@
|
|
|
46
46
|
}
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@tamagui/constants": "2.0.0-rc.42",
|
|
50
49
|
"dequal": "^2.0.3"
|
|
51
50
|
},
|
|
52
51
|
"peerDependencies": {
|
package/src/constants.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isWeb } from '
|
|
1
|
+
import { isWeb } from './platform'
|
|
2
2
|
|
|
3
3
|
export const isTauri: boolean = typeof window !== 'undefined' && '__TAURI__' in window
|
|
4
4
|
|
|
@@ -16,7 +16,7 @@ export const IS_SAFARI: boolean =
|
|
|
16
16
|
typeof navigator.vendor === 'string' &&
|
|
17
17
|
navigator.vendor.includes('Apple Computer'))
|
|
18
18
|
|
|
19
|
-
export { isAndroid, isBrowser, isIos, isServer, isWeb } from '
|
|
19
|
+
export { isAndroid, isBrowser, isIos, isServer, isWeb } from './platform'
|
|
20
20
|
|
|
21
21
|
export const EMPTY_ARRAY = [] as never
|
|
22
22
|
export const EMPTY_OBJECT = {} as never
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// platform booleans, react-native variant.
|
|
2
|
+
// react-native is an optional peer dep and is always present in the native runtime
|
|
3
|
+
// where this file is loaded, so importing it here is safe.
|
|
4
|
+
|
|
5
|
+
import { Platform } from 'react-native'
|
|
6
|
+
|
|
7
|
+
export const isWeb: boolean = false
|
|
8
|
+
|
|
9
|
+
export const isBrowser: boolean = false
|
|
10
|
+
|
|
11
|
+
export const isServer: boolean = false
|
|
12
|
+
|
|
13
|
+
export const isAndroid: boolean = Platform?.OS === 'android'
|
|
14
|
+
|
|
15
|
+
export const isIos: boolean = Platform?.OS === 'ios'
|
package/src/platform.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// platform booleans, web/default variant.
|
|
2
|
+
// re-implemented locally so @take-out/helpers carries no @tamagui/* runtime dep.
|
|
3
|
+
// the native values live in platform.native.ts (resolved by metro / the react-native export condition).
|
|
4
|
+
|
|
5
|
+
export const isWeb: boolean = true
|
|
6
|
+
|
|
7
|
+
export const isBrowser: boolean =
|
|
8
|
+
typeof navigator !== 'undefined' && typeof location !== 'undefined'
|
|
9
|
+
|
|
10
|
+
export const isServer: boolean = !isBrowser
|
|
11
|
+
|
|
12
|
+
export const isAndroid: boolean = false
|
|
13
|
+
|
|
14
|
+
export const isIos: boolean = false
|
package/types/constants.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ export declare const isTauri: boolean;
|
|
|
2
2
|
export declare const isNative: boolean;
|
|
3
3
|
export declare const IS_MAC_DESKTOP: boolean;
|
|
4
4
|
export declare const IS_SAFARI: boolean;
|
|
5
|
-
export { isAndroid, isBrowser, isIos, isServer, isWeb } from "
|
|
5
|
+
export { isAndroid, isBrowser, isIos, isServer, isWeb } from "./platform";
|
|
6
6
|
export declare const EMPTY_ARRAY: never;
|
|
7
7
|
export declare const EMPTY_OBJECT: never;
|
|
8
8
|
export declare const DEBUG_LEVEL: number;
|
package/types/constants.d.ts.map
CHANGED
|
@@ -6,6 +6,6 @@
|
|
|
6
6
|
],
|
|
7
7
|
"version": 3,
|
|
8
8
|
"sourcesContent": [
|
|
9
|
-
"import { isWeb } from '
|
|
9
|
+
"import { isWeb } from './platform'\n\nexport const isTauri: boolean = typeof window !== 'undefined' && '__TAURI__' in window\n\nexport const isNative: boolean = !isWeb && !isTauri\n\n// TODO move to probably ~/interface/constants\n\nexport const IS_MAC_DESKTOP: boolean =\n typeof navigator !== 'undefined' && /Macintosh|MacIntel/.test(navigator.platform)\n\nexport const IS_SAFARI: boolean =\n isTauri ||\n (typeof navigator !== 'undefined' &&\n /Version\\/[\\d.]+.*Safari/.test(navigator.userAgent) &&\n typeof navigator.vendor === 'string' &&\n navigator.vendor.includes('Apple Computer'))\n\nexport { isAndroid, isBrowser, isIos, isServer, isWeb } from './platform'\n\nexport const EMPTY_ARRAY = [] as never\nexport const EMPTY_OBJECT = {} as never\n\nconst getDebugLevelFromUrl = (): number | null => {\n if (typeof window === 'undefined') return null\n const match = window.location?.search?.match(/debug=(\\d+)/)\n return match?.[1] ? parseInt(match[1], 10) : null\n}\n\nexport const DEBUG_LEVEL: number = process.env.DEBUG_LEVEL\n ? +process.env.DEBUG_LEVEL\n : (getDebugLevelFromUrl() ?? (process.env.NODE_ENV === 'development' ? 1 : 0))\n"
|
|
10
10
|
]
|
|
11
11
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"mappings": "AAIA,OAAO,cAAM;AAEb,OAAO,cAAM;AAGb,OAAO,cAAM;AAEb,OAAO,cAAM;AAEb,OAAO,cAAM",
|
|
3
|
+
"names": [],
|
|
4
|
+
"sources": [
|
|
5
|
+
"src/platform.ts"
|
|
6
|
+
],
|
|
7
|
+
"version": 3,
|
|
8
|
+
"sourcesContent": [
|
|
9
|
+
"// platform booleans, web/default variant.\n// re-implemented locally so @take-out/helpers carries no @tamagui/* runtime dep.\n// the native values live in platform.native.ts (resolved by metro / the react-native export condition).\n\nexport const isWeb: boolean = true\n\nexport const isBrowser: boolean =\n typeof navigator !== 'undefined' && typeof location !== 'undefined'\n\nexport const isServer: boolean = !isBrowser\n\nexport const isAndroid: boolean = false\n\nexport const isIos: boolean = false\n"
|
|
10
|
+
]
|
|
11
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"mappings": "AAMA,OAAO,cAAM;AAEb,OAAO,cAAM;AAEb,OAAO,cAAM;AAEb,OAAO,cAAM;AAEb,OAAO,cAAM",
|
|
3
|
+
"names": [],
|
|
4
|
+
"sources": [
|
|
5
|
+
"src/platform.native.ts"
|
|
6
|
+
],
|
|
7
|
+
"version": 3,
|
|
8
|
+
"sourcesContent": [
|
|
9
|
+
"// platform booleans, react-native variant.\n// react-native is an optional peer dep and is always present in the native runtime\n// where this file is loaded, so importing it here is safe.\n\nimport { Platform } from 'react-native'\n\nexport const isWeb: boolean = false\n\nexport const isBrowser: boolean = false\n\nexport const isServer: boolean = false\n\nexport const isAndroid: boolean = Platform?.OS === 'android'\n\nexport const isIos: boolean = Platform?.OS === 'ios'\n"
|
|
10
|
+
]
|
|
11
|
+
}
|