• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mobxjs / serializr / 14498102528

16 Apr 2025 04:49PM UTC coverage: 90.687% (+0.4%) from 90.257%
14498102528

push

github

web-flow
Decrease tech debt  (#191)

* Decrease tech debt by updating babel and switching to jest testing framework
* Removed node 12.x from the testing matrix as the typescript compiler doesn't run on it anymore.

687 of 885 branches covered (77.63%)

1003 of 1106 relevant lines covered (90.69%)

42.24 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

83.33
/src/api/createSimpleSchema.ts
1
import { Props, ModelSchema } from "./types";
2

2✔
3
/**
2✔
4
 * Creates a model schema that (de)serializes from / to plain javascript objects.
5
 * Its factory method is: `() => ({})`
6
 *
7
 * @example
8
 * const todoSchema = createSimpleSchema({
9
 *     title: true,
10
 *     done: true,
11
 * })
12
 *
13
 * const json = serialize(todoSchema, { title: 'Test', done: false })
14
 * const todo = deserialize(todoSchema, json)
15
 *
16
 * @param props property mapping,
17
 * @returns model schema
18
 */
19
export default function createSimpleSchema<T extends object>(props: Props<T>): ModelSchema<T> {
20
    return {
32✔
21
        factory: function () {
×
22
            return {} as any;
36✔
23
        },
32✔
24
        props: props,
25
    };
26
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc