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

@lightningtv/solid

Package Overview
Dependencies
Maintainers
0
Versions
89
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lightningtv/solid - npm Package Compare versions

Comparing version 2.3.1 to 2.4.0

2

dist/src/utils.d.ts

@@ -0,1 +1,2 @@

import { type Styles } from '@lightningtv/core';
/**

@@ -5,1 +6,2 @@ * Converts a color string to a color number value.

export declare function hexColor(color?: string | number): number;
export declare function combineStyles(...styles: (Styles | undefined)[]): Styles;

@@ -1,2 +0,3 @@

import { isInteger } from '@lightningtv/core';
import { isInteger, isArray } from '@lightningtv/core';
import { createMemo } from 'solid-js';
/**

@@ -21,2 +22,22 @@ * Converts a color string to a color number value.

}
export function combineStyles(...styles) {
return createMemo(() => flattenStyles(styles))();
}
function flattenStyles(obj, result = {}) {
if (isArray(obj)) {
obj.forEach((item) => {
flattenStyles(item, result);
});
}
else if (obj) {
// handle the case where the object is not an array
for (const key in obj) {
// be careful of 0 values
if (result[key] === undefined) {
result[key] = obj[key];
}
}
}
return result;
}
//# sourceMappingURL=utils.js.map

4

package.json
{
"name": "@lightningtv/solid",
"version": "2.3.1",
"version": "2.4.0",
"description": "Lightning Renderer for Solid Universal",

@@ -45,3 +45,3 @@ "type": "module",

"dependencies": {
"@lightningtv/core": "^2.3.3",
"@lightningtv/core": "^2.4.0",
"@solid-primitives/event-listener": "^2.3.3",

@@ -48,0 +48,0 @@ "@solid-primitives/mouse": "^2.0.19",

@@ -1,2 +0,3 @@

import { isInteger } from '@lightningtv/core';
import { isInteger, isArray, type Styles } from '@lightningtv/core';
import { createMemo } from 'solid-js';

@@ -27,1 +28,26 @@ /**

}
export function combineStyles(...styles: (Styles | undefined)[]): Styles {
return createMemo(() => flattenStyles(styles))();
}
function flattenStyles(
obj: Styles | undefined | (Styles | undefined)[],
result: Styles = {},
): Styles {
if (isArray(obj)) {
obj.forEach((item) => {
flattenStyles(item, result);
});
} else if (obj) {
// handle the case where the object is not an array
for (const key in obj) {
// be careful of 0 values
if (result[key] === undefined) {
result[key as keyof Styles] = obj[key as keyof Styles]!;
}
}
}
return result;
}

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