Skip to content

Commit

Permalink
chore(functions): drop stoplight/types
Browse files Browse the repository at this point in the history
  • Loading branch information
P0lip committed Aug 22, 2022
1 parent 8287dde commit dc26584
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 6 deletions.
1 change: 0 additions & 1 deletion packages/functions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
"@stoplight/spectral-core": "^1.7.0",
"@stoplight/spectral-formats": "^1.0.0",
"@stoplight/spectral-runtime": "^1.1.0",
"@stoplight/types": "12.3.0",
"ajv": "^8.6.3",
"ajv-draft-04": "~1.0.0",
"ajv-errors": "~3.0.0",
Expand Down
3 changes: 1 addition & 2 deletions packages/functions/src/length.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import type { Optional } from '@stoplight/types';
import { createRulesetFunction, IFunctionResult } from '@stoplight/spectral-core';
import { printValue } from '@stoplight/spectral-runtime';
import { isPlainObject } from '@stoplight/json';
Expand Down Expand Up @@ -36,7 +35,7 @@ export default createRulesetFunction<unknown[] | Record<string, unknown> | strin
value = targetVal.length;
}

let results: Optional<IFunctionResult[]>;
let results: IFunctionResult[] | undefined;

if ('min' in opts && value < opts.min) {
results = [
Expand Down
3 changes: 1 addition & 2 deletions packages/functions/src/pattern.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import type { Optional } from '@stoplight/types';
import { createRulesetFunction, IFunctionResult } from '@stoplight/spectral-core';
import { printValue } from '@stoplight/spectral-runtime';

Expand Down Expand Up @@ -55,7 +54,7 @@ export default createRulesetFunction<string, Options>(
options: optionSchemas.pattern,
},
function pattern(targetVal, opts) {
let results: Optional<IFunctionResult[]>;
let results: IFunctionResult[] | undefined;

if ('match' in opts) {
const pattern = getFromCache(opts.match);
Expand Down
1 change: 0 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2447,7 +2447,6 @@ __metadata:
"@stoplight/spectral-formats": ^1.0.0
"@stoplight/spectral-parsers": "*"
"@stoplight/spectral-runtime": ^1.1.0
"@stoplight/types": 12.3.0
ajv: ^8.6.3
ajv-draft-04: ~1.0.0
ajv-errors: ~3.0.0
Expand Down

0 comments on commit dc26584

Please sign in to comment.