Files
klz-cables.com/.pnpm-store/v10/files/83/cd47303ee0785e676e5b326c1bb8891f09eba30fe9861a61806f630e3e6f83529b13b7a66f0018c2736282225b3b475433f474e9ee14bac62cf09531b1e648
Marc Mintel 5397309103
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
fix(products): fix breadcrumbs and product filtering (backport from main)
2026-02-24 16:04:21 +01:00

30 lines
1.1 KiB
Plaintext

'use strict'
const { test } = require('node:test')
const splitPropertyKey = require('./split-property-key')
test('splitPropertyKey does not change key', t => {
const result = splitPropertyKey('data1')
t.assert.deepStrictEqual(result, ['data1'])
})
test('splitPropertyKey splits nested key', t => {
const result = splitPropertyKey('data1.data2.data-3')
t.assert.deepStrictEqual(result, ['data1', 'data2', 'data-3'])
})
test('splitPropertyKey splits nested keys ending with a dot', t => {
const result = splitPropertyKey('data1.data2.data-3.')
t.assert.deepStrictEqual(result, ['data1', 'data2', 'data-3'])
})
test('splitPropertyKey splits nested escaped key', t => {
const result = splitPropertyKey('logging\\.domain\\.corp/operation.foo.bar-2')
t.assert.deepStrictEqual(result, ['logging.domain.corp/operation', 'foo', 'bar-2'])
})
test('splitPropertyKey splits nested escaped key with special characters', t => {
const result = splitPropertyKey('logging\\.domain\\.corp/operation.!\t@#$%^&*()_+=-<>.bar\\.2')
t.assert.deepStrictEqual(result, ['logging.domain.corp/operation', '!\t@#$%^&*()_+=-<>', 'bar.2'])
})