Skip to content

Commit

Permalink
chore(deps): update definitelytyped (#20070)
Browse files Browse the repository at this point in the history
  • Loading branch information
renovate[bot] committed May 9, 2024
1 parent db9fd98 commit a722f48
Show file tree
Hide file tree
Showing 9 changed files with 56 additions and 49 deletions.
62 changes: 31 additions & 31 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Expand Up @@ -82,11 +82,11 @@
"devDependencies": {
"@colors/colors": "1.6.0",
"@tsconfig/node14": "14.1.2",
"@types/chai": "4.3.15",
"@types/chai": "4.3.16",
"@types/chai-as-promised": "7.1.8",
"@types/diff": "5.2.0",
"@types/diff": "5.2.1",
"@types/mocha": "10.0.6",
"@types/node": "20.12.8",
"@types/node": "20.12.11",
"@types/semver": "7.5.8",
"@types/sinon": "17.0.3",
"@types/sinon-chai": "3.2.12",
Expand Down
4 changes: 2 additions & 2 deletions packages/appium/lib/grid-register.js
Expand Up @@ -57,13 +57,13 @@ function postRequest(configHolder, addr, port, basePath) {
// Move Selenium 3 configuration properties to configuration object
if (!_.has(configHolder, 'configuration')) {
let configuration = {};
for (const property in configHolder) {
for (const property in /** @type {import('@appium/types').StringRecord} */ (configHolder)) {
if (_.has(configHolder, property) && property !== 'capabilities') {
configuration[property] = configHolder[property];
delete configHolder[property];
}
}
configHolder.configuration = configuration;
/** @type {import('@appium/types').StringRecord} */ (configHolder).configuration = configuration;
}

// if the node config does not have the appium/webdriver url, host, and port,
Expand Down
16 changes: 10 additions & 6 deletions packages/base-driver/lib/jsonwp-proxy/protocol-converter.js
Expand Up @@ -134,21 +134,25 @@ class ProtocolConverter {
const bodyObj = util.safeJsonParse(body);
if (_.isPlainObject(bodyObj)) {
if (this.downstreamProtocol === W3C && _.has(bodyObj, 'name') && !_.has(bodyObj, 'handle')) {
this.log.debug(`Copied 'name' value '${bodyObj.name}' to 'handle' as per W3C spec`);
this.log.debug(
`Copied 'name' value '${/** @type {import('@appium/types').StringRecord} */ (bodyObj).name}' to 'handle' as per W3C spec`
);
return await this.proxyFunc(url, method, {
...bodyObj,
handle: bodyObj.name,
.../** @type {import('@appium/types').StringRecord} */ (bodyObj),
handle: /** @type {import('@appium/types').StringRecord} */ (bodyObj).name,
});
}
if (
this.downstreamProtocol === MJSONWP &&
_.has(bodyObj, 'handle') &&
!_.has(bodyObj, 'name')
) {
this.log.debug(`Copied 'handle' value '${bodyObj.handle}' to 'name' as per JSONWP spec`);
this.log.debug(
`Copied 'handle' value '${/** @type {import('@appium/types').StringRecord} */ (bodyObj).handle}' to 'name' as per JSONWP spec`
);
return await this.proxyFunc(url, method, {
...bodyObj,
name: bodyObj.handle,
.../** @type {import('@appium/types').StringRecord} */ (bodyObj),
name: /** @type {import('@appium/types').StringRecord} */ (bodyObj).handle,
});
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/base-driver/package.json
Expand Up @@ -50,7 +50,7 @@
"@types/async-lock": "1.4.2",
"@types/bluebird": "3.5.42",
"@types/express": "4.17.21",
"@types/lodash": "4.17.0",
"@types/lodash": "4.17.1",
"@types/method-override": "0.0.35",
"@types/serve-favicon": "2.5.7",
"async-lock": "1.4.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/driver-test-support/package.json
Expand Up @@ -42,7 +42,7 @@
"types": "./build/lib/index.d.ts",
"dependencies": {
"@appium/types": "^0.17.0",
"@types/lodash": "4.17.0",
"@types/lodash": "4.17.1",
"@types/stoppable": "1.1.3",
"axios": "1.6.8",
"bluebird": "3.7.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/fake-driver/lib/commands/element.ts
Expand Up @@ -122,7 +122,7 @@ const ElementsMixin: FakeDriverElementsMixin = {
async getCssProperty(this: FakeDriver, prop: string, elementId: string) {
this.assertWebviewContext();
const el = this.getElement(elementId);
return el.getCss(prop);
return el.getCss(prop) ?? '';
},

async getLocation(this: FakeDriver, elementId: string) {
Expand Down
4 changes: 2 additions & 2 deletions packages/fake-driver/test/e2e/element-interaction-tests.js
Expand Up @@ -102,9 +102,9 @@ function elementTests() {
let {elementId} = await driver.$('body');
(await driver.getElementCSSValue(elementId, 'background-color')).should.equal('#000');
});
it('should return null for an unspecified css property', async function () {
it('should return empty string for an unspecified css property', async function () {
let {elementId} = await driver.$('body');
should.equal(await driver.getElementCSSValue(elementId, 'font-size'), null);
should.equal(await driver.getElementCSSValue(elementId, 'font-size'), '');
});
});
}
Expand Down
7 changes: 5 additions & 2 deletions packages/support/lib/util.js
Expand Up @@ -122,8 +122,11 @@ function multiResolve(roots, ...args) {
return roots.map((root) => path.resolve(root, ...args));
}

/*
/**
* Parses an object if possible. Otherwise returns the object without parsing.
*
* @param {any} obj
* @returns {any}
*/
function safeJsonParse(obj) {
try {
Expand Down Expand Up @@ -178,7 +181,7 @@ function jsonStringify(obj, replacer = null, space = 2) {
function unwrapElement(el) {
for (const propName of [W3C_WEB_ELEMENT_IDENTIFIER, 'ELEMENT']) {
if (_.has(el, propName)) {
return el[propName];
return /** @type {string} */ (el[propName]);
}
}
return /** @type {string} */(el);
Expand Down

0 comments on commit a722f48

Please sign in to comment.