{"version":3,"file":"deleteFirst.cjs","names":[],"sources":["../../../src/utils/strings/deleteFirst.ts"],"sourcesContent":["import type { Fn } from '#bemedev/globals/types';\nimport { DEFAULT_DELIMITER } from '#constants';\n\nexport type DeleteFirst_F = Fn<[arg: string, toDelete?: string], string>;\n\n/**\n * Deletes the first occurrence of a specified delimiter from the start of a string.\n * @param arg  The string from which to delete the first occurrence of the specified delimiter.\n * @param toDelete The delimiter to remove from the start of the string. Defaults to {@linkcode DEFAULT_DELIMITER}.\n * @returns The modified string with the first occurrence of the specified value removed, or the original string if the delimiter is not found at the start.\n *\n * @see {@linkcode DeleteFirst_F} for the type definition\n * @see {@linkcode DEFAULT_DELIMITER} for the default delimiter used if none is specified\n */\nexport const deleteFirst: DeleteFirst_F = (\n  arg,\n  toDelete = DEFAULT_DELIMITER,\n) => {\n  const check = arg.startsWith(toDelete);\n  return check ? arg.substring(1) : arg;\n};\n"],"mappings":";;;;;;;;;;;;;AAcA,MAAa,eACX,KACA,WAAA,QACG;AAEH,QADc,IAAI,WAAW,SAAS,GACvB,IAAI,UAAU,EAAE,GAAG"}