1.3.8 • Published 12 months ago

wueste v1.3.8

Weekly downloads
-
License
AFL-2.0
Repository
github
Last release
12 months ago

wueste

Wueste provides and a generator which can convert a json-schema to "typescript" with easy way to set attributes and get a Constrained Object back.

This is done with the Builder Pattern like:

interface Object {
    readonly Attr: string
    readonly OptionalAttr?: string
}



const obj = new ObjectBuilder().
                    Attr("value").
                    OptionalAttr("x").
                    Get()

this works nice on flat objects but not on nested objects.

interface NestedObject {
    readonly Nested: Object
}

const obj = new NestedObjectBuilder()
                    .Nested(new ObjectBuilder()
                            .Attr("value")
                            .Get()
                    ).Get()

or

const obj = new NestedObjectBuilder().
        Nested((nestedBuilder) => {
            nestedBuilder.Attr("value")
            nestedBuilder.OptionalAttr("x")
        }).Get()

or any better way to do this?

The generator enables the abiliy to get back every attribute in a defined order. To provide a way create content-addressable with a hash function.

This is done with:

ObjectGetter(obj).Apply((path, value) => {
    console.log(path, value)
})

I will provide a way to set the attributes in the simlar way like the Getter works.

interface ObjectBuilder {
    Attr(value: string): ObjectBuilder
    OptionalAttr(value: string): ObjectBuilder
    Get(): Object
}

ObjectFactory.Builder().Setter((path, value) => {

}).Get()

ObjectSetter(builder).Apply((path, value) => {
    console.log(path, value)
    return WuestenRetVal(value)
})

/* object:NoName:
    const v0 = v
    builder.Test(fn(
      [
        ...base,
        helperTestSchema,
        (helperTestSchema as WuestenReflectionObject).properties![0],
      ]
    , builder.GetTest()))
*/
1.3.8

12 months ago

1.3.7

1 year ago

1.3.6

1 year ago

1.3.5

1 year ago

1.3.4

1 year ago

1.3.3

1 year ago

1.3.2

1 year ago

1.3.1

1 year ago

1.3.0

1 year ago

1.2.4

1 year ago

1.2.3

1 year ago

1.2.2

1 year ago

1.2.0

1 year ago

1.2.1

1 year ago

1.1.0

1 year ago

1.0.35

1 year ago

1.0.34

2 years ago

1.0.33

2 years ago

1.0.32

2 years ago

1.0.22

2 years ago

1.0.21

2 years ago

1.0.26

2 years ago

1.0.25

2 years ago

1.0.24

2 years ago

1.0.23

2 years ago

1.0.29

2 years ago

1.0.28

2 years ago

1.0.27

2 years ago

1.0.31

2 years ago

1.0.30

2 years ago

1.0.20

2 years ago

1.0.19

2 years ago

1.0.18

2 years ago

1.0.17

2 years ago

1.0.16

2 years ago

1.0.15

2 years ago

1.0.14

2 years ago

1.0.13

2 years ago

1.0.12

2 years ago

1.0.11

2 years ago

1.0.10

2 years ago

0.0.0-smoke

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago

0.0.0

2 years ago