-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Continue to wire-up inlined overrides
- Loading branch information
Showing
16 changed files
with
274 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
declare function callBoundIntrinsic( | ||
name: 'RegExp.prototype.test', | ||
allowMissing?: boolean | ||
): (regex: RegExp, str: string) => boolean | ||
): (regex: RegExp, str: string) => ReturnType<typeof RegExp.prototype.test> | ||
declare function callBoundIntrinsic( | ||
name: string, | ||
allowMissing?: boolean | ||
): undefined | ||
export = callBoundIntrinsic |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2024 Socket Inc | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
21 changes: 21 additions & 0 deletions
21
packages/npm/deep-equal/overrides/call-bind/LICENSE.original
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2020 Jordan Harband | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
45 changes: 45 additions & 0 deletions
45
packages/npm/deep-equal/overrides/call-bind/callBound.d.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
declare function callBoundIntrinsic( | ||
name: 'Date.prototype.getTime', | ||
allowMissing?: boolean | ||
): (date: Date) => ReturnType<typeof Date.prototype.getTime> | ||
declare function callBoundIntrinsic( | ||
name: 'Map.prototype.get', | ||
allowMissing?: boolean | ||
): (map: Map<any, any>, key: any) => ReturnType<typeof Map.prototype.get> | ||
declare function callBoundIntrinsic( | ||
name: 'Map.prototype.has', | ||
allowMissing?: boolean | ||
): (map: Map<any, any>, key: any) => ReturnType<typeof Map.prototype.has> | ||
declare function callBoundIntrinsic( | ||
name: 'Map.prototype.size', | ||
allowMissing?: boolean | ||
): (map: Map<any, any>) => typeof Map.prototype.size | ||
declare function callBoundIntrinsic( | ||
name: 'Object.prototype.toString', | ||
allowMissing?: boolean | ||
): (obj: any) => ReturnType<typeof Object.prototype.toString> | ||
declare function callBoundIntrinsic( | ||
name: 'Set.prototype.add', | ||
allowMissing?: boolean | ||
): (set: Set<any>, value: any) => ReturnType<typeof Set.prototype.add> | ||
declare function callBoundIntrinsic( | ||
name: 'Set.prototype.delete', | ||
allowMissing?: boolean | ||
): (set: Set<any>, value: any) => ReturnType<typeof Set.prototype.delete> | ||
declare function callBoundIntrinsic( | ||
name: 'Set.prototype.has', | ||
allowMissing?: boolean | ||
): (set: Set<any>, value: any) => ReturnType<typeof Set.prototype.has> | ||
declare function callBoundIntrinsic( | ||
name: 'Set.prototype.size', | ||
allowMissing?: boolean | ||
): (set: Set<any>) => typeof Set.prototype.size | ||
declare function callBoundIntrinsic( | ||
name: 'SharedArrayBuffer.prototype.byteLength', | ||
allowMissing?: boolean | ||
): (sab: SharedArrayBuffer) => typeof SharedArrayBuffer.prototype.byteLength | ||
declare function callBoundIntrinsic( | ||
name: string, | ||
allowMissing?: boolean | ||
): undefined | ||
export = callBoundIntrinsic |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,63 +1,81 @@ | ||
'use strict' | ||
|
||
const { getTime: DateProtoGetTime } = Date.prototype | ||
const { get: MapProtoGet, has: MapProtoHas } = Map.prototype | ||
const MapProtoSizeGetter = Map.prototype.__lookupGetter__('size') | ||
const { toString: objToStr } = Object.prototype | ||
|
||
function noop() {} | ||
const { apply: ReflectApply } = Reflect | ||
const { | ||
add: SetProtoAdd, | ||
delete: SetProtoDelete, | ||
has: SetProtoHas | ||
} = Set.prototype | ||
const SetProtoSizeGetter = Set.prototype.__lookupGetter__('size') | ||
const SharedArrayBufferByteLengthGetter = | ||
SharedArrayBuffer.prototype.__lookupGetter__('byteLength') | ||
|
||
function dateProtoGetTime(date) { | ||
return date.getTime() | ||
} | ||
|
||
function mapOrSetProtoDelete(mos, key) { | ||
return mos.delete(key) | ||
return ReflectApply(DateProtoGetTime, date, []) | ||
} | ||
|
||
function mapOrSetProtoHas(mos, key) { | ||
return mos.has(key) | ||
function mapProtoGet(map, key) { | ||
return ReflectApply(MapProtoGet, map, [key]) | ||
} | ||
|
||
function mapOrSetProtoGet(mos, key) { | ||
return mos.get(key) | ||
function mapProtoHas(map, key) { | ||
return ReflectApply(MapProtoHas, map, [key]) | ||
} | ||
|
||
function mapOrSetProtoSize(mos) { | ||
return mos.size | ||
function mapProtoSize(map) { | ||
return ReflectApply(MapProtoSizeGetter, map, []) | ||
} | ||
|
||
function objectProtoToString(object) { | ||
return objToStr.call(object) | ||
return ReflectApply(objToStr, object, []) | ||
} | ||
|
||
function sabProtoByteLength(sab) { | ||
return sab.byteLength | ||
function sharedArrayBufferProtoByteLength(sab) { | ||
return ReflectApply(SharedArrayBufferByteLengthGetter, sab, []) | ||
} | ||
|
||
function setProtoAdd(set, value) { | ||
return set.add(value) | ||
return ReflectApply(SetProtoAdd, set, [value]) | ||
} | ||
|
||
function setProtoDelete(set, key) { | ||
return ReflectApply(SetProtoDelete, set, [key]) | ||
} | ||
|
||
function setProtoHas(set, key) { | ||
return ReflectApply(SetProtoHas, set, [key]) | ||
} | ||
|
||
function setProtoSize(set) { | ||
return ReflectApply(SetProtoSizeGetter, set, []) | ||
} | ||
|
||
module.exports = function callBoundIntrinsic(name, _allowMissing) { | ||
switch (name) { | ||
case 'Date.prototype.getTime': | ||
return dateProtoGetTime | ||
case 'Map.prototype.has': | ||
return mapOrSetProtoHas | ||
case 'Map.prototype.get': | ||
return mapOrSetProtoGet | ||
return mapProtoGet | ||
case 'Map.prototype.has': | ||
return mapProtoHas | ||
case 'Map.prototype.size': | ||
return mapOrSetProtoSize | ||
return mapProtoSize | ||
case 'Object.prototype.toString': | ||
return objectProtoToString | ||
case 'SharedArrayBuffer.prototype.byteLength': | ||
return sabProtoByteLength | ||
case 'Set.prototype.add': | ||
return setProtoAdd | ||
case 'Set.prototype.delete': | ||
return mapOrSetProtoDelete | ||
return setProtoDelete | ||
case 'Set.prototype.has': | ||
return mapOrSetProtoHas | ||
return setProtoHas | ||
case 'Set.prototype.size': | ||
return mapOrSetProtoSize | ||
return setProtoSize | ||
case 'SharedArrayBuffer.prototype.byteLength': | ||
return sharedArrayBufferProtoByteLength | ||
} | ||
return noop | ||
return undefined | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/* empty */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/* empty */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
{ | ||
"name": "@socketregistry/deep-equal", | ||
"version": "1.0.3-overrides-call-bind", | ||
"license": "MIT", | ||
"description": "Socket.dev optimized package override for deep-equal/call-bind", | ||
"keywords": [ | ||
"Socket.dev", | ||
"package-overrides" | ||
], | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/SocketDev/socket-registry-js.git", | ||
"directory": "packages/npm/deep-equal/overrides/call-bind" | ||
}, | ||
"exports": { | ||
".": { | ||
"types": "./index.d.ts", | ||
"default": "./index.js" | ||
}, | ||
"./callBound": { | ||
"types": "./callBound.d.ts", | ||
"default": "./callBound.js" | ||
}, | ||
"./package.json": "./package.json" | ||
}, | ||
"sideEffects": false, | ||
"engines": { | ||
"node": ">=18.20.4" | ||
}, | ||
"files": [ | ||
"*.d.ts", | ||
"*.js" | ||
], | ||
"socket": { | ||
"categories": [ | ||
"cleanup" | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2024 Socket Inc | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
21 changes: 21 additions & 0 deletions
21
packages/npm/deep-equal/overrides/get-intrinsic/LICENSE.original
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2020 Jordan Harband | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
declare function GetIntrinsic( | ||
name: '%Set%', | ||
allowMissing?: boolean | ||
): SetConstructor | ||
declare function GetIntrinsic(name: string, allowMissing?: boolean): undefined |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
'use strict' | ||
|
||
const SetCtor = Set | ||
|
||
module.exports = function GetIntrinsic(name, _allowMissing) { | ||
return name === '%Set%' ? Set : undefined | ||
return name === '%Set%' ? SetCtor : undefined | ||
} |
35 changes: 35 additions & 0 deletions
35
packages/npm/deep-equal/overrides/get-intrinsic/package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
{ | ||
"name": "@socketregistry/deep-equal", | ||
"version": "1.0.3-overrides-get-intrinsic", | ||
"license": "MIT", | ||
"description": "Socket.dev optimized package override for deep-equal/get-intrinsic", | ||
"keywords": [ | ||
"Socket.dev", | ||
"package-overrides" | ||
], | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/SocketDev/socket-registry-js.git", | ||
"directory": "packages/npm/deep-equal/overrides/get-intrinsic" | ||
}, | ||
"exports": { | ||
".": { | ||
"types": "./index.d.ts", | ||
"default": "./index.js" | ||
}, | ||
"./package.json": "./package.json" | ||
}, | ||
"sideEffects": false, | ||
"engines": { | ||
"node": ">=18.20.4" | ||
}, | ||
"files": [ | ||
"*.d.ts", | ||
"*.js" | ||
], | ||
"socket": { | ||
"categories": [ | ||
"cleanup" | ||
] | ||
} | ||
} |
Oops, something went wrong.