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

@convoy/dapper

Package Overview
Dependencies
Maintainers
84
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@convoy/dapper - npm Package Compare versions

Comparing version 2.0.112 to 2.0.118

1

dist/src/configure.d.ts

@@ -6,4 +6,5 @@ export interface Configuration {

useInsertRule: boolean;
omitUniqueSuffices: boolean;
}
export declare let config: Configuration;
export default function configure(cfg: Partial<Configuration>): void;

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

useInsertRule: process.env.NODE_ENV !== 'development',
omitUniqueSuffices: false,
});

@@ -9,0 +10,0 @@ function configure(cfg) {

7

dist/src/keyframes.js

@@ -11,3 +11,3 @@ "use strict";

var config = tslib_1.__assign({}, configure_1.config, configOverride);
var animationName = generateAnimationName(++uniqueKeyframeIdentifier, config);
var animationName = generateAnimationName(config);
var cssText = cssifyKeyframe(keyframe, animationName);

@@ -25,4 +25,5 @@ renderCSSText_1.default([cssText], config);

}
function generateAnimationName(id, config) {
return config.classNamePrefix + "anim-" + id;
function generateAnimationName(config) {
var suffix = config.omitUniqueSuffices ? '' : "-" + ++uniqueKeyframeIdentifier;
return config.classNamePrefix + "anim" + suffix;
}

@@ -29,0 +30,0 @@ function cssifyObject(style) {

@@ -6,7 +6,13 @@ "use strict";

function generateClassName(ids, config) {
var friendlyName = config.friendlyClassNames ? ids.map(function (id) { return id + "-"; }).join('') : '';
return config.classNamePrefix + friendlyName + _generateClassName(++uniqueRuleIdentifier);
var friendlyName = config.friendlyClassNames ? ids.join('-') : '';
return "" + config.classNamePrefix + friendlyName + _generateSuffix(config);
}
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = generateClassName;
function _generateSuffix(config) {
if (config.omitUniqueSuffices)
return '';
var uniqueSuffix = _generateClassName(++uniqueRuleIdentifier);
return config.friendlyClassNames ? "-" + uniqueSuffix : uniqueSuffix;
}
function _generateClassName(id, className) {

@@ -13,0 +19,0 @@ if (className === void 0) { className = ''; }

@@ -6,2 +6,3 @@ "use strict";

var generateClassName_1 = require("../../src/libs/generateClassName");
var keyframes_1 = require("../../src/keyframes");
proxyquire.noCallThru();

@@ -21,2 +22,3 @@ var stub = { default: null };

sandbox.restore();
configure_1.default({ omitUniqueSuffices: false });
});

@@ -34,3 +36,45 @@ it("friendlyClassNames set to false doesn't add name", function () {

});
it("omitUniqueSuffices omits unique sufficies for class names and keyframes", function () {
configure_1.default({
friendlyClassNames: true,
omitUniqueSuffices: false,
});
var fadeOut1 = keyframes_1.default({
'0%': {
opacity: 0,
},
'100%': {
opacity: 1,
},
});
var className1 = compile({
root: {
backgroundColor: 'red',
color: 'blue',
},
});
expect(fadeOut1).to.equal('dapper-anim-1');
expect(className1).to.deep.equal({ root: 'dapper-root-a' });
configure_1.default({
friendlyClassNames: true,
omitUniqueSuffices: true,
});
var fadeOut2 = keyframes_1.default({
'0%': {
opacity: 0,
},
'100%': {
opacity: 1,
},
});
var className2 = compile({
root: {
backgroundColor: 'red',
color: 'blue',
},
});
expect(fadeOut2).to.equal('dapper-anim');
expect(className2).to.deep.equal({ root: 'dapper-root' });
});
});
//# sourceMappingURL=configure.js.map
{
"name": "@convoy/dapper",
"version": "2.0.112",
"version": "2.0.118",
"description": "Styling library",

@@ -5,0 +5,0 @@ "license": "Apache-2.0",

@@ -500,2 +500,6 @@ <img width="35%" height="35%" src="https://cloud.githubusercontent.com/assets/4240309/25258098/c3c37a1c-25f1-11e7-802f-ca47f7991000.png" />

`omitUniqueSuffices` (optional): A flag allowing unique suffix generation to be turned off. Useful for snapshot testing, e.g.:
![image](./omitUniqueSuffices.png)
```js

@@ -502,0 +506,0 @@ dapper.configure({

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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