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

@hig/utils

Package Overview
Dependencies
Maintainers
4
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hig/utils - npm Package Compare versions

Comparing version 0.3.0 to 0.4.0

17

build/index.es.js
import memoize from 'lodash.memoize';
import { cx } from 'emotion';

@@ -105,4 +106,18 @@ /**

/**
* Returns a css className that combines what the user passes down and a string.
* Ideally the string would map to the element's js style object's name.
* @param {string} className
* @param {string} appendedString
* @returns {string} A string that looks like className__appendedString
*/
function createCustomClassNames(className, appendedString) {
return className && className.split(" ").reduce(function (acc, cur) {
return cx(acc, cur.trim() + "__" + appendedString);
}, "");
}
/* eslint-disable import/prefer-default-export */
export { combineEventHandlers, memoizeCombineEventHandlers, createButtonEventHandlers, memoizeCreateButtonEventHandlers, generateId };
export { combineEventHandlers, memoizeCombineEventHandlers, createButtonEventHandlers, memoizeCreateButtonEventHandlers, generateId, createCustomClassNames };

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

var memoize = _interopDefault(require('lodash.memoize'));
var emotion = require('emotion');

@@ -112,2 +113,16 @@ /**

/**
* Returns a css className that combines what the user passes down and a string.
* Ideally the string would map to the element's js style object's name.
* @param {string} className
* @param {string} appendedString
* @returns {string} A string that looks like className__appendedString
*/
function createCustomClassNames(className, appendedString) {
return className && className.split(" ").reduce(function (acc, cur) {
return emotion.cx(acc, cur.trim() + "__" + appendedString);
}, "");
}
/* eslint-disable import/prefer-default-export */

@@ -120,1 +135,2 @@

exports.generateId = generateId;
exports.createCustomClassNames = createCustomClassNames;

@@ -0,1 +1,8 @@

# [@hig/utils-v0.4.0](https://github.com/Autodesk/hig/compare/@hig/utils@0.3.0...@hig/utils@0.4.0) (2019-08-02)
### Features
* add createCustomClassNames ([8b41973](https://github.com/Autodesk/hig/commit/8b41973))
# [@hig/utils-v0.3.0](https://github.com/Autodesk/hig/compare/@hig/utils@0.2.1...@hig/utils@0.3.0) (2018-09-26)

@@ -2,0 +9,0 @@

5

package.json
{
"name": "@hig/utils",
"version": "0.3.0",
"version": "0.4.0",
"description": "Non-component specific utility functions for HIG components",

@@ -20,6 +20,7 @@ "author": "Autodesk Inc.",

"dependencies": {
"emotion": "^10.0.0",
"lodash.memoize": "^4.1.2"
},
"devDependencies": {
"@hig/babel-preset": "^0.1.0",
"@hig/babel-preset": "^0.1.1",
"@hig/eslint-config": "^0.1.0",

@@ -26,0 +27,0 @@ "@hig/jest-preset": "^0.1.0",

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