How to use the assert-js.instanceOf function in assert-js

To help you get started, we’ve selected a few assert-js 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 norberttech / no-game / nodejs / client / src / NoGame / Client / Kernel.js View on Github external
constructor(gfxEngine, pathFinder)
    {
        Assert.instanceOf(gfxEngine, Engine);
        Assert.instanceOf(pathFinder, PathFinder);

        this._gfxEngine = gfxEngine;
        this._pathFinder = pathFinder;
        this._version = '1.0.0-DEV';
        this._resetState();
    }
github norberttech / no-game / nodejs / server / src / NoGame / Engine / Map / Area / Tile.js View on Github external
constructor(position, ground, tileLayers, moveSpeedModifier = 0)
    {
        Assert.instanceOf(position, Position);
        Assert.instanceOf(ground, Item);
        Assert.instanceOf(tileLayers, TileLayers);
        Assert.integer(moveSpeedModifier);

        this._position = position;
        this._ground = ground;
        this._tileLayers = tileLayers;
        this._moveSpeedModifier = moveSpeedModifier;
        this._characters = new Map();
        this._monster = null;
    }
github norberttech / no-game / nodejs / server / src / NoGame / Engine / Map / Area / Tile.js View on Github external
constructor(position, ground, tileLayers, moveSpeedModifier = 0)
    {
        Assert.instanceOf(position, Position);
        Assert.instanceOf(ground, Item);
        Assert.instanceOf(tileLayers, TileLayers);
        Assert.integer(moveSpeedModifier);

        this._position = position;
        this._ground = ground;
        this._tileLayers = tileLayers;
        this._moveSpeedModifier = moveSpeedModifier;
        this._characters = new Map();
        this._monster = null;
    }
github norberttech / no-game / nodejs / client / src / NoGame / Client / Gfx / CharacterUI.js View on Github external
constructor(character)
    {
        Assert.instanceOf(character, Character);

        this._character = character;
        this._incomeMessages = [];
    }
github norberttech / no-game / nodejs / server / src / NoGame / Server / Protocol.js View on Github external
constructor(kernel, accounts, characters, incomeMessages, broadcaster, logger)
    {
        Assert.instanceOf(kernel, Kernel);
        Assert.instanceOf(accounts, Accounts);
        Assert.instanceOf(characters, Characters);
        Assert.instanceOf(incomeMessages, IncomeMessageQueue);
        Assert.instanceOf(broadcaster, Broadcaster);

        this._kernel = kernel;
        this._accounts = accounts;
        this._characters = characters;
        this._incomeMessages = incomeMessages;
        this._broadcaster = broadcaster;
        this._logger = logger;
    }

assert-js

Javascript simple assertion library with no dependencies.

MIT
Latest version published 5 years ago

Package Health Score

45 / 100
Full package analysis