Skip to content

Qwen3.8-Flash-Next on any consumer hardware: one-click install for Windows / Linux. Strata inference engine, OpenAI/Anthropic API on localhost, optional image input.

C++
648 B
Raw Blame
export type Request = {id:string;sku:string;quantity:number};
export function uniqueRequests(requests:Request[]):Request[]{
 const out:Request[]=[];const seen=new Set<string>();
 for(const r of requests){
  if(typeof r.id!=='string'||typeof r.sku!=='string')throw new RangeError('id and sku must be strings');
  const id=r.id.trim();const sku=r.sku.trim();
  if(id===''||sku==='')throw new RangeError('id and sku must be nonempty');
  if(!Number.isInteger(r.quantity)||r.quantity<=0)throw new RangeError('quantity must be a positive integer');
  if(seen.has(id))continue;
  seen.add(id);
  out.push({id,sku,quantity:r.quantity});
 }
 return out;
}