{"ast":null,"code":"\"use strict\";\n\n// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT license.\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.Contracts = void 0;\n/**\n * @class Contracts\n * @private\n */\nclass Contracts {\n static throwIfNullOrUndefined(param, name) {\n if (param === undefined || param === null) {\n throw new Error(\"throwIfNullOrUndefined:\" + name);\n }\n }\n static throwIfNull(param, name) {\n if (param === null) {\n throw new Error(\"throwIfNull:\" + name);\n }\n }\n static throwIfNullOrWhitespace(param, name) {\n Contracts.throwIfNullOrUndefined(param, name);\n if ((\"\" + param).trim().length < 1) {\n throw new Error(\"throwIfNullOrWhitespace:\" + name);\n }\n }\n static throwIfNullOrTooLong(param, name, maxLength) {\n Contracts.throwIfNullOrUndefined(param, name);\n if ((\"\" + param).length > maxLength) {\n throw new Error(\"throwIfNullOrTooLong:\" + name + \" (more than \" + maxLength.toString() + \" characters)\");\n }\n }\n static throwIfNullOrTooShort(param, name, minLength) {\n Contracts.throwIfNullOrUndefined(param, name);\n if ((\"\" + param).length < minLength) {\n throw new Error(\"throwIfNullOrTooShort:\" + name + \" (less than \" + minLength.toString() + \" characters)\");\n }\n }\n static throwIfDisposed(isDisposed) {\n if (isDisposed) {\n throw new Error(\"the object is already disposed\");\n }\n }\n static throwIfArrayEmptyOrWhitespace(array, name) {\n Contracts.throwIfNullOrUndefined(array, name);\n if (array.length === 0) {\n throw new Error(\"throwIfArrayEmptyOrWhitespace:\" + name);\n }\n for (const item of array) {\n Contracts.throwIfNullOrWhitespace(item, name);\n }\n }\n static throwIfFileDoesNotExist(param, name) {\n Contracts.throwIfNullOrWhitespace(param, name);\n // TODO check for file existence.\n }\n static throwIfNotUndefined(param, name) {\n if (param !== undefined) {\n throw new Error(\"throwIfNotUndefined:\" + name);\n }\n }\n}\nexports.Contracts = Contracts;","map":{"version":3,"names":["Object","defineProperty","exports","value","Contracts","throwIfNullOrUndefined","param","name","undefined","Error","throwIfNull","throwIfNullOrWhitespace","trim","length","throwIfNullOrTooLong","maxLength","toString","throwIfNullOrTooShort","minLength","throwIfDisposed","isDisposed","throwIfArrayEmptyOrWhitespace","array","item","throwIfFileDoesNotExist","throwIfNotUndefined"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/microsoft-cognitiveservices-speech-sdk/distrib/lib/src/sdk/Contracts.js"],"sourcesContent":["\"use strict\";\n// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT license.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Contracts = void 0;\n/**\n * @class Contracts\n * @private\n */\nclass Contracts {\n static throwIfNullOrUndefined(param, name) {\n if (param === undefined || param === null) {\n throw new Error(\"throwIfNullOrUndefined:\" + name);\n }\n }\n static throwIfNull(param, name) {\n if (param === null) {\n throw new Error(\"throwIfNull:\" + name);\n }\n }\n static throwIfNullOrWhitespace(param, name) {\n Contracts.throwIfNullOrUndefined(param, name);\n if ((\"\" + param).trim().length < 1) {\n throw new Error(\"throwIfNullOrWhitespace:\" + name);\n }\n }\n static throwIfNullOrTooLong(param, name, maxLength) {\n Contracts.throwIfNullOrUndefined(param, name);\n if ((\"\" + param).length > maxLength) {\n throw new Error(\"throwIfNullOrTooLong:\" + name + \" (more than \" + maxLength.toString() + \" characters)\");\n }\n }\n static throwIfNullOrTooShort(param, name, minLength) {\n Contracts.throwIfNullOrUndefined(param, name);\n if ((\"\" + param).length < minLength) {\n throw new Error(\"throwIfNullOrTooShort:\" + name + \" (less than \" + minLength.toString() + \" characters)\");\n }\n }\n static throwIfDisposed(isDisposed) {\n if (isDisposed) {\n throw new Error(\"the object is already disposed\");\n }\n }\n static throwIfArrayEmptyOrWhitespace(array, name) {\n Contracts.throwIfNullOrUndefined(array, name);\n if (array.length === 0) {\n throw new Error(\"throwIfArrayEmptyOrWhitespace:\" + name);\n }\n for (const item of array) {\n Contracts.throwIfNullOrWhitespace(item, name);\n }\n }\n static throwIfFileDoesNotExist(param, name) {\n Contracts.throwIfNullOrWhitespace(param, name);\n // TODO check for file existence.\n }\n static throwIfNotUndefined(param, name) {\n if (param !== undefined) {\n throw new Error(\"throwIfNotUndefined:\" + name);\n }\n }\n}\nexports.Contracts = Contracts;\n\n"],"mappings":"AAAA,YAAY;;AACZ;AACA;AACAA,MAAM,CAACC,cAAc,CAACC,OAAO,EAAE,YAAY,EAAE;EAAEC,KAAK,EAAE;AAAK,CAAC,CAAC;AAC7DD,OAAO,CAACE,SAAS,GAAG,KAAK,CAAC;AAC1B;AACA;AACA;AACA;AACA,MAAMA,SAAS,CAAC;EACZ,OAAOC,sBAAsBA,CAACC,KAAK,EAAEC,IAAI,EAAE;IACvC,IAAID,KAAK,KAAKE,SAAS,IAAIF,KAAK,KAAK,IAAI,EAAE;MACvC,MAAM,IAAIG,KAAK,CAAC,yBAAyB,GAAGF,IAAI,CAAC;IACrD;EACJ;EACA,OAAOG,WAAWA,CAACJ,KAAK,EAAEC,IAAI,EAAE;IAC5B,IAAID,KAAK,KAAK,IAAI,EAAE;MAChB,MAAM,IAAIG,KAAK,CAAC,cAAc,GAAGF,IAAI,CAAC;IAC1C;EACJ;EACA,OAAOI,uBAAuBA,CAACL,KAAK,EAAEC,IAAI,EAAE;IACxCH,SAAS,CAACC,sBAAsB,CAACC,KAAK,EAAEC,IAAI,CAAC;IAC7C,IAAI,CAAC,EAAE,GAAGD,KAAK,EAAEM,IAAI,CAAC,CAAC,CAACC,MAAM,GAAG,CAAC,EAAE;MAChC,MAAM,IAAIJ,KAAK,CAAC,0BAA0B,GAAGF,IAAI,CAAC;IACtD;EACJ;EACA,OAAOO,oBAAoBA,CAACR,KAAK,EAAEC,IAAI,EAAEQ,SAAS,EAAE;IAChDX,SAAS,CAACC,sBAAsB,CAACC,KAAK,EAAEC,IAAI,CAAC;IAC7C,IAAI,CAAC,EAAE,GAAGD,KAAK,EAAEO,MAAM,GAAGE,SAAS,EAAE;MACjC,MAAM,IAAIN,KAAK,CAAC,uBAAuB,GAAGF,IAAI,GAAG,cAAc,G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