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

@fastkit/helpers

Package Overview
Dependencies
Maintainers
1
Versions
204
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fastkit/helpers - npm Package Compare versions

Comparing version 0.7.28 to 0.7.29

39

dist/helpers.cjs.js

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

const IN_DOCUMENT = typeof document !== 'undefined';
function isFocusable(element) {

@@ -521,2 +522,3 @@ if (element.tabIndex > 0 ||

}
function pushDynamicStyle(styleContent) {

@@ -529,2 +531,36 @@ if (!IN_WINDOW)

}
function loadScript(src, attrs, parentNode) {
return new Promise((resolve, reject) => {
const script = document.createElement('script');
if (attrs) {
for (const attr in attrs) {
script.setAttribute(attr, attrs[attr]);
}
}
script.onload = () => {
script.onerror = script.onload = null;
resolve(script);
};
script.onerror = () => {
script.onerror = script.onload = null;
reject(new Error(`Failed to load ${src}`));
};
script.async = true;
script.src = src;
const node = parentNode || document.head || document.getElementsByTagName('head')[0];
node.appendChild(script);
});
}
const _ensureScriptMap = {};
function ensureScript(src) {
if (!_ensureScriptMap[src]) {
_ensureScriptMap[src] = loadScript(src).catch((err) => {
delete _ensureScriptMap[src];
throw err;
});
}
return _ensureScriptMap[src];
}
function addTransitionEvent(type, el, handler, opts) {

@@ -582,2 +618,3 @@ const types = Array.isArray(type) ? type : [type];

}
function ownerDocument(node) {

@@ -867,2 +904,3 @@ return (node && node.ownerDocument) || document;

exports.deepmerge = deepmerge;
exports.ensureScript = ensureScript;
exports.escapeRegExp = escapeRegExp;

@@ -887,2 +925,3 @@ exports.flattenComparatorCondition = flattenComparatorCondition;

exports.isString = isString;
exports.loadScript = loadScript;
exports.mergeDefaults = mergeDefaults;

@@ -889,0 +928,0 @@ exports.mergeObject = mergeObject;

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

const IN_DOCUMENT = typeof document !== 'undefined';
function isFocusable(element) {

@@ -521,2 +522,3 @@ if (element.tabIndex > 0 ||

}
function pushDynamicStyle(styleContent) {

@@ -529,2 +531,36 @@ if (!IN_WINDOW)

}
function loadScript(src, attrs, parentNode) {
return new Promise((resolve, reject) => {
const script = document.createElement('script');
if (attrs) {
for (const attr in attrs) {
script.setAttribute(attr, attrs[attr]);
}
}
script.onload = () => {
script.onerror = script.onload = null;
resolve(script);
};
script.onerror = () => {
script.onerror = script.onload = null;
reject(new Error(`Failed to load ${src}`));
};
script.async = true;
script.src = src;
const node = parentNode || document.head || document.getElementsByTagName('head')[0];
node.appendChild(script);
});
}
const _ensureScriptMap = {};
function ensureScript(src) {
if (!_ensureScriptMap[src]) {
_ensureScriptMap[src] = loadScript(src).catch((err) => {
delete _ensureScriptMap[src];
throw err;
});
}
return _ensureScriptMap[src];
}
function addTransitionEvent(type, el, handler, opts) {

@@ -582,2 +618,3 @@ const types = Array.isArray(type) ? type : [type];

}
function ownerDocument(node) {

@@ -867,2 +904,3 @@ return (node && node.ownerDocument) || document;

exports.deepmerge = deepmerge;
exports.ensureScript = ensureScript;
exports.escapeRegExp = escapeRegExp;

@@ -887,2 +925,3 @@ exports.flattenComparatorCondition = flattenComparatorCondition;

exports.isString = isString;
exports.loadScript = loadScript;
exports.mergeDefaults = mergeDefaults;

@@ -889,0 +928,0 @@ exports.mergeObject = mergeObject;

@@ -132,2 +132,4 @@ /// <reference types="node" />

export declare function ensureScript(src: string): Promise<HTMLScriptElement>;
/** Escapes regular expression control chars */

@@ -225,2 +227,12 @@ export declare function escapeRegExp(str: string): string;

export declare function loadScript(src: string, attrs?: LoadScriptAttrs | null, parentNode?: Node): Promise<HTMLScriptElement>;
export declare interface LoadScriptAttrs {
crossorigin?: 'anonymous' | 'use-credentials' | '';
integrity?: string;
nomodule?: boolean;
nonce?: string;
type?: string;
}
export declare function mergeDefaults<T>(base: T, scheme: DefaultsScheme<T>): T;

@@ -227,0 +239,0 @@

2

package.json
{
"name": "@fastkit/helpers",
"version": "0.7.28",
"version": "0.7.29",
"description": "@fastkit/helpers",

@@ -5,0 +5,0 @@ "buildOptions": {

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