release: v2.33.1 - Production build and packaging
This commit is contained in:
@@ -33,6 +33,23 @@ describe('DataProcessor Algorithm & Performance Validation', () => {
|
||||
expect(result[0].key).toBe('X');
|
||||
});
|
||||
|
||||
test('Should reject unsafe or malformed key paths', () => {
|
||||
expect(() => DataProcessor.aggregate([{ a: 1 }], '')).toThrow(TypeError);
|
||||
expect(() => DataProcessor.aggregate([{ a: 1 }], 'a..b')).toThrow(TypeError);
|
||||
expect(() => DataProcessor.aggregate([{ a: 1 }], '__proto__.polluted')).toThrow(TypeError);
|
||||
});
|
||||
|
||||
test('Should support aggregation without retaining source values', () => {
|
||||
const result = DataProcessor.aggregate([
|
||||
{ category: 'A', value: 10 },
|
||||
{ category: 'A', value: 20 },
|
||||
], 'category', { collectValues: false });
|
||||
|
||||
expect(result).toHaveLength(1);
|
||||
expect(result[0].count).toBe(2);
|
||||
expect(result[0].values).toEqual([]);
|
||||
});
|
||||
|
||||
// 3. 성능 벤치마크 (O(N) vs O(N^2) 검증)
|
||||
test('O(N) Efficiency Benchmark', () => {
|
||||
const generateData = (n: number) => {
|
||||
|
||||
Reference in New Issue
Block a user