Create new type definition for 'escape-regexp' (#4058)

This commit is contained in:
Acid Chicken (硫酸鶏) 2019-02-03 22:21:47 +09:00 committed by GitHub
parent 014b58cb40
commit ceda3dd72a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 2 deletions

7
src/@types/escape-regexp.d.ts vendored Normal file
View file

@ -0,0 +1,7 @@
declare module 'escape-regexp' {
function escapeRegExp(str: string): string;
namespace escapeRegExp {} // Hack
export = escapeRegExp;
}

View file

@ -1,7 +1,7 @@
import $ from 'cafy'; import $ from 'cafy';
import Hashtag from '../../../../models/hashtag'; import Hashtag from '../../../../models/hashtag';
import define from '../../define'; import define from '../../define';
const escapeRegexp = require('escape-regexp'); import * as escapeRegexp from 'escape-regexp';
export const meta = { export const meta = {
desc: { desc: {

View file

@ -1,5 +1,5 @@
import $ from 'cafy'; import $ from 'cafy';
const escapeRegexp = require('escape-regexp'); import * as escapeRegexp from 'escape-regexp';
import User, { pack, validateUsername, IUser } from '../../../../models/user'; import User, { pack, validateUsername, IUser } from '../../../../models/user';
import define from '../../define'; import define from '../../define';