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
package/src/tests/index.test.ts
CHANGED
|
@@ -704,13 +704,8 @@ describe("transform", () => {
|
|
|
704
704
|
expect(transform(input, { nbsp: undefined })).toBe(expected)
|
|
705
705
|
})
|
|
706
706
|
|
|
707
|
-
it("
|
|
708
|
-
|
|
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("
|
|
816
|
-
|
|
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
|
|