@djangocfg/api 2.1.357 → 2.1.359
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/package.json +2 -2
- package/src/lib/env.ts +10 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@djangocfg/api",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.359",
|
|
4
4
|
"description": "Auto-generated TypeScript API client with React hooks, SWR integration, and Zod validation for Django REST Framework backends",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"django",
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
"devDependencies": {
|
|
85
85
|
"@types/node": "^24.7.2",
|
|
86
86
|
"@types/react": "^19.1.0",
|
|
87
|
-
"@djangocfg/typescript-config": "^2.1.
|
|
87
|
+
"@djangocfg/typescript-config": "^2.1.359",
|
|
88
88
|
"next": "^16.2.2",
|
|
89
89
|
"react": "^19.1.0",
|
|
90
90
|
"tsup": "^8.5.0",
|
package/src/lib/env.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Environment constants — shared across all @djangocfg packages.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
export const nodeEnv = process.env.NODE_ENV || 'development';
|
|
6
|
+
export const isDev = nodeEnv === 'development';
|
|
7
|
+
export const isProd = !isDev;
|
|
8
|
+
export const isTest = nodeEnv === 'test';
|
|
9
|
+
export const isBrowser = typeof window !== 'undefined';
|
|
10
|
+
export const isServer = typeof window === 'undefined';
|