@lvce-editor/test-worker 13.26.0 → 13.27.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/api.d.ts CHANGED
@@ -36,7 +36,7 @@ export declare class Locator implements ILocatorExternal {
36
36
  readonly _selector: any;
37
37
  readonly _nth: number;
38
38
  readonly _hasText: string;
39
- constructor(selector: any, { hasText, nth }?: ILocatorCreateOptions);
39
+ constructor(selector: any, options?: ILocatorCreateOptions);
40
40
  click({ button }?: {
41
41
  readonly button?: string;
42
42
  }): Promise<void>;
@@ -1218,7 +1218,9 @@ const get = id => {
1218
1218
  };
1219
1219
 
1220
1220
  const getLocatorInvoke = locator => {
1221
+ // @ts-ignore
1221
1222
  if (locator.webViewId) {
1223
+ // @ts-ignore
1222
1224
  const module = get(locator.webViewId);
1223
1225
  return module.invoke;
1224
1226
  }
@@ -1562,10 +1564,16 @@ const toButtonNumber = buttonType => {
1562
1564
  };
1563
1565
 
1564
1566
  class Locator {
1565
- constructor(selector, {
1566
- hasText = '',
1567
- nth = -1
1568
- } = {}) {
1567
+ constructor(selector, options = {}) {
1568
+ if (!options || typeof options !== 'object' || Array.isArray(options)) {
1569
+ throw new TypeError('options must be of type object');
1570
+ }
1571
+ const {
1572
+ hasText = '',
1573
+ nth = -1
1574
+ } = options;
1575
+ string(hasText, 'options.hasText must be of type string');
1576
+ number(nth, 'options.nth must be of type number');
1569
1577
  this._selector = selector;
1570
1578
  this._nth = nth;
1571
1579
  this._hasText = hasText;
@@ -1619,6 +1627,7 @@ class Locator {
1619
1627
  }
1620
1628
 
1621
1629
  const createLocator = (selector, options = {}) => {
1630
+ string(selector, 'selector must be of type string');
1622
1631
  return new Locator(selector, options);
1623
1632
  };
1624
1633
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/test-worker",
3
- "version": "13.26.0",
3
+ "version": "13.27.0",
4
4
  "description": "Test Worker",
5
5
  "repository": {
6
6
  "type": "git",