rn-css 1.8.0 → 1.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,4 @@
1
- import { /* StyleSheet, */ TextStyle, ViewStyle } from 'react-native';
2
- import type { PartialStyle, Units } from './types';
1
+ import type { AnyStyle, PartialStyle, Units } from './types';
3
2
  /** Mix the calculated RN style within the object style */
4
- declare const convertStyle: (rnStyle: PartialStyle, units: Units) => TextStyle & ViewStyle;
3
+ declare const convertStyle: <T extends AnyStyle = AnyStyle>(rnStyle: PartialStyle, units: Units) => T;
5
4
  export default convertStyle;
@@ -12,7 +12,7 @@ function parseValue(value) {
12
12
  exports.parseValue = parseValue;
13
13
  /** Convert a value using the provided unit transform table */
14
14
  function convertValue(key, value, units) {
15
- if (!(Object(value) instanceof String)) {
15
+ if (typeof value !== 'string') {
16
16
  console.error(`Failed to parse CSS instruction: ${key}=${value}. We expect a string, but ${value} was of type ${typeof value}.`);
17
17
  return 0;
18
18
  }
@@ -4,5 +4,5 @@ export declare function cssToRNStyle(css: string, units?: {
4
4
  em?: number;
5
5
  width?: number;
6
6
  height?: number;
7
- }): import("react-native").TextStyle & import("react-native").ViewStyle;
7
+ }): import("../types").AnyStyle;
8
8
  export default cssToStyle;