Skip to content

Commit

Permalink
Upgrade dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed Nov 28, 2020
1 parent bbe9c23 commit 144cfc4
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 19 deletions.
23 changes: 10 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,34 +48,31 @@
"object"
],
"dependencies": {
"type-fest": "^0.18.0"
"type-fest": "^0.20.2"
},
"devDependencies": {
"@sindresorhus/is": "^4.0.0",
"@sindresorhus/tsconfig": "^0.7.0",
"@sindresorhus/tsconfig": "^0.8.0",
"@types/lodash.isequal": "^4.5.5",
"@types/node": "^14.14.6",
"@types/node": "^14.14.10",
"@types/vali-date": "^1.0.0",
"@typescript-eslint/eslint-plugin": "^4.6.0",
"@typescript-eslint/parser": "^4.6.0",
"add-asset-webpack-plugin": "^1.0.0",
"add-asset-webpack-plugin": "^2.0.0",
"add-module-exports-webpack-plugin": "^2.0.0",
"ava": "^2.0.0",
"awesome-typescript-loader": "^5.2.1",
"callsites": "^3.1.0",
"codecov": "^3.8.0",
"codecov": "^3.8.1",
"del-cli": "^3.0.1",
"dot-prop": "^6.0.0",
"eslint-config-xo-typescript": "^0.35.0",
"dot-prop": "^6.0.1",
"license-webpack-plugin": "^2.3.1",
"lodash.isequal": "^4.5.0",
"nyc": "^15.1.0",
"typedoc": "^0.19.2",
"typescript": "~4.0.5",
"typescript": "~4.1.2",
"vali-date": "^1.0.0",
"webpack": "^5.3.1",
"webpack-cli": "^4.1.0",
"xo": "^0.34.1"
"webpack": "^5.8.0",
"webpack-cli": "^4.2.0",
"xo": "^0.35.0"
},
"browser": {
"./dist/source/utils/infer-label.js": "./dist/source/utils/infer-label.browser.js"
Expand Down
6 changes: 3 additions & 3 deletions source/predicates/predicate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export class Predicate<T = unknown> implements BasePredicate<T> {
...this.options
};

const x = this.type[0].toLowerCase() + this.type.slice(1);
const typeString = this.type.charAt(0).toLowerCase() + this.type.slice(1);

this.addValidator({
message: (value, label) => {
Expand All @@ -88,7 +88,7 @@ export class Predicate<T = unknown> implements BasePredicate<T> {
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
return `Expected ${label_ || 'argument'} to be of type \`${this.type}\` but received type \`${is(value)}\``;
},
validator: value => (is as any)[x](value)
validator: value => (is as any)[typeString](value)
});
}

Expand Down Expand Up @@ -195,7 +195,7 @@ export class Predicate<T = unknown> implements BasePredicate<T> {
message(newMessage: string | ValidatorMessageBuilder<T>) {
const {validators} = this.context;

validators[validators.length - 1].message = (value, label) => {
validators[validators.length - 1]!.message = (value, label) => {
if (typeof newMessage === 'function') {
return newMessage(value, label);
}
Expand Down
3 changes: 3 additions & 0 deletions source/utils/infer-label.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ export const inferLabel = (callsites: readonly CallSite[]) => {

// Grab the stackframe with the `ow` function call
const functionCallStackFrame = callsites[1];
if (!functionCallStackFrame) {
return;
}

const fileName = functionCallStackFrame.getFileName();
const lineNumber = functionCallStackFrame.getLineNumber();
Expand Down
2 changes: 1 addition & 1 deletion source/utils/match-shape.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export function exact(object: Record<string, any>, shape: Shape, parent?: string
}

if (objectKeys.size > 0) {
const firstKey = [...objectKeys.keys()][0];
const firstKey = [...objectKeys.keys()][0]!;
const label = parent ? `${parent}.${firstKey}` : firstKey;
return `Did not expect property \`${label}\` to exist, got \`${object[firstKey]}\``;
}
Expand Down
2 changes: 1 addition & 1 deletion test/weak-map.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ test('weakMap.hasKeys', t => {
}, 'Expected WeakMap to have keys `[{"rainbow":true}]`');

t.throws(() => {
ow(new WeakMap([[keys[0], 1], [keys[2], 3]]), ow.weakMap.hasKeys(...keys));
ow(new WeakMap([[keys[0]!, 1], [keys[2]!, 3]]), ow.weakMap.hasKeys(...keys));
}, 'Expected WeakMap to have keys `[{"x":2},{"x":4},{"x":5},{"x":6},{"x":7}]`');
});

Expand Down
2 changes: 1 addition & 1 deletion test/weak-set.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ test('weakSet.has', t => {
}, 'Expected WeakSet to have items `[{"rainbow":"🌈"}]`');

t.throws(() => {
ow(new WeakSet([keys[1], keys[3]]), ow.weakSet.has(...keys));
ow(new WeakSet([keys[1]!, keys[3]!]), ow.weakSet.has(...keys));
}, 'Expected WeakSet to have items `[{"x":1},{"x":3},{"x":5},{"x":6},{"x":7}]`');
});

Expand Down

0 comments on commit 144cfc4

Please sign in to comment.