Socket
Socket
Sign inDemoInstall

globo

Package Overview
Dependencies
4
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.1 to 1.0.2

22

index.js
'use strict'
var printf = require('pff')
var ternary = require('ternary')
var isDefined = require('is-defined')
var access = require('accessory')
module.exports = function globalize (id) {
var hasWindow = 'typeof window !== "undefined"'
var hasGlobal = 'typeof global !== "undefined"'
return printf('(%s ? window[\'%s\'] : %s ? global[\'%s\'] : null)', hasWindow, id, hasGlobal, id)
module.exports = function globalize (property) {
return parenthesize(ternary(
isDefined('window'),
access('window', property),
ternary(
isDefined('global'),
access('global', property),
null
)
))
}
function parenthesize (string) {
return '(' + string + ')'
}
{
"name": "globo",
"main": "index.js",
"version": "1.0.1",
"description": "Turn module ids into global lookups that work in Node and the browser",
"version": "1.0.2",
"description": "Turn identifiers into global lookups that work in Node and the browser",
"license": "MIT",

@@ -27,3 +27,5 @@ "repository": "bendrucker/globo",

"dependencies": {
"pff": "~1.0.0"
"accessory": "~1.0.0",
"is-defined": "~1.0.0",
"ternary": "~1.0.0"
},

@@ -30,0 +32,0 @@ "devDependencies": {

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc