@itwin/core-frontend 5.9.0-dev.15 → 5.9.0-dev.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/PerModelCategoryVisibility.d.ts.map +1 -1
- package/lib/cjs/PerModelCategoryVisibility.js +83 -81
- package/lib/cjs/PerModelCategoryVisibility.js.map +1 -1
- package/lib/cjs/internal/render/webgl/FrustumUniforms.d.ts.map +1 -1
- package/lib/cjs/internal/render/webgl/FrustumUniforms.js.map +1 -1
- package/lib/cjs/internal/render/webgl/RenderCommands.js.map +1 -1
- package/lib/cjs/tile/GltfReader.js.map +1 -1
- package/lib/cjs/tile/map/MapLayerFormatRegistry.js.map +1 -1
- package/lib/cjs/tools/ToolAdmin.js.map +1 -1
- package/lib/esm/PerModelCategoryVisibility.d.ts.map +1 -1
- package/lib/esm/PerModelCategoryVisibility.js +84 -82
- package/lib/esm/PerModelCategoryVisibility.js.map +1 -1
- package/lib/esm/internal/render/webgl/FrustumUniforms.d.ts.map +1 -1
- package/lib/esm/internal/render/webgl/FrustumUniforms.js.map +1 -1
- package/lib/esm/internal/render/webgl/RenderCommands.js.map +1 -1
- package/lib/esm/tile/GltfReader.js.map +1 -1
- package/lib/esm/tile/map/MapLayerFormatRegistry.js.map +1 -1
- package/lib/esm/tools/ToolAdmin.js.map +1 -1
- package/lib/public/scripts/parse-imdl-worker.js +1 -1
- package/lib/workers/webpack/parse-imdl-worker.js +1 -1
- package/package.json +20 -20
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MapLayerFormatRegistry.js","sourceRoot":"","sources":["../../../../src/tile/map/MapLayerFormatRegistry.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAoE;AAEpE,+CAA4C;AAE5C,0CAAuO;AACvO,MAAM,cAAc,GAAG,uBAAuB,CAAC;AAE/C;;;;;;;;GAQG;AACH,MAAa,cAAc;IAClB,MAAM,CAAC,QA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BACzB,MAAM,MAAM,GAAI,yBAAc,CAAC,QAAQ,CAAC,EAAC,IAAI,EAAE,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAC,CAAC,CAAC;gBACnE,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;oBACzB,IAAI,GAAG,EAAC,MAAM,EAAE,WAAW,EAAC,CAAC;oBAC7B,MAAM,CAAC,QAAQ,GAAG,QAAQ,CAAC;oBAC3B,MAAM,CAAC,QAAQ,GAAG,QAAQ,CAAC;gBAC7B,CAAC;YAEH,CAAC;QACH,CAAC;aAAM,IAAI,OAAO,cAAc,KAAK,QAAQ,EAAE,CAAC;YAC9C,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,cAAc,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;YAChE,MAAM,GAAG,KAAK,EAAE,IAAI,CAAC;YACrB,IAAI,GAAG,cAAc,CAAC;QACxB,CAAC;QAED,IAAI,CAAC,IAAI,IAAI,CAAC,MAAM;YAClB,OAAO,EAAE,MAAM,EAAE,+BAAoB,CAAC,aAAa,EAAE,CAAC;QAExD,OAAO,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IAC/B,CAAC;CACF;AAnGD,wDAmGC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module MapLayers\n */\n\nimport { assert, expectDefined, Logger } from \"@itwin/core-bentley\";\nimport { ImageMapLayerSettings, MapLayerKey, MapLayerSettings, MapSubLayerProps } from \"@itwin/core-common\";\nimport { IModelApp } from \"../../IModelApp\";\nimport { IModelConnection } from \"../../IModelConnection\";\nimport { ImageryMapLayerTreeReference, internalMapLayerImageryFormats, MapLayerAccessClient, MapLayerAuthenticationInfo, MapLayerImageryProvider, MapLayerSource, MapLayerSourceStatus, MapLayerTileTreeReference } from \"../internal\";\nconst loggerCategory = \"ArcGISFeatureProvider\";\n\n/**\n * Class representing a map-layer format.\n * Each format has it's unique 'formatId' string, used to uniquely identify a format in the [[MapLayerFormatRegistry]].\n * When creating an [[ImageMapLayerSettings]] object, a format needs to be specified this 'formatId'.\n * The MapLayerFormat object can later be used to validate a source, or create a provider.\n *\n * Subclasses should override formatId, [[MapLayerFormat.createImageryProvider]], and [[MapLayerFormat.createMapLayerTree]].\n * @public\n */\nexport class MapLayerFormat {\n public static formatId: string;\n\n /** Register the current format in the [[MapLayerFormatRegistry]]. */\n public static register() { IModelApp.mapLayerFormatRegistry.register(this); }\n\n /**\n * Allow a source of a specific format to be validated before being attached as a map-layer.\n * @param _url The URL of the source.\n * @param _userName The username to access the source if needed.\n * @param _password The password to access the source if needed.\n * @param _ignoreCache Flag to skip cache lookup (i.e. force a new server request).\n * @returns Validation Status. If successful, a list of available sub-layers may also be returned.\n */\n public static async validateSource(_url: string, _userName?: string, _password?: string, _ignoreCache?: boolean, _accesKey?: MapLayerKey): Promise<MapLayerSourceValidation> { return { status: MapLayerSourceStatus.Valid }; }\n\n /** Allow a source object to be validated before being attached as a map-layer.\n * @beta\n */\n public static async validate(args: ValidateSourceArgs): Promise<MapLayerSourceValidation> {\n return this.validateSource(args.source.url, args.source.userName, args.source.password, args.ignoreCache);\n }\n\n /**\n * Create a [[MapLayerImageryProvider]] that will be used to feed data in a map-layer tile tree.\n * @param _settings The map layer settings to be applied to the imagery provider.\n * @returns Returns the new imagery provider.\n * @beta\n */\n public static createImageryProvider(_settings: MapLayerSettings): MapLayerImageryProvider | undefined { assert(false); }\n\n /**\n * Creates a MapLayerTileTreeReference for this map layer format.\n * @param _layerSettings Map layer settings that are applied to the MapLayerTileTreeReference.\n * @param _layerIndex The index of the associated map layer.\n * @param _iModel The iModel containing the MapLayerTileTreeReference.\n * @returns Returns the new tile tree reference.\n * @beta\n */\n public static createMapLayerTree(_layerSettings: MapLayerSettings, _layerIndex: number, _iModel: IModelConnection): MapLayerTileTreeReference | undefined {\n assert(false);\n return undefined;\n }\n\n}\n\n/** Options for validating sources\n * @beta\n */\nexport interface ValidateSourceArgs {\n source: MapLayerSource;\n /** Disable cache lookup during validate process */\n ignoreCache?: boolean;\n}\n\n/**\n * The type of a map layer format.\n * @public\n */\nexport type MapLayerFormatType = typeof MapLayerFormat;\n\n/** @public */\nexport interface MapLayerSourceValidation {\n status: MapLayerSourceStatus;\n subLayers?: MapSubLayerProps[];\n\n /** @beta */\n authInfo?: MapLayerAuthenticationInfo;\n}\n\n/**\n * Options supplied at startup via [[IModelAppOptions.mapLayerOptions]] to specify access keys for various map layer formats.\n * 'BingMaps' must have it's key value set to 'key'\n * 'MapboxImagery' must have it's key value set to 'access_token'\n *\n * @public\n */\nexport interface MapLayerOptions {\n /** Access key for Azure Maps in the format `{ key: \"subscription-key\", value: \"your-azure-maps-key\" }`. */\n // eslint-disable-next-line @typescript-eslint/naming-convention\n AzureMaps?: MapLayerKey;\n /** Access key for Mapbox in the format `{ key: \"access_token\", value: \"your-mapbox-key\" }`. */\n // eslint-disable-next-line @typescript-eslint/naming-convention\n MapboxImagery?: MapLayerKey;\n /** Access key for Bing Maps in the format `{ key: \"key\", value: \"your-bing-maps-key\" }`. */\n // eslint-disable-next-line @typescript-eslint/naming-convention\n BingMaps?: MapLayerKey;\n /** Access keys for additional map layer formats. */\n [format: string]: MapLayerKey | undefined;\n}\n\n/** @internal */\nexport interface MapLayerFormatEntry {\n type: MapLayerFormatType;\n accessClient?: MapLayerAccessClient;\n}\n\n/**\n * A registry of MapLayerFormats identified by their unique format IDs. The registry can be accessed via [[IModelApp.mapLayerFormatRegistry]].\n * @public\n */\nexport class MapLayerFormatRegistry {\n private _configOptions: MapLayerOptions;\n constructor(opts?: MapLayerOptions) {\n this._configOptions = opts ?? {};\n internalMapLayerImageryFormats.forEach((format) => this.register(format));\n }\n private _formats = new Map<string, MapLayerFormatEntry>();\n\n public isRegistered(formatId: string) { return this._formats.get(formatId) !== undefined; }\n\n public register(formatClass: MapLayerFormatType) {\n if (formatClass.formatId.length === 0)\n return; // must be an abstract class, ignore it\n\n this._formats.set(formatClass.formatId, { type: formatClass });\n }\n\n /** @beta */\n public setAccessClient(formatId: string, accessClient: MapLayerAccessClient): boolean {\n const entry = this._formats.get(formatId);\n if (entry !== undefined) {\n entry.accessClient = accessClient;\n return true;\n }\n return false;\n }\n\n /** @beta */\n public getAccessClient(formatId: string): MapLayerAccessClient | undefined {\n if (formatId.length === 0)\n return undefined;\n\n return this._formats.get(formatId)?.accessClient;\n }\n\n public get configOptions(): MapLayerOptions {\n return this._configOptions;\n }\n\n /** @internal */\n public createImageryMapLayerTree(layerSettings: ImageMapLayerSettings, layerIndex: number, iModel: IModelConnection): ImageryMapLayerTreeReference | undefined {\n const entry = this._formats.get(layerSettings.formatId);\n const format = entry?.type;\n if (format === undefined) {\n Logger.logError(loggerCategory, `Could not find format '${layerSettings.formatId}' in registry`);\n return undefined;\n }\n return format.createMapLayerTree(layerSettings, layerIndex, iModel) as ImageryMapLayerTreeReference;\n }\n\n /**\n * Returns a [[MapLayerImageryProvider]] based on the provided [[ImageMapLayerSettings]] object.\n * @internal\n */\n public createImageryProvider(layerSettings: ImageMapLayerSettings): MapLayerImageryProvider | undefined {\n const entry = this._formats.get(layerSettings.formatId);\n const format = entry?.type;\n if (this._configOptions[layerSettings.formatId] !== undefined) {\n const keyValuePair = expectDefined(this._configOptions[layerSettings.formatId]);\n const key: MapLayerKey = { key: keyValuePair.key, value: keyValuePair.value };\n layerSettings = layerSettings.clone({ accessKey: key });\n }\n return (format === undefined) ? undefined : format.createImageryProvider(layerSettings);\n }\n\n /** @beta*/\n public async validateSource(opts: ValidateSourceArgs): Promise<MapLayerSourceValidation>;\n\n public async validateSource(formatId: string, url: string, userName?: string, password?: string, ignoreCache?: boolean): Promise<MapLayerSourceValidation>;\n\n /** @internal*/\n public async validateSource(formatIdOrArgs: string|ValidateSourceArgs, url?: string, userName?: string, password?: string, ignoreCache?: boolean): Promise<MapLayerSourceValidation> {\n let format: typeof MapLayerFormat | undefined;\n let args: ValidateSourceArgs | undefined;\n\n if (typeof formatIdOrArgs == \"string\" && url !== undefined) {\n const formatId = formatIdOrArgs;\n const entry = this._formats.get(formatId);\n format = entry?.type;\n if (format !== undefined) {\n const source = MapLayerSource.fromJSON({name: \"\", formatId, url});\n if (source !== undefined) {\n args = {source, ignoreCache};\n source.userName = userName;\n source.password = password;\n }\n\n }\n } else if (typeof formatIdOrArgs !== \"string\") {\n const entry = this._formats.get(formatIdOrArgs.source.formatId);\n format = entry?.type;\n args = formatIdOrArgs;\n }\n\n if (!args || !format)\n return { status: MapLayerSourceStatus.InvalidFormat };\n\n return format.validate(args);\n }\n}\n\n"]}
|
|
1
|
+
{"version":3,"file":"MapLayerFormatRegistry.js","sourceRoot":"","sources":["../../../../src/tile/map/MapLayerFormatRegistry.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAoE;AAEpE,+CAA4C;AAE5C,0CAAuO;AACvO,MAAM,cAAc,GAAG,uBAAuB,CAAC;AAE/C;;;;;;;;GAQG;AACH,MAAa,cAAc;IAClB,MAAM,CAAC,QAAQ,CAAS;IAE/B,qEAAqE;IAC9D,MAAM,CAAC,QAAQ,KAAK,qBAAS,CAAC,sBAAsB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAE7E;;;;;;;OAOG;IACI,MAAM,CAAC,KAAK,CAAC,cAAc,CAAC,IAAY,EAAE,SAAkB,EAAE,SAAkB,EAAE,YAAsB,EAAE,SAAuB,IAAuC,OAAO,EAAE,MAAM,EAAE,+BAAoB,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;IAE/N;;MAEE;IACK,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAwB;QACnD,OAAO,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE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AC;YAChE,MAAM,GAAG,KAAK,EAAE,IAAI,CAAC;YACrB,IAAI,GAAG,cAAc,CAAC;QACxB,CAAC;QAED,IAAI,CAAC,IAAI,IAAI,CAAC,MAAM;YAClB,OAAO,EAAE,MAAM,EAAE,+BAAoB,CAAC,aAAa,EAAE,CAAC;QAExD,OAAO,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IAC/B,CAAC;CACF;AAnGD,wDAmGC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module MapLayers\n */\n\nimport { assert, expectDefined, Logger } from \"@itwin/core-bentley\";\nimport { ImageMapLayerSettings, MapLayerKey, MapLayerSettings, MapSubLayerProps } from \"@itwin/core-common\";\nimport { IModelApp } from \"../../IModelApp\";\nimport { IModelConnection } from \"../../IModelConnection\";\nimport { ImageryMapLayerTreeReference, internalMapLayerImageryFormats, MapLayerAccessClient, MapLayerAuthenticationInfo, MapLayerImageryProvider, MapLayerSource, MapLayerSourceStatus, MapLayerTileTreeReference } from \"../internal\";\nconst loggerCategory = \"ArcGISFeatureProvider\";\n\n/**\n * Class representing a map-layer format.\n * Each format has it's unique 'formatId' string, used to uniquely identify a format in the [[MapLayerFormatRegistry]].\n * When creating an [[ImageMapLayerSettings]] object, a format needs to be specified this 'formatId'.\n * The MapLayerFormat object can later be used to validate a source, or create a provider.\n *\n * Subclasses should override formatId, [[MapLayerFormat.createImageryProvider]], and [[MapLayerFormat.createMapLayerTree]].\n * @public\n */\nexport class MapLayerFormat {\n public static formatId: string;\n\n /** Register the current format in the [[MapLayerFormatRegistry]]. */\n public static register() { IModelApp.mapLayerFormatRegistry.register(this); }\n\n /**\n * Allow a source of a specific format to be validated before being attached as a map-layer.\n * @param _url The URL of the source.\n * @param _userName The username to access the source if needed.\n * @param _password The password to access the source if needed.\n * @param _ignoreCache Flag to skip cache lookup (i.e. force a new server request).\n * @returns Validation Status. If successful, a list of available sub-layers may also be returned.\n */\n public static async validateSource(_url: string, _userName?: string, _password?: string, _ignoreCache?: boolean, _accesKey?: MapLayerKey): Promise<MapLayerSourceValidation> { return { status: MapLayerSourceStatus.Valid }; }\n\n /** Allow a source object to be validated before being attached as a map-layer.\n * @beta\n */\n public static async validate(args: ValidateSourceArgs): Promise<MapLayerSourceValidation> {\n return this.validateSource(args.source.url, args.source.userName, args.source.password, args.ignoreCache);\n }\n\n /**\n * Create a [[MapLayerImageryProvider]] that will be used to feed data in a map-layer tile tree.\n * @param _settings The map layer settings to be applied to the imagery provider.\n * @returns Returns the new imagery provider.\n * @beta\n */\n public static createImageryProvider(_settings: MapLayerSettings): MapLayerImageryProvider | undefined { assert(false); }\n\n /**\n * Creates a MapLayerTileTreeReference for this map layer format.\n * @param _layerSettings Map layer settings that are applied to the MapLayerTileTreeReference.\n * @param _layerIndex The index of the associated map layer.\n * @param _iModel The iModel containing the MapLayerTileTreeReference.\n * @returns Returns the new tile tree reference.\n * @beta\n */\n public static createMapLayerTree(_layerSettings: MapLayerSettings, _layerIndex: number, _iModel: IModelConnection): MapLayerTileTreeReference | undefined {\n assert(false);\n return undefined;\n }\n\n}\n\n/** Options for validating sources\n * @beta\n */\nexport interface ValidateSourceArgs {\n source: MapLayerSource;\n /** Disable cache lookup during validate process */\n ignoreCache?: boolean;\n}\n\n/**\n * The type of a map layer format.\n * @public\n */\nexport type MapLayerFormatType = typeof MapLayerFormat;\n\n/** @public */\nexport interface MapLayerSourceValidation {\n status: MapLayerSourceStatus;\n subLayers?: MapSubLayerProps[];\n\n /** @beta */\n authInfo?: MapLayerAuthenticationInfo;\n}\n\n/**\n * Options supplied at startup via [[IModelAppOptions.mapLayerOptions]] to specify access keys for various map layer formats.\n * 'BingMaps' must have it's key value set to 'key'\n * 'MapboxImagery' must have it's key value set to 'access_token'\n *\n * @public\n */\nexport interface MapLayerOptions {\n /** Access key for Azure Maps in the format `{ key: \"subscription-key\", value: \"your-azure-maps-key\" }`. */\n // eslint-disable-next-line @typescript-eslint/naming-convention\n AzureMaps?: MapLayerKey;\n /** Access key for Mapbox in the format `{ key: \"access_token\", value: \"your-mapbox-key\" }`. */\n // eslint-disable-next-line @typescript-eslint/naming-convention\n MapboxImagery?: MapLayerKey;\n /** Access key for Bing Maps in the format `{ key: \"key\", value: \"your-bing-maps-key\" }`. */\n // eslint-disable-next-line @typescript-eslint/naming-convention\n BingMaps?: MapLayerKey;\n /** Access keys for additional map layer formats. */\n [format: string]: MapLayerKey | undefined;\n}\n\n/** @internal */\nexport interface MapLayerFormatEntry {\n type: MapLayerFormatType;\n accessClient?: MapLayerAccessClient;\n}\n\n/**\n * A registry of MapLayerFormats identified by their unique format IDs. The registry can be accessed via [[IModelApp.mapLayerFormatRegistry]].\n * @public\n */\nexport class MapLayerFormatRegistry {\n private _configOptions: MapLayerOptions;\n constructor(opts?: MapLayerOptions) {\n this._configOptions = opts ?? {};\n internalMapLayerImageryFormats.forEach((format) => this.register(format));\n }\n private _formats = new Map<string, MapLayerFormatEntry>();\n\n public isRegistered(formatId: string) { return this._formats.get(formatId) !== undefined; }\n\n public register(formatClass: MapLayerFormatType) {\n if (formatClass.formatId.length === 0)\n return; // must be an abstract class, ignore it\n\n this._formats.set(formatClass.formatId, { type: formatClass });\n }\n\n /** @beta */\n public setAccessClient(formatId: string, accessClient: MapLayerAccessClient): boolean {\n const entry = this._formats.get(formatId);\n if (entry !== undefined) {\n entry.accessClient = accessClient;\n return true;\n }\n return false;\n }\n\n /** @beta */\n public getAccessClient(formatId: string): MapLayerAccessClient | undefined {\n if (formatId.length === 0)\n return undefined;\n\n return this._formats.get(formatId)?.accessClient;\n }\n\n public get configOptions(): MapLayerOptions {\n return this._configOptions;\n }\n\n /** @internal */\n public createImageryMapLayerTree(layerSettings: ImageMapLayerSettings, layerIndex: number, iModel: IModelConnection): ImageryMapLayerTreeReference | undefined {\n const entry = this._formats.get(layerSettings.formatId);\n const format = entry?.type;\n if (format === undefined) {\n Logger.logError(loggerCategory, `Could not find format '${layerSettings.formatId}' in registry`);\n return undefined;\n }\n return format.createMapLayerTree(layerSettings, layerIndex, iModel);\n }\n\n /**\n * Returns a [[MapLayerImageryProvider]] based on the provided [[ImageMapLayerSettings]] object.\n * @internal\n */\n public createImageryProvider(layerSettings: ImageMapLayerSettings): MapLayerImageryProvider | undefined {\n const entry = this._formats.get(layerSettings.formatId);\n const format = entry?.type;\n if (this._configOptions[layerSettings.formatId] !== undefined) {\n const keyValuePair = expectDefined(this._configOptions[layerSettings.formatId]);\n const key: MapLayerKey = { key: keyValuePair.key, value: keyValuePair.value };\n layerSettings = layerSettings.clone({ accessKey: key });\n }\n return (format === undefined) ? undefined : format.createImageryProvider(layerSettings);\n }\n\n /** @beta*/\n public async validateSource(opts: ValidateSourceArgs): Promise<MapLayerSourceValidation>;\n\n public async validateSource(formatId: string, url: string, userName?: string, password?: string, ignoreCache?: boolean): Promise<MapLayerSourceValidation>;\n\n /** @internal*/\n public async validateSource(formatIdOrArgs: string|ValidateSourceArgs, url?: string, userName?: string, password?: string, ignoreCache?: boolean): Promise<MapLayerSourceValidation> {\n let format: typeof MapLayerFormat | undefined;\n let args: ValidateSourceArgs | undefined;\n\n if (typeof formatIdOrArgs == \"string\" && url !== undefined) {\n const formatId = formatIdOrArgs;\n const entry = this._formats.get(formatId);\n format = entry?.type;\n if (format !== undefined) {\n const source = MapLayerSource.fromJSON({name: \"\", formatId, url});\n if (source !== undefined) {\n args = {source, ignoreCache};\n source.userName = userName;\n source.password = password;\n }\n\n }\n } else if (typeof formatIdOrArgs !== \"string\") {\n const entry = this._formats.get(formatIdOrArgs.source.formatId);\n format = entry?.type;\n args = formatIdOrArgs;\n }\n\n if (!args || !format)\n return { status: MapLayerSourceStatus.InvalidFormat };\n\n return format.validate(args);\n }\n}\n\n"]}
|