We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f4f7880 commit 2317d9cCopy full SHA for 2317d9c
src/diff/css.js
src/diff/css.ts
@@ -0,0 +1,13 @@
1
+import Diff, { DiffOptions } from './base';
2
+
3
+class CssDiff extends Diff<string, string> {
4
+ protected tokenize(value: string) {
5
+ return value.split(/([{}:;,]|\s+)/);
6
+ }
7
+}
8
9
+export const cssDiff = new CssDiff();
10
11
+export function diffCss(oldStr: string, newStr: string, options: DiffOptions<string>) {
12
+ return cssDiff.diff(oldStr, newStr, options);
13
0 commit comments