How to use the tiny-types.isDefined function in tiny-types

To help you get started, weā€™ve selected a few tiny-types examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jan-molak / serenity-js / packages / core / src / events / ActivityStarts.ts View on Github external
constructor(
        public readonly value: ActivityDetails,
        timestamp?: Timestamp,
    ) {
        super(timestamp);
        ensure('value', value, isDefined());
    }
}
github jan-molak / serenity-js / packages / core / src / events / ActivityFinished.ts View on Github external
constructor(
        public readonly value: ActivityDetails,
        public readonly outcome: Outcome,
        timestamp?: Timestamp,
    ) {
        super(timestamp);
        ensure('value', value, isDefined());
        ensure('outcome', outcome, isDefined());
    }
}
github jan-molak / serenity-js / examples / calculator-app / src / rest-api / model / Result.ts View on Github external
constructor(public readonly expression: Expression, public readonly value: number) {
        super();
        ensure(Expression.name, expression, isDefined());
        ensure('Result value', value, isDefined(), isNumber());
    }
}
github jan-molak / serenity-js / packages / core / src / events / SceneBackgroundDetected.ts View on Github external
constructor(
        public readonly name: Name,
        public readonly description: Description,
    ) {
        super();
        ensure('name', name, isDefined());
        ensure('description', description, isDefined());
    }
}
github jan-molak / serenity-js / packages / core / src / events / ArtifactGenerated.ts View on Github external
constructor(
        public readonly name: Name,
        public readonly artifact: Artifact,
        timestamp?: Timestamp,
    ) {
        super(timestamp);
        ensure('value', artifact, isDefined());
    }
}
github jan-molak / serenity-js / packages / core / src / events / FeatureNarrativeDetected.ts View on Github external
constructor(
        public readonly description: Description,
    ) {
        super();
        ensure('description', description, isDefined());
    }
}
github jan-molak / serenity-js / packages / core / src / events / TestRunnerDetected.ts View on Github external
constructor(
        public readonly value: Name,
        public readonly timestamp: Timestamp = new Timestamp(),
    ) {
        super();
        ensure('value', value, isDefined());
        ensure('timestamp', timestamp, isDefined());
    }
}
github jan-molak / serenity-js / packages / core / src / model / ScenarioParameters.ts View on Github external
constructor(
        public readonly name: Name,
        public readonly description: Description,
        public readonly values: { [ parameter: string ]: string },
    ) {
        super();

        ensure('name', name, isDefined());
        ensure('values', values, isDefined());
    }
}
github jan-molak / serenity-js / packages / core / src / stage / Stage.ts View on Github external
callFor(actors: DressingRoom): Stage {
        ensure('DressingRoom', actors, isDefined());

        this.dressingRoom = actors;
        this.actorsOnStage = {};
        this.actorInTheSpotlight = null;

        return this;
    }
github jan-molak / serenity-js / packages / core / src / events / SceneTagged.ts View on Github external
constructor(
        public readonly value: ScenarioDetails,
        public readonly tag: Tag,
        timestamp?: Timestamp,
    ) {
        super(timestamp);
        ensure('value', value, isDefined());
    }
}