upc-generator
Version:
A randomly generated UPC-12(UPC-A) code For Amazon
20 lines (19 loc) • 545 B
TypeScript
declare type FlagCode = '0' | '1' | '6' | '7' | '8' | '9' | '';
interface CreateProps {
flagCode?: FlagCode;
manufacturer?: string;
size?: number;
}
export default class UPC {
private _flagCode;
private _manufacturer;
static flagCodeArr: FlagCode[];
constructor(prop?: CreateProps);
create(prop?: CreateProps): string;
createMultiple(prop?: CreateProps): string[];
isValid(num: string): boolean;
private _create;
private computedEanLastNum;
private fillNumber;
}
export {};