@lti-tool/core 1.0.0 → 1.0.1
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/CHANGELOG.md +6 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/utils/environment.d.ts +14 -0
- package/dist/utils/environment.d.ts.map +1 -0
- package/dist/utils/environment.js +30 -0
- package/package.json +1 -1
- package/src/index.ts +1 -0
- package/src/utils/environment.ts +33 -0
package/CHANGELOG.md
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Detects if the application is running in a serverless environment.
|
|
3
|
+
*
|
|
4
|
+
* Checks for environment variables commonly set by serverless platforms:
|
|
5
|
+
* - AWS Lambda: AWS_LAMBDA_FUNCTION_NAME, AWS_EXECUTION_ENV, LAMBDA_TASK_ROOT
|
|
6
|
+
* - Google Cloud Functions/Run: FUNCTION_NAME, FUNCTION_TARGET, K_SERVICE
|
|
7
|
+
* - Azure Functions: FUNCTIONS_WORKER_RUNTIME, AZURE_FUNCTIONS_ENVIRONMENT
|
|
8
|
+
* - Vercel: VERCEL, VERCEL_ENV
|
|
9
|
+
* - Netlify Functions: NETLIFY
|
|
10
|
+
*
|
|
11
|
+
* @returns true if serverless environment detected, false otherwise
|
|
12
|
+
*/
|
|
13
|
+
export declare function isServerlessEnvironment(): boolean;
|
|
14
|
+
//# sourceMappingURL=environment.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"environment.d.ts","sourceRoot":"","sources":["../../src/utils/environment.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,wBAAgB,uBAAuB,IAAI,OAAO,CAoBjD"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Detects if the application is running in a serverless environment.
|
|
3
|
+
*
|
|
4
|
+
* Checks for environment variables commonly set by serverless platforms:
|
|
5
|
+
* - AWS Lambda: AWS_LAMBDA_FUNCTION_NAME, AWS_EXECUTION_ENV, LAMBDA_TASK_ROOT
|
|
6
|
+
* - Google Cloud Functions/Run: FUNCTION_NAME, FUNCTION_TARGET, K_SERVICE
|
|
7
|
+
* - Azure Functions: FUNCTIONS_WORKER_RUNTIME, AZURE_FUNCTIONS_ENVIRONMENT
|
|
8
|
+
* - Vercel: VERCEL, VERCEL_ENV
|
|
9
|
+
* - Netlify Functions: NETLIFY
|
|
10
|
+
*
|
|
11
|
+
* @returns true if serverless environment detected, false otherwise
|
|
12
|
+
*/
|
|
13
|
+
export function isServerlessEnvironment() {
|
|
14
|
+
return !!(
|
|
15
|
+
// AWS Lambda
|
|
16
|
+
(process.env.AWS_LAMBDA_FUNCTION_NAME ||
|
|
17
|
+
process.env.AWS_EXECUTION_ENV ||
|
|
18
|
+
process.env.LAMBDA_TASK_ROOT ||
|
|
19
|
+
// Google Cloud Functions / Cloud Run
|
|
20
|
+
process.env.FUNCTION_NAME ||
|
|
21
|
+
process.env.FUNCTION_TARGET ||
|
|
22
|
+
process.env.K_SERVICE ||
|
|
23
|
+
// Azure Functions
|
|
24
|
+
process.env.FUNCTIONS_WORKER_RUNTIME ||
|
|
25
|
+
process.env.AZURE_FUNCTIONS_ENVIRONMENT ||
|
|
26
|
+
// Vercel
|
|
27
|
+
process.env.VERCEL ||
|
|
28
|
+
// Netlify Functions
|
|
29
|
+
process.env.NETLIFY));
|
|
30
|
+
}
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Detects if the application is running in a serverless environment.
|
|
3
|
+
*
|
|
4
|
+
* Checks for environment variables commonly set by serverless platforms:
|
|
5
|
+
* - AWS Lambda: AWS_LAMBDA_FUNCTION_NAME, AWS_EXECUTION_ENV, LAMBDA_TASK_ROOT
|
|
6
|
+
* - Google Cloud Functions/Run: FUNCTION_NAME, FUNCTION_TARGET, K_SERVICE
|
|
7
|
+
* - Azure Functions: FUNCTIONS_WORKER_RUNTIME, AZURE_FUNCTIONS_ENVIRONMENT
|
|
8
|
+
* - Vercel: VERCEL, VERCEL_ENV
|
|
9
|
+
* - Netlify Functions: NETLIFY
|
|
10
|
+
*
|
|
11
|
+
* @returns true if serverless environment detected, false otherwise
|
|
12
|
+
*/
|
|
13
|
+
export function isServerlessEnvironment(): boolean {
|
|
14
|
+
return !!(
|
|
15
|
+
// AWS Lambda
|
|
16
|
+
(
|
|
17
|
+
process.env.AWS_LAMBDA_FUNCTION_NAME ||
|
|
18
|
+
process.env.AWS_EXECUTION_ENV ||
|
|
19
|
+
process.env.LAMBDA_TASK_ROOT ||
|
|
20
|
+
// Google Cloud Functions / Cloud Run
|
|
21
|
+
process.env.FUNCTION_NAME ||
|
|
22
|
+
process.env.FUNCTION_TARGET ||
|
|
23
|
+
process.env.K_SERVICE ||
|
|
24
|
+
// Azure Functions
|
|
25
|
+
process.env.FUNCTIONS_WORKER_RUNTIME ||
|
|
26
|
+
process.env.AZURE_FUNCTIONS_ENVIRONMENT ||
|
|
27
|
+
// Vercel
|
|
28
|
+
process.env.VERCEL ||
|
|
29
|
+
// Netlify Functions
|
|
30
|
+
process.env.NETLIFY
|
|
31
|
+
)
|
|
32
|
+
);
|
|
33
|
+
}
|