1.4.0 • Published 1 month ago

@lottiefiles/last-builder v1.4.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 month ago

last-builder

npm npm bundle size npm npm

Use composable functions to build up a last structure

Use

yarn add @lottiefiles/last-builder
import { at, el, ob, pt, rt } from '@lottiefiles/last-builder';

const output = rt([
    at('v', 'version', pt('4.8.0')),
    el(
    'meta',
    'metadata',
    ob('custom', [
        at('a', 'author', pt('LottieFiles')),
        at('d', 'description', pt('A lottie animation.')),
        at('data', 'custom', pt(2)),
    ]),
    ),
]);

output will equal

{
    type: 'root',
    title: 'animation',
    hasExpressions: false,
    children: [
    {
        type: 'attribute',
        key: 'v',
        title: 'version',
        children: [
        {
            type: 'primitive',
            value: '4.8.0',
        },
        ],
    },
    {
        type: 'element',
        key: 'meta',
        title: 'metadata',
        children: [
        {
            type: 'object',
            title: 'custom',
            children: [
            {
                type: 'attribute',
                key: 'a',
                title: 'author',
                children: [
                {
                    type: 'primitive',
                    value: 'LottieFiles',
                },
                ],
            },
            {
                type: 'attribute',
                key: 'd',
                title: 'description',
                children: [
                {
                    type: 'primitive',
                    value: 'A lottie animation.',
                },
                ],
            },
            {
                type: 'attribute',
                key: 'data',
                title: 'custom',
                children: [
                {
                    type: 'primitive',
                    value: 2,
                },
                ],
            },
            ],
        },
        ],
    },
    ]
}

Legal

License © LottieFiles

1.4.0

1 month ago

1.2.0

7 months ago

1.0.2

10 months ago

1.1.0

7 months ago

1.0.9

7 months ago

1.0.8

7 months ago

1.3.4

5 months ago

1.0.7

8 months ago

1.0.5

9 months ago

1.2.2

7 months ago

1.3.0

6 months ago

1.2.1

7 months ago

1.0.3

10 months ago

1.0.0

11 months ago

0.0.0

11 months ago