Socket
Socket
Sign inDemoInstall

metal

Package Overview
Dependencies
Maintainers
3
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

metal - npm Package Compare versions

Comparing version 2.5.17 to 2.5.18

lib/globals/globals.js

18

lib/async/async.js

@@ -14,2 +14,8 @@ /*!

var _globals = require('../globals/globals');
var _globals2 = _interopRequireDefault(_globals);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var async = {};

@@ -157,10 +163,10 @@

// synchronous postMessage implementation.
if (typeof Channel === 'undefined' && typeof window !== 'undefined' && window.postMessage && window.addEventListener) {
if (typeof Channel === 'undefined' && typeof _globals2.default.window !== 'undefined' && _globals2.default.window.postMessage && _globals2.default.window.addEventListener) {
/** @constructor */
Channel = function Channel() {
// Make an empty, invisible iframe.
var iframe = document.createElement('iframe');
var iframe = _globals2.default.document.createElement('iframe');
iframe.style.display = 'none';
iframe.src = '';
document.documentElement.appendChild(iframe);
_globals2.default.document.documentElement.appendChild(iframe);
var win = iframe.contentWindow;

@@ -217,5 +223,5 @@ var doc = win.document;

// onreadystatechange event when inserted into the DOM.
if (typeof document !== 'undefined' && 'onreadystatechange' in document.createElement('script')) {
if (typeof _globals2.default.document !== 'undefined' && 'onreadystatechange' in _globals2.default.document.createElement('script')) {
return function (cb) {
var script = document.createElement('script');
var script = _globals2.default.document.createElement('script');
script.onreadystatechange = function () {

@@ -229,3 +235,3 @@ // Clean up and call the callback.

};
document.documentElement.appendChild(script);
_globals2.default.document.documentElement.appendChild(script);
};

@@ -232,0 +238,0 @@ }

'use strict';
/**
* A collection of core utility functions.
* @const
*/
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.UID_PROPERTY = undefined;

@@ -35,2 +31,14 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };

exports.nullFunction = nullFunction;
var _globals = require('./globals/globals');
var _globals2 = _interopRequireDefault(_globals);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* A collection of core utility functions.
* @const
*/
var compatibilityModeData_ = void 0;

@@ -103,4 +111,4 @@

if (compatibilityModeData_ === undefined) {
if (typeof window !== 'undefined' && window.__METAL_COMPATIBILITY__) {
enableCompatibilityMode(window.__METAL_COMPATIBILITY__);
if (typeof _globals2.default.window !== 'undefined' && _globals2.default.window.__METAL_COMPATIBILITY__) {
enableCompatibilityMode(_globals2.default.window.__METAL_COMPATIBILITY__);
}

@@ -107,0 +115,0 @@ }

@@ -6,3 +6,3 @@ 'use strict';

});
exports.string = exports.object = exports.Disposable = exports.async = exports.array = undefined;
exports.string = exports.object = exports.globals = exports.Disposable = exports.async = exports.array = undefined;

@@ -35,2 +35,6 @@ var _core = require('./core');

var _globals = require('./globals/globals');
var _globals2 = _interopRequireDefault(_globals);
var _object = require('./object/object');

@@ -49,4 +53,5 @@

exports.Disposable = _Disposable2.default;
exports.globals = _globals2.default;
exports.object = _object2.default;
exports.string = _string2.default;
exports.default = _core2.default;

@@ -9,2 +9,8 @@ 'use strict';

var _globals = require('../globals/globals');
var _globals2 = _interopRequireDefault(_globals);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

@@ -49,3 +55,3 @@

value: function getObjectByName(name, opt_obj) {
var scope = opt_obj || window;
var scope = opt_obj || _globals2.default.window;
var parts = name.split('.');

@@ -52,0 +58,0 @@ return parts.reduce(function (part, key) {

{
"name": "metal",
"version": "2.5.17",
"version": "2.5.18",
"description": "Core functions from Metal.js, with utilities for dealing with arrays, objects and others.",

@@ -5,0 +5,0 @@ "license": "BSD-3-Clause",

@@ -8,2 +8,4 @@ /*!

import globals from "../globals/globals";
const async = {};

@@ -160,11 +162,11 @@

// synchronous postMessage implementation.
if (typeof Channel === 'undefined' && typeof window !== 'undefined' &&
window.postMessage && window.addEventListener) {
if (typeof Channel === 'undefined' && typeof globals.window !== 'undefined' &&
globals.window.postMessage && globals.window.addEventListener) {
/** @constructor */
Channel = function() {
// Make an empty, invisible iframe.
const iframe = document.createElement('iframe');
const iframe = globals.document.createElement('iframe');
iframe.style.display = 'none';
iframe.src = '';
document.documentElement.appendChild(iframe);
globals.document.documentElement.appendChild(iframe);
const win = iframe.contentWindow;

@@ -215,6 +217,6 @@ const doc = win.document;

// onreadystatechange event when inserted into the DOM.
if (typeof document !== 'undefined' && 'onreadystatechange' in
document.createElement('script')) {
if (typeof globals.document !== 'undefined' && 'onreadystatechange' in
globals.document.createElement('script')) {
return function(cb) {
let script = document.createElement('script');
let script = globals.document.createElement('script');
script.onreadystatechange = function() {

@@ -228,3 +230,3 @@ // Clean up and call the callback.

};
document.documentElement.appendChild(script);
globals.document.documentElement.appendChild(script);
};

@@ -231,0 +233,0 @@ }

'use strict';
import globals from "./globals/globals";
/**

@@ -73,4 +75,4 @@ * A collection of core utility functions.

if (compatibilityModeData_ === undefined) {
if (typeof window !== 'undefined' && window.__METAL_COMPATIBILITY__) {
enableCompatibilityMode(window.__METAL_COMPATIBILITY__);
if (typeof globals.window !== 'undefined' && globals.window.__METAL_COMPATIBILITY__) {
enableCompatibilityMode(globals.window.__METAL_COMPATIBILITY__);
}

@@ -77,0 +79,0 @@ }

@@ -7,2 +7,3 @@ 'use strict';

import Disposable from './disposable/Disposable';
import globals from './globals/globals';
import object from './object/object';

@@ -12,3 +13,3 @@ import string from './string/string';

export * from './core';
export { array, async, Disposable, object, string };
export { array, async, Disposable, globals, object, string };
export default core;
'use strict';
import globals from "../globals/globals";
class object {

@@ -29,3 +31,3 @@ /**

static getObjectByName(name, opt_obj) {
const scope = opt_obj || window;
const scope = opt_obj || globals.window;
const parts = name.split('.');

@@ -32,0 +34,0 @@ return parts.reduce((part, key) => part[key], scope);

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