Skip to content

Commit df1246f

Browse files
authored
fix: remove lodash and define isString locally (#442)
* fix: remove lodash and define isString locally * fix: remove @types/lodash
1 parent 734f336 commit df1246f

2 files changed

Lines changed: 3 additions & 8 deletions

File tree

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@
5353
"@stylistic/eslint-plugin": "^4.4.1",
5454
"@terrestris/eslint-config-typescript": "^9.0.0",
5555
"@types/jest": "^29.5.14",
56-
"@types/lodash": "^4.17.17",
5756
"@typescript-eslint/eslint-plugin": "^8.33.1",
5857
"@vitejs/plugin-react": "^4.5.1",
5958
"@vitest/coverage-v8": "^3.2.1",

src/CqlParser.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,6 @@ import {
44
isOperator
55
} from 'geostyler-style';
66

7-
import {
8-
isString as _isString,
9-
isNumber as _isNumber,
10-
isNaN as _isNaN
11-
} from 'lodash';
12-
137
import './cql-parser.cjs';
148

159
import { CombinationOperator, Expression, Filter, Operator, PropertyType } from 'geostyler-style/dist/style';
@@ -34,6 +28,8 @@ type PrecedenceMap = {
3428
[name: string]: 1 | 2 | 3;
3529
};
3630

31+
const isString = (value: any) => typeof value === 'string';
32+
3733
export class CqlParser {
3834

3935
tokens: PatternName[] = [
@@ -158,7 +154,7 @@ export class CqlParser {
158154
case '<=':
159155
case '>':
160156
case '>=':
161-
const valueIsString = _isString(f[2]);
157+
const valueIsString = isString(f[2]);
162158
let value = f[2];
163159
if (valueIsString) {
164160
value = `'${value}'`;

0 commit comments

Comments
 (0)