@edgestore/react 0.1.5-alpha.15 → 0.1.5-alpha.17

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/index.js CHANGED
@@ -146,7 +146,7 @@ async function uploadFile({ file, input, onProgressChange, options }, { apiPath,
146
146
  * Since third party cookies doesn't work on localhost,
147
147
  * we need to proxy the file through the server.
148
148
  */ function getUrl(url, apiPath) {
149
- const mode = process !== undefined ? process.env.NODE_ENV : undefined?.DEV ? 'development' : 'production';
149
+ const mode = typeof process !== 'undefined' ? process.env.NODE_ENV : undefined?.DEV ? 'development' : 'production';
150
150
  if (mode === 'development' && !url.includes('/_public/')) {
151
151
  const proxyUrl = new URL(window.location.origin);
152
152
  proxyUrl.pathname = `${apiPath}/proxy-file`;
@@ -312,7 +312,7 @@ async function queuedPromises({ items, fn, maxParallel, maxRetries = 0 }) {
312
312
  return results;
313
313
  }
314
314
 
315
- const DEFAULT_BASE_URL = (process !== undefined ? process.env.NEXT_PUBLIC_EDGE_STORE_BASE_URL : undefined?.EDGE_STORE_BASE_URL) ?? 'https://files.edgestore.dev';
315
+ const DEFAULT_BASE_URL = (typeof process !== 'undefined' ? process.env.NEXT_PUBLIC_EDGE_STORE_BASE_URL : undefined?.EDGE_STORE_BASE_URL) ?? 'https://files.edgestore.dev';
316
316
  function createEdgeStoreProvider(opts) {
317
317
  const EdgeStoreContext = /*#__PURE__*/ React__namespace.createContext(undefined);
318
318
  const EdgeStoreProvider = ({ children, basePath })=>{
package/dist/index.mjs CHANGED
@@ -122,7 +122,7 @@ async function uploadFile({ file, input, onProgressChange, options }, { apiPath,
122
122
  * Since third party cookies doesn't work on localhost,
123
123
  * we need to proxy the file through the server.
124
124
  */ function getUrl(url, apiPath) {
125
- const mode = process !== undefined ? process.env.NODE_ENV : import.meta.env?.DEV ? 'development' : 'production';
125
+ const mode = typeof process !== 'undefined' ? process.env.NODE_ENV : import.meta.env?.DEV ? 'development' : 'production';
126
126
  if (mode === 'development' && !url.includes('/_public/')) {
127
127
  const proxyUrl = new URL(window.location.origin);
128
128
  proxyUrl.pathname = `${apiPath}/proxy-file`;
@@ -288,7 +288,7 @@ async function queuedPromises({ items, fn, maxParallel, maxRetries = 0 }) {
288
288
  return results;
289
289
  }
290
290
 
291
- const DEFAULT_BASE_URL = (process !== undefined ? process.env.NEXT_PUBLIC_EDGE_STORE_BASE_URL : import.meta.env?.EDGE_STORE_BASE_URL) ?? 'https://files.edgestore.dev';
291
+ const DEFAULT_BASE_URL = (typeof process !== 'undefined' ? process.env.NEXT_PUBLIC_EDGE_STORE_BASE_URL : import.meta.env?.EDGE_STORE_BASE_URL) ?? 'https://files.edgestore.dev';
292
292
  function createEdgeStoreProvider(opts) {
293
293
  const EdgeStoreContext = /*#__PURE__*/ React.createContext(undefined);
294
294
  const EdgeStoreProvider = ({ children, basePath })=>{
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edgestore/react",
3
- "version": "0.1.5-alpha.15",
3
+ "version": "0.1.5-alpha.17",
4
4
  "description": "Upload files with ease from React/Next.js",
5
5
  "homepage": "https://edgestore.dev",
6
6
  "repository": "https://github.com/edgestorejs/edgestore.git",
@@ -60,14 +60,14 @@
60
60
  "uuid": "^9.0.0"
61
61
  },
62
62
  "peerDependencies": {
63
- "@edgestore/shared": "0.1.5-alpha.15",
63
+ "@edgestore/shared": "0.1.5-alpha.17",
64
64
  "next": "*",
65
65
  "react": ">=16.8.0",
66
66
  "react-dom": ">=16.8.0",
67
67
  "zod": ">=3.0.0"
68
68
  },
69
69
  "devDependencies": {
70
- "@edgestore/shared": "0.1.5-alpha.15",
70
+ "@edgestore/shared": "0.1.5-alpha.17",
71
71
  "@types/cookie": "^0.5.1",
72
72
  "@types/node": "^18.11.18",
73
73
  "@types/uuid": "^9.0.1",
@@ -77,5 +77,5 @@
77
77
  "typescript": "^5.1.6",
78
78
  "zod": "3.21.4"
79
79
  },
80
- "gitHead": "a223c4cb8df50e6b64f9db5dc2daf93848748da9"
80
+ "gitHead": "66bb835a1e4c211b7c464e29b2c375efd53d07e6"
81
81
  }
@@ -5,7 +5,7 @@ import EdgeStoreClientError from './libs/errors/EdgeStoreClientError';
5
5
  import { handleError } from './libs/errors/handleError';
6
6
 
7
7
  const DEFAULT_BASE_URL =
8
- (process !== undefined
8
+ (typeof process !== 'undefined'
9
9
  ? process.env.NEXT_PUBLIC_EDGE_STORE_BASE_URL
10
10
  : // @ts-expect-error - In Vite, the env variables are available on `import.meta`.
11
11
  import.meta.env?.EDGE_STORE_BASE_URL) ?? 'https://files.edgestore.dev';
@@ -203,7 +203,7 @@ async function uploadFile(
203
203
  */
204
204
  function getUrl(url: string, apiPath: string) {
205
205
  const mode =
206
- process !== undefined
206
+ typeof process !== 'undefined'
207
207
  ? process.env.NODE_ENV
208
208
  : // @ts-expect-error - DEV is injected by Vite
209
209
  import.meta.env?.DEV