콘텐츠로 이동

memoryOrderStore — @gj-kit/toss-payments

@gj-kit/toss-payments/testing에서 공개하는 function입니다. package version 0.6.1의 release declaration을 그대로 표시합니다.

import { memoryOrderStore } from '@gj-kit/toss-payments/testing';
/**
* 인메모리 스토어 4종 + 인메모리 AuditSink — 단위 테스트·프로토타이핑용.
*
* 프로세스 생존 기간만 유지된다 — 프로덕션 사용 금지(특히 빌링키는 토스에 조회
* API가 없어 저장 유실 = 복구 불가).
*
* 스토어 인터페이스는 전부 타입 전용 import다 — "./testing" 엔트리가 server/webhook
* 모듈의 런타임 코드를 번들에 끌고 가지 않는다(격리 규칙 §2 유지).
*/
/**
* orderId 키 인메모리 OrderStore — saveOrder는 같은 orderId를 덮어쓴다.
*
* `orderOf` is a side-effect-free inspection hook for assertions (mirrors the
* `memoryAuditSink().entries` convention): it never creates, claims or mutates an entry, and
* it returns a defensive copy — mutating the returned object cannot corrupt the store.
*/
declare function memoryOrderStore(): OrderStore & {
orderOf(orderId: string): StoredOrder | undefined;
};

이 선언은 매개변수, optionality, 제네릭, 반환값, 공개 union/type 계약의 정본입니다. 호출 전 필요한 환경·권한·오류 경계는 패키지 Golden path와 이 subpath의 import 조건을 함께 확인하세요.

  • 패키지: @gj-kit/toss-payments
  • 버전: 0.6.1
  • 공개 entry: ./testing
  • 소스: GitHub

orderId 키 인메모리 OrderStore — saveOrder는 같은 orderId를 덮어쓴다.

orderOf is a side-effect-free inspection hook for assertions (mirrors the memoryAuditSink().entries convention): it never creates, claims or mutates an entry, and it returns a defensive copy — mutating the returned object cannot corrupt the store.