Skip to content

Commit

Permalink
fix: tests pass
Browse files Browse the repository at this point in the history
  • Loading branch information
westeezy committed Nov 22, 2022
1 parent 4b6f357 commit 74e861f
Show file tree
Hide file tree
Showing 14 changed files with 117 additions and 131 deletions.
10 changes: 10 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,15 @@ module.exports = {
rules: {
"keyword-spacing": "off",
"@typescript-eslint/keyword-spacing": "off",

// off for initial ts conversion
// Implicit any in catch clause
"@typescript-eslint/no-implicit-any-catch": "off",
// Prefer using an optional chain expression instead, as it's more concise and easier to read
"@typescript-eslint/prefer-optional-chain": "off",
// Prefer using nullish coalescing operator (`??`) instead of a logical or (`||`), as it is a safer operator
"@typescript-eslint/prefer-nullish-coalescing": "off",
// Generic Object Injection Sink
"security/detect-object-injection": "off",
},
};
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
"description": "Utilities for dealing with cross-domain windows.",
"main": "dist/cross-domain-utils.js",
"module": "dist/index.js",
"types": "dist/types/index.d.ts",
"types": "dist/esm/index.d.ts",
"sideEffects": false,
"scripts": {
"build": "npm run test && npm run babel && npm run webpack && npm run build:types",
"build:flow": "find ./dist -type f -not -path './node_modules/*' -name '*.d.ts' -exec sh -c 'flowgen --add-flow-header $1 -o ${1%.*.*}.js.flow' _ '{}' \\;",
"build:tsc": "tsc src/* --outDir ./dist/esm --declaration --emitDeclarationOnly",
"build:tsc": "tsc src/* --outDir ./dist/esm --declaration --emitDeclarationOnly --strict",
"build:types": "npm run build:tsc && npm run build:flow",
"webpack": "cross-env NODE_ENV=production babel-node --plugins=transform-es2015-modules-commonjs ./node_modules/.bin/webpack --progress --output-path dist",
"babel": "cross-env NODE_ENV=production babel src/ --out-dir ./dist/esm/ --extensions .ts,.tsx",
Expand Down
4 changes: 2 additions & 2 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ export type SameDomainWindowType = Omit<

export type DomainMatcher =
| string
| ReadonlyArray<string>
| ReadonlyArray<string>
| readonly string[]
| readonly string[]
| RegExp;
3 changes: 2 additions & 1 deletion src/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ export function isRegex(item: unknown): boolean {
return Object.prototype.toString.call(item) === "[object RegExp]";
}

export function noop(...args: ReadonlyArray<unknown>): void {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
export function noop(...args: readonly unknown[]): void {
// pass
}
Loading

0 comments on commit 74e861f

Please sign in to comment.