MCPcopy Index your code
hub / github.com/TanStack/db / buildCompareOptionsFromConfig

Function buildCompareOptionsFromConfig

packages/db/src/collection/index.ts:995–1011  ·  view source on GitHub ↗
(
  config: CollectionConfig<any, any, any>,
)

Source from the content-addressed store, hash-verified

993}
994
995function buildCompareOptionsFromConfig(
996 config: CollectionConfig<any, any, any>,
997): StringCollationConfig {
998 if (config.defaultStringCollation) {
999 const options = config.defaultStringCollation
1000 return {
1001 stringSort: options.stringSort ?? `locale`,
1002 locale: options.stringSort === `locale` ? options.locale : undefined,
1003 localeOptions:
1004 options.stringSort === `locale` ? options.localeOptions : undefined,
1005 }
1006 } else {
1007 return {
1008 stringSort: `locale`,
1009 }
1010 }
1011}

Callers 1

constructorMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected