test(packaging): added test for source map correctness

This commit is contained in:
Kara Erickson
2017-09-07 10:16:03 -07:00
committed by Matias Niemelä
parent 97cc6caa33
commit c8f742e288
10 changed files with 153 additions and 9 deletions

View File

@ -9,13 +9,8 @@
import * as o from './output/output_ast';
import {ParseError} from './parse_util';
const CAMEL_CASE_REGEXP = /([A-Z])/g;
const DASH_CASE_REGEXP = /-+([a-z0-9])/g;
export function camelCaseToDashCase(input: string): string {
return input.replace(CAMEL_CASE_REGEXP, (...m: any[]) => '-' + m[1].toLowerCase());
}
export function dashCaseToCamelCase(input: string): string {
return input.replace(DASH_CASE_REGEXP, (...m: any[]) => m[1].toUpperCase());
}