Skip to content

Commit 7802bad

Browse files
committed
is string
1 parent c88433d commit 7802bad

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

packages/modules/product/src/services/product-module-service.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -902,9 +902,9 @@ export default class ProductModuleService
902902
...opt,
903903
values: opt.values?.map((v) => {
904904
// Normalize each value into an object and attach rank if available
905-
const valueObj = typeof v === "string" ? { value: v } : v
905+
const valueObj = isString(v) ? { value: v } : v
906906
const rank =
907-
opt.ranks && typeof v === "string"
907+
opt.ranks && isString(v)
908908
? opt.ranks[v]
909909
: opt.ranks?.[valueObj.value]
910910

@@ -1057,10 +1057,10 @@ export default class ProductModuleService
10571057
if (opt.values) {
10581058
// If new values are provided → normalize and apply ranks
10591059
normalizedValues = opt.values.map((v) => {
1060-
const valueObj = typeof v === "string" ? { value: v } : v
1060+
const valueObj = isString(v) ? { value: v } : v
10611061

10621062
const rank =
1063-
opt.ranks && typeof v === "string"
1063+
opt.ranks && isString(v)
10641064
? opt.ranks[v]
10651065
: opt.ranks?.[valueObj.value]
10661066

0 commit comments

Comments
 (0)