{"version":3,"sources":["../src/id/make.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,EAAE,EAAC,MAAM,OAAO,CAAC;AACzB,OAAO,EAAC,SAAS,EAAC,MAAM,WAAW,CAAC;AAKpC;;;;;;;GAOG;AACH,wBAAgB,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,EAAE,OAAO,CAAC,EAAE,SAAS,GAAG,EAAE,CAqBvF","file":"make.d.ts","sourcesContent":["import {Id} from '../id';\nimport {IdOptions} from './options';\nimport {Rules} from '../rules';\nimport {createType} from '../create/type';\nimport {initialValue} from '../initial/value';\n\n/**\n * Create a Strong Id type.\n * @param fallback\n * @param initial\n * @returns\n *\n * @category Strings\n */\nexport function idMake(fallback: string, value?: string | null, options?: IdOptions): Id {\n\tconst rules = new Rules();\n\n\tif (options) {\n\t\tif (typeof options.maxLength === 'number') {\n\t\t\trules.add().must.have.length.lessThanOrEqualTo(options.maxLength);\n\t\t}\n\n\t\tif (typeof options.minLength === 'number') {\n\t\t\trules.add().must.have.length.greaterThanOrEqualTo(options.minLength);\n\t\t}\n\n\t\tif (typeof options.contains === 'string' || Array.isArray(options.contains)) {\n\t\t\trules.add().must.contain.text(options.contains);\n\t\t}\n\t}\n\n\trules.add().must.match.type.string();\n\tconst typeId = options && typeof options.typeId === 'string' ? options.typeId : 'Id';\n\n\treturn createType<string>(fallback, initialValue(value), rules, typeId);\n}\n"]}