Skip to content

Commit c4252bf

Browse files
committed
fix: Environment handling
1 parent 9d806ab commit c4252bf

3 files changed

Lines changed: 3 additions & 5 deletions

File tree

templates/api.ejs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ type FetchKeysArray<ResponseModel> = ResponseModel extends (infer DataModel)[]
193193
}
194194

195195
function getFetchKeysFromArray(paths: string[]) {
196-
if (typeof process !== 'undefined' && process.env.NODE_ENV !== 'production')
196+
if (process.env.NODE_ENV !== 'production')
197197
validateArrayFetchKeys(paths)
198198
const fetchKeys: FetchKeysType = {}
199199
for (const path of paths) {

test/__generated-api.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1827,8 +1827,7 @@ export function validateArrayFetchKeys(paths: string[]) {
18271827
}
18281828

18291829
function getFetchKeysFromArray(paths: string[]) {
1830-
if (typeof process !== 'undefined' && process.env.NODE_ENV !== 'production')
1831-
validateArrayFetchKeys(paths)
1830+
if (process.env.NODE_ENV !== 'production') validateArrayFetchKeys(paths)
18321831
const fetchKeys: FetchKeysType = {}
18331832
for (const path of paths) {
18341833
let currentObject = fetchKeys

test/__snapshots__/index.test.ts.snap

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1830,8 +1830,7 @@ export function validateArrayFetchKeys(paths: string[]) {
18301830
}
18311831
18321832
function getFetchKeysFromArray(paths: string[]) {
1833-
if (typeof process !== 'undefined' && process.env.NODE_ENV !== 'production')
1834-
validateArrayFetchKeys(paths)
1833+
if (process.env.NODE_ENV !== 'production') validateArrayFetchKeys(paths)
18351834
const fetchKeys: FetchKeysType = {}
18361835
for (const path of paths) {
18371836
let currentObject = fetchKeys

0 commit comments

Comments
 (0)