{"version":3,"sources":["src/sdk/Contracts.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,qBAAa,SAAS;WACJ,sBAAsB,CAAC,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI;WAMtD,WAAW,CAAC,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI;WAM3C,uBAAuB,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI;WAQ1D,eAAe,CAAC,UAAU,EAAE,OAAO,GAAG,IAAI;WAM1C,6BAA6B,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI;WAYlE,uBAAuB,CAAC,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI;CAKxE","file":"Contracts.d.ts","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT license.\n\n/**\n * @class Contracts\n * @private\n */\nexport class Contracts {\n    public static throwIfNullOrUndefined(param: any, name: string): void {\n        if (param === undefined || param === null) {\n            throw new Error(\"throwIfNullOrUndefined:\" + name);\n        }\n    }\n\n    public static throwIfNull(param: any, name: string): void {\n        if (param === null) {\n            throw new Error(\"throwIfNull:\" + name);\n        }\n    }\n\n    public static throwIfNullOrWhitespace(param: string, name: string): void {\n        Contracts.throwIfNullOrUndefined(param, name);\n\n        if ((\"\" + param).trim().length < 1) {\n            throw new Error(\"throwIfNullOrWhitespace:\" + name);\n        }\n    }\n\n    public static throwIfDisposed(isDisposed: boolean): void {\n        if (isDisposed) {\n            throw new Error(\"the object is already disposed\");\n        }\n    }\n\n    public static throwIfArrayEmptyOrWhitespace(array: string[], name: string): void {\n        Contracts.throwIfNullOrUndefined(array, name);\n\n        if (array.length === 0) {\n            throw new Error(\"throwIfArrayEmptyOrWhitespace:\" + name);\n        }\n\n        for (const item of array) {\n            Contracts.throwIfNullOrWhitespace(item, name);\n        }\n    }\n\n    public static throwIfFileDoesNotExist(param: any, name: string): void {\n        Contracts.throwIfNullOrWhitespace(param, name);\n\n        // TODO check for file existence.\n    }\n}\n"]}