{"version":3,"file":"is-file-result.mjs","names":[],"sources":["../src/is-file-result.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n                       🗲 Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website:                  https://stormsoftware.com\n Repository:               https://github.com/storm-software/stryke\n Documentation:            https://docs.stormsoftware.com/projects/stryke\n Contact:                  https://stormsoftware.com/contact\n\n SPDX-License-Identifier:  Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type { FileResult, FileStatus } from \"@stryke/types/file\";\nimport { isSetObject } from \"./is-set-object\";\nimport { isSetString } from \"./is-set-string\";\n\n/**\n * Check if the provided value is a `FileResult` object\n *\n * @param value - The value to type check\n * @returns An indicator specifying if the value provided is a `FileResult` object\n */\nexport const isFileResult = (value: any): value is FileResult => {\n  return (\n    isSetObject(value) &&\n    \"status\" in value &&\n    [\"initialized\", \"validated\", \"uploaded\", \"failed\"].includes(\n      value.status as FileStatus\n    ) &&\n    (isSetString((value as FileResult)?.uri) ||\n      isSetObject((value as FileResult)?.file))\n  );\n};\n"],"mappings":";;;;;;;;;;AA4BA,MAAa,gBAAgB,UAAoC;AAC/D,QACE,YAAY,MAAM,IAClB,YAAY,SACZ;EAAC;EAAe;EAAa;EAAY;EAAS,CAAC,SACjD,MAAM,OACP,KACA,YAAa,OAAsB,IAAI,IACtC,YAAa,OAAsB,KAAK"}