{
  "version": 3,
  "sources": ["../../../src/client-dynamodb/util/attribute-value.ts"],
  "sourcesContent": ["import { StringEncoded } from \"../../codec-string/index.js\";\n\nexport type AttributeValue =\n  | undefined\n  | S\n  | N\n  | NB\n  | B\n  | BOOL\n  | NULL\n  | L<ArrayLike<AttributeValue>>\n  | M<Record<string, AttributeValue>>;\n\nexport type AttributeMap = Record<string, AttributeValue>;\n\nexport type NativeBinaryAttribute =\n  | ArrayBuffer\n  | BigInt64Array\n  | BigUint64Array\n  | Buffer\n  | DataView\n  | Float32Array\n  | Float64Array\n  | Int16Array\n  | Int32Array\n  | Int8Array\n  | Uint16Array\n  | Uint32Array\n  | Uint8Array\n  | Uint8ClampedArray;\n\nexport type DocumentValue =\n  | undefined\n  | null\n  | boolean\n  | number\n  | bigint\n  | string\n  | Document[]\n  | NativeBinaryAttribute\n  | {\n      [key: string]: DocumentValue;\n    };\n\nexport type ToAttributeMap<T extends object> = ToAttributeValue<T>[\"M\"];\n\n/**\n * Computes the JSON representation of an object, {@link T}.\n */\nexport type ToAttributeValue<T> = T extends undefined\n  ? undefined\n  : T extends null\n    ? NULL\n    : T extends boolean\n      ? BOOL<T>\n      : T extends string\n        ? S<T>\n        : T extends number\n          ? N<T>\n          : T extends bigint\n            ? NB<T>\n            : // : // this behavior is not defined by https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/DynamoDB/DocumentClient.html\n              // // should it be a number of string?\n              // T extends Date\n              // ? N<number>\n              T extends NativeBinaryAttribute\n              ? B\n              : T extends ArrayLike<unknown>\n                ? L<{\n                    [index in keyof T]: index extends \"length\"\n                      ? T[index]\n                      : ToAttributeValue<T[index]>;\n                  }>\n                : M<{\n                    [name in keyof T]: ToAttributeValue<T[name]>;\n                  }>;\n\n// export function isS(a: any): a is S {\n//   return a !== undefined && \"S\" in a\n// }\n\nexport interface S<T extends string = string> {\n  S: T;\n}\n\n// export function isB(a: any): a is B {\n//   return a !== undefined && \"B\" in a\n// }\n\nexport interface B {\n  B: Buffer;\n}\n\n// export function isBOOL(a: any): a is BOOL {\n//   return a !== undefined && \"BOOL\" in a\n// }\n\nexport interface BOOL<T = boolean> {\n  BOOL: T;\n}\n\n// export function isM(a: any): a is M {\n//   return a !== undefined && \"M\" in a\n// }\n\nexport interface M<\n  T extends Record<string, AttributeValue> = Record<string, AttributeValue>,\n> {\n  M: T;\n}\n\n// export function isN(a: any): a is N {\n//   return a !== undefined && \"N\" in a\n// }\n\nexport interface N<T extends number = number> {\n  // If number extends N, it means that N is just a plain number,\n  // so we make it acceptable to pass raw number strings instead\n  // of forcing the user to use the `stringEncode` method.\n  N: number extends T ? `${T}` | StringEncoded<T> : StringEncoded<T>;\n}\n\nexport interface NB<T extends bigint = bigint> {\n  // If bigint extends N, it means that N is just a plain bigint,\n  // so we make it acceptable to pass raw bigint strings instead\n  // of forcing the user to use the `stringEncode` method.\n  N: bigint extends T ? `${T}` | StringEncoded<T> : StringEncoded<T>;\n}\n\n// export function isNULL(a: any): a is NULL {\n//   return a !== undefined && \"NULL\" in a\n// }\n\nexport interface NULL {\n  NULL: boolean;\n}\n\n// export function isL(a: any): a is L {\n//   return a !== undefined && \"L\" in a\n// }\n\nexport interface L<\n  T extends ArrayLike<AttributeValue> = ArrayLike<AttributeValue>,\n> {\n  L: T;\n}\n\n// export interface Stringifable {\n//   toString(): string\n// }\n\n// // export type StringifiedNumber<T extends number | bigint = number> = OpaqueType<\n// export type StringifiedNumber<T extends Stringifable> = OpaqueType<string, T>\n\n// // export function stringEncode<T extends number | bigint>(value: T) {\n// //   return value.toString() as StringifiedNumber<T>\n// // }\n"],
  "mappings": "+WAAA,IAAAA,EAAA,kBAAAC,EAAAD",
  "names": ["attribute_value_exports", "__toCommonJS"]
}
