{
  "version": 3,
  "sources": ["../../../src/client-dynamodb/util/marshall.ts"],
  "sourcesContent": ["import {\n  marshallOptions,\n  unmarshallOptions,\n  marshall as _marshall,\n  unmarshall as _unmarshall,\n} from \"@aws-sdk/util-dynamodb\";\n\nimport {\n  AttributeMap,\n  B,\n  L,\n  M,\n  N,\n  NB,\n  NativeBinaryAttribute,\n  S,\n  ToAttributeMap,\n} from \"./attribute-value.js\";\nimport { StringEncoded } from \"../../codec-string/index.js\";\n\nexport const marshall: <\n  Item extends object,\n  MarshallOptions extends marshallOptions | undefined,\n>(\n  item: Item,\n  options?: MarshallOptions,\n) => ToAttributeMap<Item> = _marshall;\n\nexport const unmarshall: <\n  Item extends AttributeMap,\n  UnmarshallOptions extends unmarshallOptions | undefined,\n>(\n  item: Item,\n  options?: UnmarshallOptions,\n) => {\n  [property in keyof Item]: Unmarshall<Item[property], UnmarshallOptions>;\n} = _unmarshall as any;\n\nexport interface NumberValue<N extends number> {\n  value: `${N}`;\n}\n\nexport type Unmarshall<\n  T,\n  UnmarshallOptions extends unmarshallOptions | undefined,\n> = T extends S<infer s>\n  ? s\n  : T extends B\n    ? NativeBinaryAttribute\n    : T extends NB<infer n>\n      ? Exclude<UnmarshallOptions, undefined>[\"wrapNumbers\"] extends true\n        ? { value: StringEncoded<n> }\n        : never\n      : T extends N<infer n>\n        ? Exclude<UnmarshallOptions, undefined>[\"wrapNumbers\"] extends true\n          ? { value: StringEncoded<n> }\n          : n\n        : T extends Date\n          ? string\n          : T extends L<infer Items>\n            ? {\n                [index in keyof Items]: index extends \"length\"\n                  ? Items[index]\n                  : Unmarshall<Items[index], UnmarshallOptions>;\n              }\n            : T extends M<infer Attributes>\n              ? {\n                  [property in keyof Attributes]: Unmarshall<\n                    Attributes[property],\n                    UnmarshallOptions\n                  >;\n                }\n              : never;\n\n// type UnmarshallMap<\n//   Item extends AttributeMap,\n//   UnmarshallOptions extends unmarshallOptions | undefined,\n// > = {\n//   [property in keyof Item]: Unmarshall<Item[property], UnmarshallOptions>\n// }\n\n// type X = UnmarshallMap<\n//   {\n//     id: { S: string }\n//     events: {\n//       L: {\n//         M: {\n//           id: { S: string }\n//         }\n//       }[]\n//     }\n//   },\n//   undefined\n// >\n\n// type Y = ToAttributeMap<X>\n// const y: Y = {\n//   id: {S: \"\"},\n//   events: {L: [\n//     {\n//       M: {\n//         id: {S:\"\"}\n//       }\n//     }\n//   ]}\n// }\n"],
  "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,cAAAE,EAAA,eAAAC,IAAA,eAAAC,EAAAJ,GAAA,IAAAK,EAKO,kCAeA,MAAMH,EAMe,EAAAI,SAEfH,EAQT,EAAAI",
  "names": ["marshall_exports", "__export", "marshall", "unmarshall", "__toCommonJS", "import_util_dynamodb", "_marshall", "_unmarshall"]
}
