punctilio 3.3.2 → 3.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "punctilio",
3
- "version": "3.3.2",
3
+ "version": "3.3.3",
4
4
  "description": "Smart typography transformations: curly quotes, em-dashes, en-dashes, and more",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -704,13 +704,8 @@ describe("transform", () => {
704
704
  expect(transform(input, { nbsp: undefined })).toBe(expected)
705
705
  })
706
706
 
707
- it("handles long string without transformable content", () => {
708
- const input = "abcdefghij ".repeat(1000)
709
- const start = performance.now()
710
- const result = transform(input)
711
- const elapsed = performance.now() - start
712
- expect(result).toBe(input)
713
- expect(elapsed).toBeLessThan(2000)
707
+ it("scales linearly for long non-transformable content", () => {
708
+ assertLinearScaling(transform, (n) => "abcdefghij ".repeat(n))
714
709
  })
715
710
  })
716
711
  })
@@ -812,12 +812,8 @@ describe("symbol stress tests", () => {
812
812
  assertLinearScaling(fractions, (n) => "add 1/2 cup ".repeat(n))
813
813
  })
814
814
 
815
- it("completes 10000 consecutive single quotes in under 2 seconds", () => {
816
- const input = "'".repeat(10000)
817
- const start = performance.now()
818
- symbolTransform(input)
819
- const elapsed = performance.now() - start
820
- expect(elapsed).toBeLessThan(2000)
815
+ it("scales linearly for consecutive single quotes (ReDoS prevention)", () => {
816
+ assertLinearScaling(symbolTransform, (n) => "'".repeat(n))
821
817
  })
822
818
  })
823
819