Changed Immutable version to match Theo

This commit is contained in:
nlaitine
2019-02-01 16:39:49 +02:00
parent b54b861785
commit d2e3e052c6
3 changed files with 10 additions and 7 deletions

View File

@@ -3,7 +3,7 @@
// Definitions by: Pete Petrash <https://github.com/petekp>
// Niko Laitinen <https://github.com/laitine>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 3.2.4
// TypeScript Version: 3.2
import { Collection, Map, List, OrderedMap } from "immutable";
@@ -70,6 +70,8 @@ export type FormatResultFn = (result: ImmutableStyleMap) => string;
export interface StyleMap {
aliases: Aliases;
global?: Props;
imports?: string[];
props: Props;
meta: Meta;
options: object;

View File

@@ -1,6 +1,6 @@
{
"private": true,
"dependencies": {
"immutable": "4.0.0-rc.12"
"immutable": "3.8.2"
}
}

View File

@@ -21,11 +21,12 @@ theo.registerFormat(
);
theo.registerValueTransform(
"relative/pixelValue",
prop => prop.get("category") === "sizing",
"easing/web",
prop => prop.get("category") === "easing",
prop => {
// @ts-ignore: prop can be undefined
const value = prop.get("value").toString();
return parseFloat(value.replace(/rem/g, "")) * 16;
const [x1, y1, x2, y2] = prop.get("value").toArray();
return `cubic-bezier(${x1}, ${y1}, ${x2}, ${y2})`;
}
);
theo.registerTransform("web", ["color/rgb", "easing/web"]);