Skip to content

Commit 9e6e682

Browse files
committed
Remove superfluous dependencies
1 parent 23f8c6d commit 9e6e682

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

Diff for: index.js

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
'use strict'
22

3-
var array = require('isarray')
4-
var regexp = require('is-regex')
53
var visit = require('unist-util-visit-parents')
64
var is = require('hast-util-is-element')
75
var escape = require('escape-string-regexp')
@@ -16,7 +14,10 @@ function findAndReplace(tree, find, replace, options) {
1614
var settings
1715
var schema
1816

19-
if (typeof find === 'string' || regexp(find)) {
17+
if (
18+
typeof find === 'string' ||
19+
(find && typeof find.lastIndex === 'number')
20+
) {
2021
schema = [[find, replace]]
2122
} else {
2223
schema = find
@@ -147,7 +148,7 @@ function toPairs(schema) {
147148
throw new Error('Expected array or object as schema')
148149
}
149150

150-
if (array(schema)) {
151+
if ('length' in schema) {
151152
length = schema.length
152153
index = -1
153154

Diff for: package.json

-2
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@
2929
"dependencies": {
3030
"escape-string-regexp": "^2.0.0",
3131
"hast-util-is-element": "^1.0.0",
32-
"is-regex": "^1.0.0",
33-
"isarray": "^2.0.0",
3432
"unist-util-visit-parents": "^3.0.0"
3533
},
3634
"devDependencies": {

0 commit comments

Comments
 (0)