New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@cfpb/cfpb-atomic-component

Package Overview
Dependencies
Maintainers
11
Versions
69
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cfpb/cfpb-atomic-component - npm Package Compare versions

Comparing version 0.21.0 to 0.21.1

4

package.json
{
"name": "@cfpb/cfpb-atomic-component",
"version": "0.21.0",
"version": "0.21.1",
"description": "Design System atomic component utilities",

@@ -16,4 +16,4 @@ "less": "src/cfpb-atomic-component.less",

],
"gitHead": "905c9fa959cdf19f992fabfc0b3f5f64b315d67e",
"gitHead": "0f38eede5bf9e16ed629aa5581b6107575b5480d",
"type": "module"
}

@@ -338,2 +338,9 @@ /* eslint-disable no-use-before-define */

/**
* Set the transition that runs when this flyout is expanded/collapsed.
*
* @param {BaseTransition} transition - A transition object.
* @param {Function} collapseMethod - The collapse method to call on the transition.
* @param {Function} expandMethod - The expand method to call on the transition.
*/
function setTransition(transition, collapseMethod, expandMethod) {

@@ -340,0 +347,0 @@ _transition = transition;

@@ -5,2 +5,21 @@ import { JS_HOOK } from './standard-type.js';

* @param {HTMLElement} element - DOM element.
* @param {string} value - Value to check as existing as a JS data-* hook value.
* @returns {boolean} True if the data-* hook value exists, false otherwise.
*/
function contains(element, value) {
if (!element) {
return false;
}
let values = element.getAttribute(JS_HOOK);
// If JS data-* hook is not set return immediately.
if (!values) {
return false;
}
values = values.split(' ');
return values.indexOf(value) > -1 ? true : false;
}
/**
* @param {HTMLElement} element - DOM element.
* @param {string} value - Value to add to the element's JS data-* hook.

@@ -12,2 +31,4 @@ * @returns {string} The value that was added.

function add(element, value) {
if (contains(element, value)) return value;
if (value.indexOf(' ') !== -1) {

@@ -45,21 +66,2 @@ const msg = JS_HOOK + ' values cannot contain spaces!';

/**
* @param {HTMLElement} element - DOM element.
* @param {string} value - Value to check as existing as a JS data-* hook value.
* @returns {boolean} True if the data-* hook value exists, false otherwise.
*/
function contains(element, value) {
if (!element) {
return false;
}
let values = element.getAttribute(JS_HOOK);
// If JS data-* hook is not set return immediately.
if (!values) {
return false;
}
values = values.split(' ');
return values.indexOf(value) > -1 ? true : false;
}
export { add, contains, remove };

@@ -10,3 +10,3 @@ /**

* @param {object} classes - The classes to apply to this transition.
* @param {Object} child - The child transition using this as a base.
* @param {object} child - The child transition using this as a base.
* @returns {BaseTransition} An instance.

@@ -18,3 +18,3 @@ */

if (!child) throw new Error('Child transition argument must be defined!');
let _child = child;
const _child = child;

@@ -21,0 +21,0 @@ let _lastClass;

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