Skip to content

Latest commit

 

History

History
30 lines (21 loc) · 527 Bytes

README.md

File metadata and controls

30 lines (21 loc) · 527 Bytes

typescript-equals

Rough implementation of checking of AST equality: Ignores spaces, comments, quotes, semicolons, parenthesis.

Install

npm i -S typescript-equals

Usage

import { equals } from 'typescript-equals';

const text1 = `var a = {a:1}`;
const text2 = `var a = {a:1,}`;
const text3 = `var a = {a: 1} // comment`;

equals(text1, text2); // => true
equals(text1, text3); // => true
equals(text2, text3); // => true

API

equals(firstText: string, secondText: string): boolean;