{"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;WAMvD,mBAAmB,CAAC,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI;CAKpE","file":"Contracts.d.ts","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT license.\r\n\r\n/**\r\n * @class Contracts\r\n * @private\r\n */\r\nexport class Contracts {\r\n    public static throwIfNullOrUndefined(param: any, name: string): void {\r\n        if (param === undefined || param === null) {\r\n            throw new Error(\"throwIfNullOrUndefined:\" + name);\r\n        }\r\n    }\r\n\r\n    public static throwIfNull(param: any, name: string): void {\r\n        if (param === null) {\r\n            throw new Error(\"throwIfNull:\" + name);\r\n        }\r\n    }\r\n\r\n    public static throwIfNullOrWhitespace(param: string, name: string): void {\r\n        Contracts.throwIfNullOrUndefined(param, name);\r\n\r\n        if ((\"\" + param).trim().length < 1) {\r\n            throw new Error(\"throwIfNullOrWhitespace:\" + name);\r\n        }\r\n    }\r\n\r\n    public static throwIfDisposed(isDisposed: boolean): void {\r\n        if (isDisposed) {\r\n            throw new Error(\"the object is already disposed\");\r\n        }\r\n    }\r\n\r\n    public static throwIfArrayEmptyOrWhitespace(array: string[], name: string): void {\r\n        Contracts.throwIfNullOrUndefined(array, name);\r\n\r\n        if (array.length === 0) {\r\n            throw new Error(\"throwIfArrayEmptyOrWhitespace:\" + name);\r\n        }\r\n\r\n        for (const item of array) {\r\n            Contracts.throwIfNullOrWhitespace(item, name);\r\n        }\r\n    }\r\n\r\n    public static throwIfFileDoesNotExist(param: any, name: string): void {\r\n        Contracts.throwIfNullOrWhitespace(param, name);\r\n\r\n        // TODO check for file existence.\r\n    }\r\n\r\n    public static throwIfNotUndefined(param: any, name: string): void {\r\n        if (param !== undefined) {\r\n            throw new Error(\"throwIfNotUndefined:\" + name);\r\n        }\r\n    }\r\n}\r\n"]}