-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Magic Overhaul #966
Magic Overhaul #966
Conversation
@@ -26,7 +26,7 @@ export function ipv4CidrRange(cidr, includeNetworkInfo, enumerateAddresses, allo | |||
let output = ""; | |||
|
|||
if (cidrRange < 0 || cidrRange > 31) { | |||
return "IPv4 CIDR must be less than 32"; | |||
throw new OperationError("IPv4 CIDR must be less than 32"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You've changed the return behaviour of this function, please update the function doc comment to reflect this. (I know this is WIP)
*/ | ||
checkOutputFromPrevious() { | ||
let score = 0; | ||
if ("regex" in this.prevOp.output) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This in
operator usage looks way cleaner than the Object.prototype.hasOwnProperty.call(object, key)
call. Please just do a mental check each time you use it to make sure you won't be hitting on something up the object's prototype chain. See inherited properties here for more info. (I can't see any bad uses here)
Currently reviewing this and making some changes. Don't push any more updates. |
An overhaul of the magic operation.
It's to extend the functionality of Magic by adding the following to each operation, where appropriate: