Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@platform/util.is

Package Overview
Dependencies
Maintainers
1
Versions
117
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@platform/util.is - npm Package Compare versions

Comparing version 0.0.142 to 0.0.144

lib/is.d.ts

16

lib/index.d.ts

@@ -1,14 +0,2 @@

export declare type IsFlags = {
nodeEnv: 'development' | 'production' | 'browser' | string;
browser: boolean;
dev: boolean;
prod: boolean;
test: boolean;
};
export declare type IsMethods = {
toObject(): IsFlags;
observable(input?: any): boolean;
stream(input?: any): boolean;
};
export declare type Is = IsFlags & IsMethods;
export declare const is: Is;
export * from './is';
export * from './types';
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.is = void 0;
exports.is = {
get nodeEnv() {
return this.browser ? 'browser' : process.env.NODE_ENV || 'development';
},
get browser() {
return typeof window !== 'undefined';
},
get dev() {
var env = this.nodeEnv;
return this.browser
? window && window.location.hostname === 'localhost'
: env !== 'production' && env !== 'prod';
},
get prod() {
return !this.dev;
},
get test() {
return this.nodeEnv === 'test';
},
toObject: function () {
return {
nodeEnv: this.nodeEnv,
browser: this.browser,
dev: this.dev,
prod: this.prod,
test: this.test,
};
},
observable: function (input) {
return typeof (input === null || input === void 0 ? void 0 : input.subscribe) === 'function';
},
stream: function (input) {
return typeof (input === null || input === void 0 ? void 0 : input.on) === 'function';
},
};
var tslib_1 = require("tslib");
tslib_1.__exportStar(require("./is"), exports);
tslib_1.__exportStar(require("./types"), exports);
{
"name": "@platform/util.is",
"version": "0.0.142",
"version": "0.0.144",
"description": "Environment flags.",

@@ -16,4 +16,4 @@ "main": "lib/index",

"devDependencies": {
"@platform/test": "0.2.1",
"@platform/ts": "4.1.3"
"@platform/test": "0.2.2",
"@platform/ts": "4.1.5"
},

@@ -20,0 +20,0 @@ "files": [

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc