Skip to content

Commit

Permalink
chore: bump version before release
Browse files Browse the repository at this point in the history
  • Loading branch information
pocesar committed Jul 11, 2024
1 parent 5530112 commit d1e2377
Show file tree
Hide file tree
Showing 5 changed files with 606 additions and 360 deletions.
48 changes: 24 additions & 24 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
export interface Mappings {
[index: string]: string | string[];
}
/**
* expect the transliterated value as key, and a string with replacements
*/
export declare let mappings: Mappings;
export interface StringOptions {
/**
* overwrite or pass your own mappings.
* existing mappings will be overwritten, else it'll be appended to defaults
*/
mappings?: Mappings;
}
export interface RegexOptions extends StringOptions {
/**
* RegExp flags, ium. Defaults to i
*/
flags?: string;
}
/** Generate a function that returns a RegExp, that can be reused with the same options */
export declare function toRegex(options?: RegexOptions): (input: string) => RegExp;
/** Generate a function that returns a string, that can be reused with the same options */
export declare function toString(options?: StringOptions): (input: string) => string;
export interface Mappings {
[index: string]: string | string[];
}
/**
* expect the transliterated value as key, and a string with replacements
*/
export declare let mappings: Mappings;
export interface StringOptions {
/**
* overwrite or pass your own mappings.
* existing mappings will be overwritten, else it'll be appended to defaults
*/
mappings?: Mappings;
}
export interface RegexOptions extends StringOptions {
/**
* RegExp flags, ium. Defaults to i
*/
flags?: string;
}
/** Generate a function that returns a RegExp, that can be reused with the same options */
export declare function toRegex(options?: RegexOptions): (input: string) => RegExp;
/** Generate a function that returns a string, that can be reused with the same options */
export declare function toString(options?: StringOptions): (input: string) => string;
6 changes: 3 additions & 3 deletions index.test.js → index.test.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const expect = require('chai').expect;
const lib = require('./index');
import { expect } from 'chai';
import lib from './index.js';

describe('diacritic-regex', function () {

Expand Down Expand Up @@ -33,7 +33,7 @@ describe('diacritic-regex', function () {
}
})

expect(tr('~lt').toString()).to.equal('/[\\/~`]l[tT]/i')
expect(tr('~lt').toString()).to.equal('/[/~`]l[tT]/i')
expect(tr('~lt').test('omg `lT')).to.equal(true)

})
Expand Down
Loading

0 comments on commit d1e2377

Please sign in to comment.