diff --git a/package-lock.json b/package-lock.json index 7eae4f6..ab025a6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@athenna/common", - "version": "5.25.0", + "version": "5.26.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@athenna/common", - "version": "5.25.0", + "version": "5.26.0", "license": "MIT", "dependencies": { "@fastify/formbody": "^8.0.2", diff --git a/package.json b/package.json index 26ba27d..7c8bd09 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@athenna/common", - "version": "5.25.0", + "version": "5.26.0", "description": "The Athenna common helpers to use in any Node.js ESM project.", "license": "MIT", "author": "João Lenon ", diff --git a/src/helpers/Is.ts b/src/helpers/Is.ts index eb22659..f3994b1 100644 --- a/src/helpers/Is.ts +++ b/src/helpers/Is.ts @@ -38,6 +38,22 @@ export class Is extends Macroable { return kind } + /** + * Verify if the current runtime is Node. + */ + public static Node(): boolean { + return typeof process !== 'undefined' && process.versions?.node !== null + } + + /** + * Verify if the current runtime is Deno. + */ + public static Deno(): boolean { + // eslint-disable-next-line + // @ts-ignore + return typeof Deno !== 'undefined' && Deno.version !== null + } + /** * Verify if the current platform is Linux. */