Skip to content

Commit 032ed99

Browse files
authored
refactor: remove unused code (#12216)
1 parent c5ca178 commit 032ed99

File tree

74 files changed

+226
-1942
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+226
-1942
lines changed

eslint.config.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ const deferPackages = [
2626
'web3-utils',
2727
'web3-eth-abi',
2828
'@solana/web3.js',
29-
'@project-serum/sol-wallet-adapter',
3029
// add package names here.
3130
]
3231

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,6 @@
145145
"@ceramicnetwork/[email protected]": "patches/@[email protected]",
146146
"@types/[email protected]": "patches/@[email protected]",
147147
148-
"@project-serum/[email protected]": "patches/@[email protected]",
149148
"@types/[email protected]": "patches/@[email protected]",
150149
"@cyberlab/[email protected]": "patches/@[email protected]",
151150

packages/injected-script/main/intrinsic_blessed.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const MapIteratorPrototype: IterableIterator<any> = create(
2828
IteratorPrototype,
2929
getOwnPropertyDescriptors(getPrototypeOf(__map_iter__)),
3030
)
31-
export const ArrayIteratorPrototype: IterableIterator<any> = create(
31+
const ArrayIteratorPrototype: IterableIterator<any> = create(
3232
IteratorPrototype,
3333
getOwnPropertyDescriptors(getPrototypeOf(__array_iter__)),
3434
)

packages/injected-script/main/intrinsic_brand.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,4 @@ export function isWindow(item: unknown): item is Window {
5858
return false
5959
}
6060
}
61-
export const { isArray } = Array
61+
const { isArray } = Array

packages/injected-script/main/intrinsic_content.ts

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ export const takeThisF: <Args extends readonly unknown[], This, Return>(
33
) => <AssignedThis extends This>(self: AssignedThis, ...args: Args) => Return = Function.prototype.bind.bind(
44
Function.prototype.call,
55
)
6-
export const takeThis: <Args extends readonly unknown[], This, Return>(
6+
const takeThis: <Args extends readonly unknown[], This, Return>(
77
f: (this: This, ...args: Args) => Return,
88
) => (self: This, ...args: Args) => Return = takeThisF
99
export const bind: {
@@ -19,18 +19,16 @@ export const bind: {
1919
// #region ECMAScript intrinsic
2020
// ECMAScript
2121
export const { String, Promise, Boolean } = globalThis
22-
export const getOwnPropertyDescriptor: <T, K extends keyof T>(object: T, key: K) => TypedPropertyDescriptor<T, T[K]> =
22+
const getOwnPropertyDescriptor: <T, K extends keyof T>(object: T, key: K) => TypedPropertyDescriptor<T, T[K]> =
2323
Object.getOwnPropertyDescriptor as any
2424
export const setPrototypeOf: <const T extends object>(o: T, proto: object | null) => T = Object.setPrototypeOf
2525
export const { defineProperty, defineProperties, getOwnPropertyDescriptors, getPrototypeOf, create, freeze } = Object
26-
export const { deleteProperty } = Reflect
2726
export const apply: <Args extends readonly unknown[], This, Return>(
2827
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
2928
f: ((this: This, ...args: Args) => Return) | Function,
3029
thisArg: This,
3130
args: Readonly<Args> | IArguments,
3231
) => Return = Reflect.apply as any
33-
export const { parse: JSON_parse, stringify: JSON_stringify } = JSON
3432
export let hasOwn = Object.hasOwn
3533
if (!hasOwn) {
3634
const { hasOwnProperty } = Object.prototype
@@ -40,7 +38,6 @@ export const StringSplit = takeThisF(globalThis.String.prototype.split)<string>
4038
export const StringToLowerCase = takeThisF(globalThis.String.prototype.toLowerCase)<string>
4139
export const StringStartsWith = takeThisF(globalThis.String.prototype.startsWith)<string>
4240
export const StringEndsWith = takeThisF(globalThis.String.prototype.endsWith)<string>
43-
export const StringInclude = takeThisF(globalThis.String.prototype.includes)<string>
4441
export const ArrayFilter = takeThisF(globalThis.Array.prototype.filter)<readonly unknown[]>
4542
export const ArrayIncludes = takeThisF(globalThis.Array.prototype.includes)<readonly unknown[]>
4643
export const ArrayUnshift: <T>(self: T[], ...args: T[]) => number = takeThisF(globalThis.Array.prototype.unshift)
@@ -51,9 +48,8 @@ export const Uint8Array_from = globalThis.Uint8Array.from.bind(globalThis.Uint8A
5148
// #endregion
5249

5350
// #region DOM<EventTarget>
54-
export const { URL, Blob, File, DOMException, Event, ClipboardEvent, CustomEvent, InputEvent, EventTarget } = globalThis
51+
export const { URL, Blob, File, DOMException, Event, CustomEvent, EventTarget } = globalThis
5552
export const setTimeout = globalThis.setTimeout.bind(window)
56-
export const clearTimeout = globalThis.clearTimeout.bind(window)
5753
export const addEventListener = takeThisF(EventTarget.prototype.addEventListener)<EventTarget>
5854
export const removeEventListener = takeThisF(EventTarget.prototype.removeEventListener)<EventTarget>
5955
export const dispatchEvent = takeThisF(EventTarget.prototype.dispatchEvent)
@@ -115,8 +111,6 @@ export const NodeList_forEach = takeThisF(NodeList.prototype.forEach)<NodeList>
115111
// #endregion
116112

117113
// #region Firefox magic
118-
export const wrapXRayVision: <const T extends object>(val: T) => T =
119-
typeof XPCNativeWrapper !== 'undefined' ? XPCNativeWrapper : Object
120114
export const isFirefox = typeof XPCNativeWrapper !== 'undefined'
121115
// #endregion
122116
interface TypedPropertyDescriptor<T, V> {

packages/injected-script/main/intrinsic_unsafe.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export const structuredCloneFromSafeReal: <T extends object>(value: T) => T =
2424
: globalThis.structuredClone || globalThis.Object
2525
export const unwrapXRayVision: <const T extends object>(value: T) => T =
2626
typeof XPCNativeWrapper !== 'undefined' ? XPCNativeWrapper.unwrap.bind(XPCNativeWrapper) : window.Object
27-
export const empty: NullPrototype = unwrapXRayVision(structuredCloneFromSafe({ __proto__: null }))
27+
const empty: NullPrototype = unwrapXRayVision(structuredCloneFromSafe({ __proto__: null }))
2828
window.Object.freeze(empty)
2929
// TODO: use the original info?
3030
export const expose: <T extends (...args: any[]) => any>(f: T, original?: T) => T =

packages/injected-script/main/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,5 +87,5 @@ export function isTwitter() {
8787
)
8888
}
8989

90-
export function noop() {}
90+
function noop() {}
9191
Object.freeze(noop)

packages/mask/content-script/site-adaptors/twitter.com/injection/NameWidget/index.tsx

Lines changed: 0 additions & 9 deletions
This file was deleted.

packages/mask/content-script/site-adaptors/twitter.com/injection/NameWidget/injectNameWidgetOnPost.tsx

Lines changed: 0 additions & 78 deletions
This file was deleted.

packages/mask/content-script/site-adaptors/twitter.com/injection/NameWidget/injectNameWidgetOnProfile.tsx

Lines changed: 0 additions & 59 deletions
This file was deleted.

0 commit comments

Comments
 (0)