Best JavaScript code snippet using mountebank
mode-powershell.js
Source:mode-powershell.js
1define("ace/mode/powershell_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) {2"use strict";3var oop = require("../lib/oop");4var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;5var PowershellHighlightRules = function() {6 var keywords = (7 "begin|break|catch|continue|data|do|dynamicparam|else|elseif|end|exit|filter|" +8 "finally|for|foreach|from|function|if|in|inlinescript|hidden|parallel|param|" +9 "process|return|sequence|switch|throw|trap|try|until|while|workflow"10 );11 var builtinFunctions = (12 "Get-AppBackgroundTask|Start-AppBackgroundTask|Unregister-AppBackgroundTask|Disable-AppBackgroundTaskDiagnosticLog|Enable-AppBackgroundTaskDiagnosticLog|Set-AppBackgroundTaskResourcePolicy|" +13 "Get-AppLockerFileInformation|Get-AppLockerPolicy|New-AppLockerPolicy|Set-AppLockerPolicy|Test-AppLockerPolicy|" +14 "Get-AppxLastError|Get-AppxLog|Add-AppxPackage|Add-AppxVolume|Dismount-AppxVolume|Get-AppxDefaultVolume|Get-AppxPackage|Get-AppxPackageManifest|Get-AppxVolume|Mount-AppxVolume|Move-AppxPackage|Remove-AppxPackage|Remove-AppxVolume|Set-AppxDefaultVolume|" +15 "Clear-AssignedAccess|Get-AssignedAccess|Set-AssignedAccess|" +16 "Add-BitLockerKeyProtector|Backup-BitLockerKeyProtector|Clear-BitLockerAutoUnlock|Disable-BitLocker|Disable-BitLockerAutoUnlock|Enable-BitLocker|Enable-BitLockerAutoUnlock|Get-BitLockerVolume|Lock-BitLocker|Remove-BitLockerKeyProtector|Resume-BitLocker|Suspend-BitLocker|Unlock-BitLocker|" +17 "Add-BitsFile|Complete-BitsTransfer|Get-BitsTransfer|Remove-BitsTransfer|Resume-BitsTransfer|Set-BitsTransfer|Start-BitsTransfer|Suspend-BitsTransfer|" +18 "Add-BCDataCacheExtension|Clear-BCCache|Disable-BC|Disable-BCDowngrading|Disable-BCServeOnBattery|Enable-BCDistributed|Enable-BCDowngrading|Enable-BCHostedClient|Enable-BCHostedServer|Enable-BCLocal|Enable-BCServeOnBattery|Export-BCCachePackage|Export-BCSecretKey|Get-BCClientConfiguration|Get-BCContentServerConfiguration|Get-BCDataCache|Get-BCDataCacheExtension|Get-BCHashCache|Get-BCHostedCacheServerConfiguration|Get-BCNetworkConfiguration|Get-BCStatus|Import-BCCachePackage|Import-BCSecretKey|Publish-BCFileContent|Publish-BCWebContent|Remove-BCDataCacheExtension|Reset-BC|Set-BCAuthentication|Set-BCCache|Set-BCDataCacheEntryMaxAge|Set-BCMinSMBLatency|Set-BCSecretKey|" +19 "Export-BinaryMiLog|Get-CimAssociatedInstance|Get-CimClass|Get-CimInstance|Get-CimSession|Import-BinaryMiLog|Invoke-CimMethod|New-CimInstance|New-CimSession|New-CimSessionOption|Register-CimIndicationEvent|Remove-CimInstance|Remove-CimSession|Set-CimInstance|" +20 "ConvertFrom-CIPolicy|" +21 "Add-SignerRule|Edit-CIPolicyRule|Get-CIPolicy|Get-CIPolicyInfo|Get-SystemDriver|Merge-CIPolicy|New-CIPolicy|New-CIPolicyRule|Remove-CIPolicyRule|Set-CIPolicyVersion|Set-HVCIOptions|Set-RuleOption|" +22 "Add-MpPreference|Get-MpComputerStatus|Get-MpPreference|Get-MpThreat|Get-MpThreatCatalog|Get-MpThreatDetection|Remove-MpPreference|Remove-MpThreat|Set-MpPreference|Start-MpScan|Start-MpWDOScan|Update-MpSignature|" +23 "Disable-DAManualEntryPointSelection|Enable-DAManualEntryPointSelection|Get-DAClientExperienceConfiguration|Get-DAEntryPointTableItem|New-DAEntryPointTableItem|Remove-DAEntryPointTableItem|Rename-DAEntryPointTableItem|Reset-DAClientExperienceConfiguration|Reset-DAEntryPointTableItem|Set-DAClientExperienceConfiguration|Set-DAEntryPointTableItem|" +24 "Add-ProvisionedAppxPackage|Apply-WindowsUnattend|Get-ProvisionedAppxPackage|Remove-ProvisionedAppxPackage|Add-AppxProvisionedPackage|Add-WindowsCapability|Add-WindowsDriver|Add-WindowsImage|Add-WindowsPackage|Clear-WindowsCorruptMountPoint|Disable-WindowsOptionalFeature|Dismount-WindowsImage|Enable-WindowsOptionalFeature|Expand-WindowsCustomDataImage|Expand-WindowsImage|Export-WindowsDriver|Export-WindowsImage|Get-AppxProvisionedPackage|Get-WIMBootEntry|Get-WindowsCapability|Get-WindowsDriver|Get-WindowsEdition|Get-WindowsImage|Get-WindowsImageContent|Get-WindowsOptionalFeature|Get-WindowsPackage|Mount-WindowsImage|New-WindowsCustomImage|New-WindowsImage|Optimize-WindowsImage|Remove-AppxProvisionedPackage|Remove-WindowsCapability|Remove-WindowsDriver|Remove-WindowsImage|Remove-WindowsPackage|Repair-WindowsImage|Save-WindowsImage|Set-AppXProvisionedDataFile|Set-WindowsEdition|Set-WindowsProductKey|Split-WindowsImage|Update-WIMBootEntry|Use-WindowsUnattend|" +25 "Add-DnsClientNrptRule|Clear-DnsClientCache|Get-DnsClient|Get-DnsClientCache|Get-DnsClientGlobalSetting|Get-DnsClientNrptGlobal|Get-DnsClientNrptPolicy|Get-DnsClientNrptRule|Get-DnsClientServerAddress|Register-DnsClient|Remove-DnsClientNrptRule|Set-DnsClient|Set-DnsClientGlobalSetting|Set-DnsClientNrptGlobal|Set-DnsClientNrptRule|Set-DnsClientServerAddress|Resolve-DnsName|" +26 "Add-EtwTraceProvider|Get-AutologgerConfig|Get-EtwTraceProvider|Get-EtwTraceSession|New-AutologgerConfig|New-EtwTraceSession|Remove-AutologgerConfig|Remove-EtwTraceProvider|Remove-EtwTraceSession|Send-EtwTraceSession|Set-AutologgerConfig|Set-EtwTraceProvider|Set-EtwTraceSession|" +27 "Get-WinAcceptLanguageFromLanguageListOptOut|Get-WinCultureFromLanguageListOptOut|Get-WinDefaultInputMethodOverride|Get-WinHomeLocation|Get-WinLanguageBarOption|Get-WinSystemLocale|Get-WinUILanguageOverride|Get-WinUserLanguageList|New-WinUserLanguageList|Set-Culture|Set-WinAcceptLanguageFromLanguageListOptOut|Set-WinCultureFromLanguageListOptOut|Set-WinDefaultInputMethodOverride|Set-WinHomeLocation|Set-WinLanguageBarOption|Set-WinSystemLocale|Set-WinUILanguageOverride|Set-WinUserLanguageList|" +28 "Connect-IscsiTarget|Disconnect-IscsiTarget|Get-IscsiConnection|Get-IscsiSession|Get-IscsiTarget|Get-IscsiTargetPortal|New-IscsiTargetPortal|Register-IscsiSession|Remove-IscsiTargetPortal|Set-IscsiChapSecret|Unregister-IscsiSession|Update-IscsiTarget|Update-IscsiTargetPortal|" +29 "Get-IseSnippet|Import-IseSnippet|New-IseSnippet|" +30 "Add-KdsRootKey|Clear-KdsCache|Get-KdsConfiguration|Get-KdsRootKey|Set-KdsConfiguration|Test-KdsRootKey|" +31 "Compress-Archive|Expand-Archive|" +32 "Export-Counter|Get-Counter|Get-WinEvent|Import-Counter|New-WinEvent|" +33 "Start-Transcript|Stop-Transcript|" +34 "Add-Computer|Add-Content|Checkpoint-Computer|Clear-Content|Clear-EventLog|Clear-Item|Clear-ItemProperty|Clear-RecycleBin|Complete-Transaction|Convert-Path|Copy-Item|Copy-ItemProperty|Debug-Process|Disable-ComputerRestore|Enable-ComputerRestore|Get-ChildItem|Get-Clipboard|Get-ComputerRestorePoint|Get-Content|Get-ControlPanelItem|Get-EventLog|Get-HotFix|Get-Item|Get-ItemProperty|Get-ItemPropertyValue|Get-Location|Get-Process|Get-PSDrive|Get-PSProvider|Get-Service|Get-Transaction|Get-WmiObject|Invoke-Item|Invoke-WmiMethod|Join-Path|Limit-EventLog|Move-Item|Move-ItemProperty|New-EventLog|New-Item|New-ItemProperty|New-PSDrive|New-Service|New-WebServiceProxy|Pop-Location|Push-Location|Register-WmiEvent|Remove-Computer|Remove-EventLog|Remove-Item|Remove-ItemProperty|Remove-PSDrive|Remove-WmiObject|Rename-Computer|Rename-Item|Rename-ItemProperty|Reset-ComputerMachinePassword|Resolve-Path|Restart-Computer|Restart-Service|Restore-Computer|Resume-Service|Set-Clipboard|Set-Content|Set-Item|Set-ItemProperty|Set-Location|Set-Service|Set-WmiInstance|Show-ControlPanelItem|Show-EventLog|Split-Path|Start-Process|Start-Service|Start-Transaction|Stop-Computer|Stop-Process|Stop-Service|Suspend-Service|Test-ComputerSecureChannel|Test-Connection|Test-Path|Undo-Transaction|Use-Transaction|Wait-Process|Write-EventLog|" +35 "Export-ODataEndpointProxy|" +36 "ConvertFrom-SecureString|ConvertTo-SecureString|Get-Acl|Get-AuthenticodeSignature|Get-CmsMessage|Get-Credential|Get-ExecutionPolicy|Get-PfxCertificate|Protect-CmsMessage|Set-Acl|Set-AuthenticodeSignature|Set-ExecutionPolicy|Unprotect-CmsMessage|" +37 "ConvertFrom-SddlString|Format-Hex|Get-FileHash|Import-PowerShellDataFile|New-Guid|New-TemporaryFile|Add-Member|Add-Type|Clear-Variable|Compare-Object|ConvertFrom-Csv|ConvertFrom-Json|ConvertFrom-String|ConvertFrom-StringData|Convert-String|ConvertTo-Csv|ConvertTo-Html|ConvertTo-Json|ConvertTo-Xml|Debug-Runspace|Disable-PSBreakpoint|Disable-RunspaceDebug|Enable-PSBreakpoint|Enable-RunspaceDebug|Export-Alias|Export-Clixml|Export-Csv|Export-FormatData|Export-PSSession|Format-Custom|Format-List|Format-Table|Format-Wide|Get-Alias|Get-Culture|Get-Date|Get-Event|Get-EventSubscriber|Get-FormatData|Get-Host|Get-Member|Get-PSBreakpoint|Get-PSCallStack|Get-Random|Get-Runspace|Get-RunspaceDebug|Get-TraceSource|Get-TypeData|Get-UICulture|Get-Unique|Get-Variable|Group-Object|Import-Alias|Import-Clixml|Import-Csv|Import-LocalizedData|Import-PSSession|Invoke-Expression|Invoke-RestMethod|Invoke-WebRequest|Measure-Command|Measure-Object|New-Alias|New-Event|New-Object|New-TimeSpan|New-Variable|Out-File|Out-GridView|Out-Printer|Out-String|Read-Host|Register-EngineEvent|Register-ObjectEvent|Remove-Event|Remove-PSBreakpoint|Remove-TypeData|Remove-Variable|Select-Object|Select-String|Select-Xml|Send-MailMessage|Set-Alias|Set-Date|Set-PSBreakpoint|Set-TraceSource|Set-Variable|Show-Command|Sort-Object|Start-Sleep|Tee-Object|Trace-Command|Unblock-File|Unregister-Event|Update-FormatData|Update-List|Update-TypeData|Wait-Debugger|Wait-Event|Write-Debug|Write-Error|Write-Host|Write-Information|Write-Output|Write-Progress|Write-Verbose|Write-Warning|" +38 "Connect-WSMan|Disable-WSManCredSSP|Disconnect-WSMan|Enable-WSManCredSSP|Get-WSManCredSSP|Get-WSManInstance|Invoke-WSManAction|New-WSManInstance|New-WSManSessionOption|Remove-WSManInstance|Set-WSManInstance|Set-WSManQuickConfig|Test-WSMan|" +39 "Debug-MMAppPrelaunch|Disable-MMAgent|Enable-MMAgent|Get-MMAgent|Set-MMAgent|" +40 "Add-DtcClusterTMMapping|Get-Dtc|Get-DtcAdvancedHostSetting|Get-DtcAdvancedSetting|Get-DtcClusterDefault|Get-DtcClusterTMMapping|Get-DtcDefault|Get-DtcLog|Get-DtcNetworkSetting|Get-DtcTransaction|Get-DtcTransactionsStatistics|Get-DtcTransactionsTraceSession|Get-DtcTransactionsTraceSetting|Install-Dtc|Remove-DtcClusterTMMapping|Reset-DtcLog|Set-DtcAdvancedHostSetting|Set-DtcAdvancedSetting|Set-DtcClusterDefault|Set-DtcClusterTMMapping|Set-DtcDefault|Set-DtcLog|Set-DtcNetworkSetting|Set-DtcTransaction|Set-DtcTransactionsTraceSession|Set-DtcTransactionsTraceSetting|Start-Dtc|Start-DtcTransactionsTraceSession|Stop-Dtc|Stop-DtcTransactionsTraceSession|Test-Dtc|Uninstall-Dtc|Write-DtcTransactionsTraceSession|Complete-DtcDiagnosticTransaction|Join-DtcDiagnosticResourceManager|New-DtcDiagnosticTransaction|Receive-DtcDiagnosticTransaction|Send-DtcDiagnosticTransaction|Start-DtcDiagnosticResourceManager|Stop-DtcDiagnosticResourceManager|Undo-DtcDiagnosticTransaction|" +41 "Disable-NetAdapter|Disable-NetAdapterBinding|Disable-NetAdapterChecksumOffload|Disable-NetAdapterEncapsulatedPacketTaskOffload|Disable-NetAdapterIPsecOffload|Disable-NetAdapterLso|Disable-NetAdapterPacketDirect|Disable-NetAdapterPowerManagement|Disable-NetAdapterQos|Disable-NetAdapterRdma|Disable-NetAdapterRsc|Disable-NetAdapterRss|Disable-NetAdapterSriov|Disable-NetAdapterVmq|Enable-NetAdapter|Enable-NetAdapterBinding|Enable-NetAdapterChecksumOffload|Enable-NetAdapterEncapsulatedPacketTaskOffload|Enable-NetAdapterIPsecOffload|Enable-NetAdapterLso|Enable-NetAdapterPacketDirect|Enable-NetAdapterPowerManagement|Enable-NetAdapterQos|Enable-NetAdapterRdma|Enable-NetAdapterRsc|Enable-NetAdapterRss|Enable-NetAdapterSriov|Enable-NetAdapterVmq|Get-NetAdapter|Get-NetAdapterAdvancedProperty|Get-NetAdapterBinding|Get-NetAdapterChecksumOffload|Get-NetAdapterEncapsulatedPacketTaskOffload|Get-NetAdapterHardwareInfo|Get-NetAdapterIPsecOffload|Get-NetAdapterLso|Get-NetAdapterPacketDirect|Get-NetAdapterPowerManagement|Get-NetAdapterQos|Get-NetAdapterRdma|Get-NetAdapterRsc|Get-NetAdapterRss|Get-NetAdapterSriov|Get-NetAdapterSriovVf|Get-NetAdapterStatistics|Get-NetAdapterVmq|Get-NetAdapterVmqQueue|Get-NetAdapterVPort|New-NetAdapterAdvancedProperty|Remove-NetAdapterAdvancedProperty|Rename-NetAdapter|Reset-NetAdapterAdvancedProperty|Restart-NetAdapter|Set-NetAdapter|Set-NetAdapterAdvancedProperty|Set-NetAdapterBinding|Set-NetAdapterChecksumOffload|Set-NetAdapterEncapsulatedPacketTaskOffload|Set-NetAdapterIPsecOffload|Set-NetAdapterLso|Set-NetAdapterPacketDirect|Set-NetAdapterPowerManagement|Set-NetAdapterQos|Set-NetAdapterRdma|Set-NetAdapterRsc|Set-NetAdapterRss|Set-NetAdapterSriov|Set-NetAdapterVmq|" +42 "Get-NetConnectionProfile|Set-NetConnectionProfile|" +43 "Add-NetEventNetworkAdapter|Add-NetEventPacketCaptureProvider|Add-NetEventProvider|Add-NetEventVmNetworkAdapter|Add-NetEventVmSwitch|Add-NetEventWFPCaptureProvider|Get-NetEventNetworkAdapter|Get-NetEventPacketCaptureProvider|Get-NetEventProvider|Get-NetEventSession|Get-NetEventVmNetworkAdapter|Get-NetEventVmSwitch|Get-NetEventWFPCaptureProvider|New-NetEventSession|Remove-NetEventNetworkAdapter|Remove-NetEventPacketCaptureProvider|Remove-NetEventProvider|Remove-NetEventSession|Remove-NetEventVmNetworkAdapter|Remove-NetEventVmSwitch|Remove-NetEventWFPCaptureProvider|Set-NetEventPacketCaptureProvider|Set-NetEventProvider|Set-NetEventSession|Set-NetEventWFPCaptureProvider|Start-NetEventSession|Stop-NetEventSession|" +44 "Add-NetLbfoTeamMember|Add-NetLbfoTeamNic|Get-NetLbfoTeam|Get-NetLbfoTeamMember|Get-NetLbfoTeamNic|New-NetLbfoTeam|Remove-NetLbfoTeam|Remove-NetLbfoTeamMember|Remove-NetLbfoTeamNic|Rename-NetLbfoTeam|Set-NetLbfoTeam|Set-NetLbfoTeamMember|Set-NetLbfoTeamNic|" +45 "Add-NetNatExternalAddress|Add-NetNatStaticMapping|Get-NetNat|Get-NetNatExternalAddress|Get-NetNatGlobal|Get-NetNatSession|Get-NetNatStaticMapping|New-NetNat|Remove-NetNat|Remove-NetNatExternalAddress|Remove-NetNatStaticMapping|Set-NetNat|Set-NetNatGlobal|" +46 "Get-NetQosPolicy|New-NetQosPolicy|Remove-NetQosPolicy|Set-NetQosPolicy|" +47 "Copy-NetFirewallRule|Copy-NetIPsecMainModeCryptoSet|Copy-NetIPsecMainModeRule|Copy-NetIPsecPhase1AuthSet|Copy-NetIPsecPhase2AuthSet|Copy-NetIPsecQuickModeCryptoSet|Copy-NetIPsecRule|Disable-NetFirewallRule|Disable-NetIPsecMainModeRule|Disable-NetIPsecRule|Enable-NetFirewallRule|Enable-NetIPsecMainModeRule|Enable-NetIPsecRule|Find-NetIPsecRule|Get-NetFirewallAddressFilter|Get-NetFirewallApplicationFilter|Get-NetFirewallInterfaceFilter|Get-NetFirewallInterfaceTypeFilter|Get-NetFirewallPortFilter|Get-NetFirewallProfile|Get-NetFirewallRule|Get-NetFirewallSecurityFilter|Get-NetFirewallServiceFilter|Get-NetFirewallSetting|Get-NetIPsecDospSetting|Get-NetIPsecMainModeCryptoSet|Get-NetIPsecMainModeRule|Get-NetIPsecMainModeSA|Get-NetIPsecPhase1AuthSet|Get-NetIPsecPhase2AuthSet|Get-NetIPsecQuickModeCryptoSet|Get-NetIPsecQuickModeSA|Get-NetIPsecRule|New-NetFirewallRule|New-NetIPsecDospSetting|New-NetIPsecMainModeCryptoSet|New-NetIPsecMainModeRule|New-NetIPsecPhase1AuthSet|New-NetIPsecPhase2AuthSet|New-NetIPsecQuickModeCryptoSet|New-NetIPsecRule|Open-NetGPO|Remove-NetFirewallRule|Remove-NetIPsecDospSetting|Remove-NetIPsecMainModeCryptoSet|Remove-NetIPsecMainModeRule|Remove-NetIPsecMainModeSA|Remove-NetIPsecPhase1AuthSet|Remove-NetIPsecPhase2AuthSet|Remove-NetIPsecQuickModeCryptoSet|Remove-NetIPsecQuickModeSA|Remove-NetIPsecRule|Rename-NetFirewallRule|Rename-NetIPsecMainModeCryptoSet|Rename-NetIPsecMainModeRule|Rename-NetIPsecPhase1AuthSet|Rename-NetIPsecPhase2AuthSet|Rename-NetIPsecQuickModeCryptoSet|Rename-NetIPsecRule|Save-NetGPO|Set-NetFirewallAddressFilter|Set-NetFirewallApplicationFilter|Set-NetFirewallInterfaceFilter|Set-NetFirewallInterfaceTypeFilter|Set-NetFirewallPortFilter|Set-NetFirewallProfile|Set-NetFirewallRule|Set-NetFirewallSecurityFilter|Set-NetFirewallServiceFilter|Set-NetFirewallSetting|Set-NetIPsecDospSetting|Set-NetIPsecMainModeCryptoSet|Set-NetIPsecMainModeRule|Set-NetIPsecPhase1AuthSet|Set-NetIPsecPhase2AuthSet|Set-NetIPsecQuickModeCryptoSet|Set-NetIPsecRule|Show-NetFirewallRule|Show-NetIPsecRule|Sync-NetIPsecRule|Update-NetIPsecRule|Get-DAPolicyChange|New-NetIPsecAuthProposal|New-NetIPsecMainModeCryptoProposal|New-NetIPsecQuickModeCryptoProposal|" +48 "Add-NetSwitchTeamMember|Get-NetSwitchTeam|Get-NetSwitchTeamMember|New-NetSwitchTeam|Remove-NetSwitchTeam|Remove-NetSwitchTeamMember|Rename-NetSwitchTeam|" +49 "Find-NetRoute|Get-NetCompartment|Get-NetIPAddress|Get-NetIPConfiguration|Get-NetIPInterface|Get-NetIPv4Protocol|Get-NetIPv6Protocol|Get-NetNeighbor|Get-NetOffloadGlobalSetting|Get-NetPrefixPolicy|Get-NetRoute|Get-NetTCPConnection|Get-NetTCPSetting|Get-NetTransportFilter|Get-NetUDPEndpoint|Get-NetUDPSetting|New-NetIPAddress|New-NetNeighbor|New-NetRoute|New-NetTransportFilter|Remove-NetIPAddress|Remove-NetNeighbor|Remove-NetRoute|Remove-NetTransportFilter|Set-NetIPAddress|Set-NetIPInterface|Set-NetIPv4Protocol|Set-NetIPv6Protocol|Set-NetNeighbor|Set-NetOffloadGlobalSetting|Set-NetRoute|Set-NetTCPSetting|Set-NetUDPSetting|Test-NetConnection|" +50 "Get-DAConnectionStatus|Get-NCSIPolicyConfiguration|Reset-NCSIPolicyConfiguration|Set-NCSIPolicyConfiguration|" +51 "Disable-NetworkSwitchEthernetPort|Disable-NetworkSwitchFeature|Disable-NetworkSwitchVlan|Enable-NetworkSwitchEthernetPort|Enable-NetworkSwitchFeature|Enable-NetworkSwitchVlan|Get-NetworkSwitchEthernetPort|Get-NetworkSwitchFeature|Get-NetworkSwitchGlobalData|Get-NetworkSwitchVlan|New-NetworkSwitchVlan|Remove-NetworkSwitchEthernetPortIPAddress|Remove-NetworkSwitchVlan|Restore-NetworkSwitchConfiguration|Save-NetworkSwitchConfiguration|Set-NetworkSwitchEthernetPortIPAddress|Set-NetworkSwitchPortMode|Set-NetworkSwitchPortProperty|Set-NetworkSwitchVlanProperty|" +52 "Add-NetIPHttpsCertBinding|Disable-NetDnsTransitionConfiguration|Disable-NetIPHttpsProfile|Disable-NetNatTransitionConfiguration|Enable-NetDnsTransitionConfiguration|Enable-NetIPHttpsProfile|Enable-NetNatTransitionConfiguration|Get-Net6to4Configuration|Get-NetDnsTransitionConfiguration|Get-NetDnsTransitionMonitoring|Get-NetIPHttpsConfiguration|Get-NetIPHttpsState|Get-NetIsatapConfiguration|Get-NetNatTransitionConfiguration|Get-NetNatTransitionMonitoring|Get-NetTeredoConfiguration|Get-NetTeredoState|New-NetIPHttpsConfiguration|New-NetNatTransitionConfiguration|Remove-NetIPHttpsCertBinding|Remove-NetIPHttpsConfiguration|Remove-NetNatTransitionConfiguration|Rename-NetIPHttpsConfiguration|Reset-Net6to4Configuration|Reset-NetDnsTransitionConfiguration|Reset-NetIPHttpsConfiguration|Reset-NetIsatapConfiguration|Reset-NetTeredoConfiguration|Set-Net6to4Configuration|Set-NetDnsTransitionConfiguration|Set-NetIPHttpsConfiguration|Set-NetIsatapConfiguration|Set-NetNatTransitionConfiguration|Set-NetTeredoConfiguration|" +53 "Find-Package|Find-PackageProvider|Get-Package|Get-PackageProvider|Get-PackageSource|Import-PackageProvider|Install-Package|Install-PackageProvider|Register-PackageSource|Save-Package|Set-PackageSource|Uninstall-Package|Unregister-PackageSource|" +54 "Clear-PcsvDeviceLog|Get-PcsvDevice|Get-PcsvDeviceLog|Restart-PcsvDevice|Set-PcsvDeviceBootConfiguration|Set-PcsvDeviceNetworkConfiguration|Set-PcsvDeviceUserPassword|Start-PcsvDevice|Stop-PcsvDevice|" +55 "AfterAll|AfterEach|Assert-MockCalled|Assert-VerifiableMocks|BeforeAll|BeforeEach|Context|Describe|Get-MockDynamicParameters|Get-TestDriveItem|In|InModuleScope|Invoke-Mock|Invoke-Pester|It|Mock|New-Fixture|Set-DynamicParameterVariables|Setup|Should|" +56 "Add-CertificateEnrollmentPolicyServer|Export-Certificate|Export-PfxCertificate|Get-Certificate|Get-CertificateAutoEnrollmentPolicy|Get-CertificateEnrollmentPolicyServer|Get-CertificateNotificationTask|Get-PfxData|Import-Certificate|Import-PfxCertificate|New-CertificateNotificationTask|New-SelfSignedCertificate|Remove-CertificateEnrollmentPolicyServer|Remove-CertificateNotificationTask|Set-CertificateAutoEnrollmentPolicy|Switch-Certificate|Test-Certificate|" +57 "Disable-PnpDevice|Enable-PnpDevice|Get-PnpDevice|Get-PnpDeviceProperty|" +58 "Find-DscResource|Find-Module|Find-Script|Get-InstalledModule|Get-InstalledScript|Get-PSRepository|Install-Module|Install-Script|New-ScriptFileInfo|Publish-Module|Publish-Script|Register-PSRepository|Save-Module|Save-Script|Set-PSRepository|Test-ScriptFileInfo|Uninstall-Module|Uninstall-Script|Unregister-PSRepository|Update-Module|Update-ModuleManifest|Update-Script|Update-ScriptFileInfo|" +59 "Add-Printer|Add-PrinterDriver|Add-PrinterPort|Get-PrintConfiguration|Get-Printer|Get-PrinterDriver|Get-PrinterPort|Get-PrinterProperty|Get-PrintJob|Read-PrinterNfcTag|Remove-Printer|Remove-PrinterDriver|Remove-PrinterPort|Remove-PrintJob|Rename-Printer|Restart-PrintJob|Resume-PrintJob|Set-PrintConfiguration|Set-Printer|Set-PrinterProperty|Suspend-PrintJob|Write-PrinterNfcTag|" +60 "Configuration|Disable-DscDebug|Enable-DscDebug|Get-DscConfiguration|Get-DscConfigurationStatus|Get-DscLocalConfigurationManager|Get-DscResource|New-DscChecksum|Remove-DscConfigurationDocument|Restore-DscConfiguration|Stop-DscConfiguration|Invoke-DscResource|Publish-DscConfiguration|Set-DscLocalConfigurationManager|Start-DscConfiguration|Test-DscConfiguration|Update-DscConfiguration|" +61 "Disable-PSTrace|Disable-PSWSManCombinedTrace|Disable-WSManTrace|Enable-PSTrace|Enable-PSWSManCombinedTrace|Enable-WSManTrace|Get-LogProperties|Set-LogProperties|Start-Trace|Stop-Trace|" +62 "PSConsoleHostReadline|Get-PSReadlineKeyHandler|Get-PSReadlineOption|Remove-PSReadlineKeyHandler|Set-PSReadlineKeyHandler|Set-PSReadlineOption|" +63 "Add-JobTrigger|Disable-JobTrigger|Disable-ScheduledJob|Enable-JobTrigger|Enable-ScheduledJob|Get-JobTrigger|Get-ScheduledJob|Get-ScheduledJobOption|New-JobTrigger|New-ScheduledJobOption|Register-ScheduledJob|Remove-JobTrigger|Set-JobTrigger|Set-ScheduledJob|Set-ScheduledJobOption|Unregister-ScheduledJob|" +64 "New-PSWorkflowSession|New-PSWorkflowExecutionOption|" +65 "Invoke-AsWorkflow|" +66 "Disable-ScheduledTask|Enable-ScheduledTask|Export-ScheduledTask|Get-ClusteredScheduledTask|Get-ScheduledTask|Get-ScheduledTaskInfo|New-ScheduledTask|New-ScheduledTaskAction|New-ScheduledTaskPrincipal|New-ScheduledTaskSettingsSet|New-ScheduledTaskTrigger|Register-ClusteredScheduledTask|Register-ScheduledTask|Set-ClusteredScheduledTask|Set-ScheduledTask|Start-ScheduledTask|Stop-ScheduledTask|Unregister-ClusteredScheduledTask|Unregister-ScheduledTask|" +67 "Confirm-SecureBootUEFI|Format-SecureBootUEFI|Get-SecureBootPolicy|Get-SecureBootUEFI|Set-SecureBootUEFI|" +68 "Block-SmbShareAccess|Close-SmbOpenFile|Close-SmbSession|Disable-SmbDelegation|Enable-SmbDelegation|Get-SmbBandwidthLimit|Get-SmbClientConfiguration|Get-SmbClientNetworkInterface|Get-SmbConnection|Get-SmbDelegation|Get-SmbMapping|Get-SmbMultichannelConnection|Get-SmbMultichannelConstraint|Get-SmbOpenFile|Get-SmbServerConfiguration|Get-SmbServerNetworkInterface|Get-SmbSession|Get-SmbShare|Get-SmbShareAccess|Grant-SmbShareAccess|New-SmbMapping|New-SmbMultichannelConstraint|New-SmbShare|Remove-SmbBandwidthLimit|Remove-SmbMapping|Remove-SmbMultichannelConstraint|Remove-SmbShare|Revoke-SmbShareAccess|Set-SmbBandwidthLimit|Set-SmbClientConfiguration|Set-SmbPathAcl|Set-SmbServerConfiguration|Set-SmbShare|Unblock-SmbShareAccess|Update-SmbMultichannelConnection|" +69 "Move-SmbClient|Get-SmbWitnessClient|Move-SmbWitnessClient|" +70 "Get-StartApps|Export-StartLayout|Import-StartLayout|" +71 "Disable-PhysicalDiskIndication|Disable-StorageDiagnosticLog|Enable-PhysicalDiskIndication|Enable-StorageDiagnosticLog|Flush-Volume|Get-DiskSNV|Get-PhysicalDiskSNV|Get-StorageEnclosureSNV|Initialize-Volume|Write-FileSystemCache|Add-InitiatorIdToMaskingSet|Add-PartitionAccessPath|Add-PhysicalDisk|Add-TargetPortToMaskingSet|Add-VirtualDiskToMaskingSet|Block-FileShareAccess|Clear-Disk|Clear-FileStorageTier|Clear-StorageDiagnosticInfo|Connect-VirtualDisk|Debug-FileShare|Debug-StorageSubSystem|Debug-Volume|Disable-PhysicalDiskIdentification|Disable-StorageEnclosureIdentification|Disable-StorageHighAvailability|Disconnect-VirtualDisk|Dismount-DiskImage|Enable-PhysicalDiskIdentification|Enable-StorageEnclosureIdentification|Enable-StorageHighAvailability|Format-Volume|Get-DedupProperties|Get-Disk|Get-DiskImage|Get-DiskStorageNodeView|Get-FileIntegrity|Get-FileShare|Get-FileShareAccessControlEntry|Get-FileStorageTier|Get-InitiatorId|Get-InitiatorPort|Get-MaskingSet|Get-OffloadDataTransferSetting|Get-Partition|Get-PartitionSupportedSize|Get-PhysicalDisk|Get-PhysicalDiskStorageNodeView|Get-ResiliencySetting|Get-StorageAdvancedProperty|Get-StorageDiagnosticInfo|Get-StorageEnclosure|Get-StorageEnclosureStorageNodeView|Get-StorageEnclosureVendorData|Get-StorageFaultDomain|Get-StorageFileServer|Get-StorageFirmwareInformation|Get-StorageHealthAction|Get-StorageHealthReport|Get-StorageHealthSetting|Get-StorageJob|Get-StorageNode|Get-StoragePool|Get-StorageProvider|Get-StorageReliabilityCounter|Get-StorageSetting|Get-StorageSubSystem|Get-StorageTier|Get-StorageTierSupportedSize|Get-SupportedClusterSizes|Get-SupportedFileSystems|Get-TargetPort|Get-TargetPortal|Get-VirtualDisk|Get-VirtualDiskSupportedSize|Get-Volume|Get-VolumeCorruptionCount|Get-VolumeScrubPolicy|Grant-FileShareAccess|Hide-VirtualDisk|Initialize-Disk|Mount-DiskImage|New-FileShare|New-MaskingSet|New-Partition|New-StorageFileServer|New-StoragePool|New-StorageSubsystemVirtualDisk|New-StorageTier|New-VirtualDisk|New-VirtualDiskClone|New-VirtualDiskSnapshot|New-Volume|Optimize-StoragePool|Optimize-Volume|Register-StorageSubsystem|Remove-FileShare|Remove-InitiatorId|Remove-InitiatorIdFromMaskingSet|Remove-MaskingSet|Remove-Partition|Remove-PartitionAccessPath|Remove-PhysicalDisk|Remove-StorageFileServer|Remove-StorageHealthSetting|Remove-StoragePool|Remove-StorageTier|Remove-TargetPortFromMaskingSet|Remove-VirtualDisk|Remove-VirtualDiskFromMaskingSet|Rename-MaskingSet|Repair-FileIntegrity|Repair-VirtualDisk|Repair-Volume|Reset-PhysicalDisk|Reset-StorageReliabilityCounter|Resize-Partition|Resize-StorageTier|Resize-VirtualDisk|Revoke-FileShareAccess|Set-Disk|Set-FileIntegrity|Set-FileShare|Set-FileStorageTier|Set-InitiatorPort|Set-Partition|Set-PhysicalDisk|Set-ResiliencySetting|Set-StorageFileServer|Set-StorageHealthSetting|Set-StoragePool|Set-StorageProvider|Set-StorageSetting|Set-StorageSubSystem|Set-StorageTier|Set-VirtualDisk|Set-Volume|Set-VolumeScrubPolicy|Show-VirtualDisk|Start-StorageDiagnosticLog|Stop-StorageDiagnosticLog|Stop-StorageJob|Unblock-FileShareAccess|Unregister-StorageSubsystem|Update-Disk|Update-HostStorageCache|Update-StorageFirmware|Update-StoragePool|Update-StorageProviderCache|Write-VolumeCache|" +72 "Disable-TlsCipherSuite|Disable-TlsSessionTicketKey|Enable-TlsCipherSuite|Enable-TlsSessionTicketKey|Export-TlsSessionTicketKey|Get-TlsCipherSuite|New-TlsSessionTicketKey|" +73 "Get-TroubleshootingPack|Invoke-TroubleshootingPack|" +74 "Clear-Tpm|ConvertTo-TpmOwnerAuth|Disable-TpmAutoProvisioning|Enable-TpmAutoProvisioning|Get-Tpm|Get-TpmEndorsementKeyInfo|Get-TpmSupportedFeature|Import-TpmOwnerAuth|Initialize-Tpm|Set-TpmOwnerAuth|Unblock-Tpm|" +75 "Add-VpnConnection|Add-VpnConnectionRoute|Add-VpnConnectionTriggerApplication|Add-VpnConnectionTriggerDnsConfiguration|Add-VpnConnectionTriggerTrustedNetwork|Get-VpnConnection|Get-VpnConnectionTrigger|New-EapConfiguration|New-VpnServerAddress|Remove-VpnConnection|Remove-VpnConnectionRoute|Remove-VpnConnectionTriggerApplication|Remove-VpnConnectionTriggerDnsConfiguration|Remove-VpnConnectionTriggerTrustedNetwork|Set-VpnConnection|Set-VpnConnectionIPsecConfiguration|Set-VpnConnectionProxy|Set-VpnConnectionTriggerDnsConfiguration|Set-VpnConnectionTriggerTrustedNetwork|" +76 "Add-OdbcDsn|Disable-OdbcPerfCounter|Disable-WdacBidTrace|Enable-OdbcPerfCounter|Enable-WdacBidTrace|Get-OdbcDriver|Get-OdbcDsn|Get-OdbcPerfCounter|Get-WdacBidTrace|Remove-OdbcDsn|Set-OdbcDriver|Set-OdbcDsn|" +77 "Get-WindowsDeveloperLicense|Show-WindowsDeveloperLicenseRegistration|Unregister-WindowsDeveloperLicense|" +78 "Disable-WindowsErrorReporting|Enable-WindowsErrorReporting|Get-WindowsErrorReporting|" +79 "Get-WindowsSearchSetting|Set-WindowsSearchSetting|" +80 "Get-WindowsUpdateLog"81 );82 var keywordMapper = this.createKeywordMapper({83 "support.function": builtinFunctions,84 "keyword": keywords85 }, "identifier");86 var binaryOperatorsRe = (87 "eq|ne|gt|lt|le|ge|like|notlike|match|notmatch|contains|notcontains|in|notin|band|bor|bxor|bnot|" + 88 "ceq|cne|cgt|clt|cle|cge|clike|cnotlike|cmatch|cnotmatch|ccontains|cnotcontains|cin|cnotin|" + 89 "ieq|ine|igt|ilt|ile|ige|ilike|inotlike|imatch|inotmatch|icontains|inotcontains|iin|inotin|" +90 "and|or|xor|not|" +91 "split|join|replace|f|" +92 "csplit|creplace|" +93 "isplit|ireplace|" +94 "is|isnot|as|" +95 "shl|shr"96 );97 this.$rules = {98 "start" : [99 {100 token : "comment",101 regex : "#.*$"102 }, {103 token : "comment.start",104 regex : "<#",105 next : "comment"106 }, {107 token : "string", // single line108 regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'109 }, {110 token : "string", // single line111 regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"112 }, {113 token : "constant.numeric", // hex114 regex : "0[xX][0-9a-fA-F]+\\b"115 }, {116 token : "constant.numeric", // float117 regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"118 }, {119 token : "constant.language.boolean",120 regex : "[$](?:[Tt]rue|[Ff]alse)\\b"121 }, {122 token : "constant.language",123 regex : "[$][Nn]ull\\b"124 }, {125 token : "variable.instance",126 regex : "[$][a-zA-Z][a-zA-Z0-9_]*\\b"127 }, {128 token : keywordMapper,129 regex : "[a-zA-Z_$][a-zA-Z0-9_$\\-]*\\b"130 }, {131 token : "keyword.operator",132 regex : "\\-(?:" + binaryOperatorsRe + ")"133 }, {134 token : "keyword.operator",135 regex : "&|\\+|\\-|\\*|\\/|\\%|\\=|\\>|\\&|\\!|\\|"136 }, {137 token : "lparen",138 regex : "[[({]"139 }, {140 token : "rparen",141 regex : "[\\])}]"142 }, {143 token : "text",144 regex : "\\s+"145 }146 ],147 "comment" : [148 {149 token : "comment.end",150 regex : "#>",151 next : "start"152 }, {153 token : "doc.comment.tag",154 regex : "^\\.\\w+"155 }, {156 defaultToken : "comment"157 }158 ]159 };160};161oop.inherits(PowershellHighlightRules, TextHighlightRules);162exports.PowershellHighlightRules = PowershellHighlightRules;163});164define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module) {165"use strict";166var Range = require("../range").Range;167var MatchingBraceOutdent = function() {};168(function() {169 this.checkOutdent = function(line, input) {170 if (! /^\s+$/.test(line))171 return false;172 return /^\s*\}/.test(input);173 };174 this.autoOutdent = function(doc, row) {175 var line = doc.getLine(row);176 var match = line.match(/^(\s*\})/);177 if (!match) return 0;178 var column = match[1].length;179 var openBracePos = doc.findMatchingBracket({row: row, column: column});180 if (!openBracePos || openBracePos.row == row) return 0;181 var indent = this.$getIndent(doc.getLine(openBracePos.row));182 doc.replace(new Range(row, 0, row, column-1), indent);183 };184 this.$getIndent = function(line) {185 return line.match(/^\s*/)[0];186 };187}).call(MatchingBraceOutdent.prototype);188exports.MatchingBraceOutdent = MatchingBraceOutdent;189});190define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) {191"use strict";192var oop = require("../../lib/oop");193var Range = require("../../range").Range;194var BaseFoldMode = require("./fold_mode").FoldMode;195var FoldMode = exports.FoldMode = function(commentRegex) {196 if (commentRegex) {197 this.foldingStartMarker = new RegExp(198 this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start)199 );200 this.foldingStopMarker = new RegExp(201 this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end)202 );203 }204};205oop.inherits(FoldMode, BaseFoldMode);206(function() {207 208 this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/;209 this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/;210 this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/;211 this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/;212 this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/;213 this._getFoldWidgetBase = this.getFoldWidget;214 this.getFoldWidget = function(session, foldStyle, row) {215 var line = session.getLine(row);216 217 if (this.singleLineBlockCommentRe.test(line)) {218 if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))219 return "";220 }221 222 var fw = this._getFoldWidgetBase(session, foldStyle, row);223 224 if (!fw && this.startRegionRe.test(line))225 return "start"; // lineCommentRegionStart226 227 return fw;228 };229 this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) {230 var line = session.getLine(row);231 232 if (this.startRegionRe.test(line))233 return this.getCommentRegionBlock(session, line, row);234 235 var match = line.match(this.foldingStartMarker);236 if (match) {237 var i = match.index;238 if (match[1])239 return this.openingBracketBlock(session, match[1], row, i);240 241 var range = session.getCommentFoldRange(row, i + match[0].length, 1);242 243 if (range && !range.isMultiLine()) {244 if (forceMultiline) {245 range = this.getSectionRange(session, row);246 } else if (foldStyle != "all")247 range = null;248 }249 250 return range;251 }252 if (foldStyle === "markbegin")253 return;254 var match = line.match(this.foldingStopMarker);255 if (match) {256 var i = match.index + match[0].length;257 if (match[1])258 return this.closingBracketBlock(session, match[1], row, i);259 return session.getCommentFoldRange(row, i, -1);260 }261 };262 263 this.getSectionRange = function(session, row) {264 var line = session.getLine(row);265 var startIndent = line.search(/\S/);266 var startRow = row;267 var startColumn = line.length;268 row = row + 1;269 var endRow = row;270 var maxRow = session.getLength();271 while (++row < maxRow) {272 line = session.getLine(row);273 var indent = line.search(/\S/);274 if (indent === -1)275 continue;276 if (startIndent > indent)277 break;278 var subRange = this.getFoldWidgetRange(session, "all", row);279 280 if (subRange) {281 if (subRange.start.row <= startRow) {282 break;283 } else if (subRange.isMultiLine()) {284 row = subRange.end.row;285 } else if (startIndent == indent) {286 break;287 }288 }289 endRow = row;290 }291 292 return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);293 };294 this.getCommentRegionBlock = function(session, line, row) {295 var startColumn = line.search(/\s*$/);296 var maxRow = session.getLength();297 var startRow = row;298 299 var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;300 var depth = 1;301 while (++row < maxRow) {302 line = session.getLine(row);303 var m = re.exec(line);304 if (!m) continue;305 if (m[1]) depth--;306 else depth++;307 if (!depth) break;308 }309 var endRow = row;310 if (endRow > startRow) {311 return new Range(startRow, startColumn, endRow, line.length);312 }313 };314}).call(FoldMode.prototype);315});316define("ace/mode/powershell",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/powershell_highlight_rules","ace/mode/matching_brace_outdent","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(require, exports, module) {317"use strict";318var oop = require("../lib/oop");319var TextMode = require("./text").Mode;320var PowershellHighlightRules = require("./powershell_highlight_rules").PowershellHighlightRules;321var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;322var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;323var CStyleFoldMode = require("./folding/cstyle").FoldMode;324var Mode = function() {325 this.HighlightRules = PowershellHighlightRules;326 this.$outdent = new MatchingBraceOutdent();327 this.$behaviour = new CstyleBehaviour();328 this.foldingRules = new CStyleFoldMode({start: "^\\s*(<#)", end: "^[#\\s]>\\s*$"});329};330oop.inherits(Mode, TextMode);331(function() {332 this.lineCommentStart = "#";333 this.blockComment = {start: "<#", end: "#>"};334 335 this.getNextLineIndent = function(state, line, tab) {336 var indent = this.$getIndent(line);337 var tokenizedLine = this.getTokenizer().getLineTokens(line, state);338 var tokens = tokenizedLine.tokens;339 if (tokens.length && tokens[tokens.length-1].type == "comment") {340 return indent;341 }342 343 if (state == "start") {344 var match = line.match(/^.*[\{\(\[]\s*$/);345 if (match) {346 indent += tab;347 }348 }349 return indent;350 };351 this.checkOutdent = function(state, line, input) {352 return this.$outdent.checkOutdent(line, input);353 };354 this.autoOutdent = function(state, doc, row) {355 this.$outdent.autoOutdent(doc, row);356 };357 this.createWorker = function(session) {358 return null;359 };360 this.$id = "ace/mode/powershell";361}).call(Mode.prototype);362exports.Mode = Mode;...
ipaddress_test.js
Source:ipaddress_test.js
1// Copyright 2011 The Closure Library Authors. All Rights Reserved.2//3// Licensed under the Apache License, Version 2.0 (the "License");4// you may not use this file except in compliance with the License.5// You may obtain a copy of the License at6//7// http://www.apache.org/licenses/LICENSE-2.08//9// Unless required by applicable law or agreed to in writing, software10// distributed under the License is distributed on an "AS-IS" BASIS,11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.12// See the License for the specific language governing permissions and13// limitations under the License.14goog.provide('goog.net.IpAddressTest');15goog.setTestOnly('goog.net.IpAddressTest');16goog.require('goog.math.Integer');17goog.require('goog.net.IpAddress');18goog.require('goog.net.Ipv4Address');19goog.require('goog.net.Ipv6Address');20goog.require('goog.testing.jsunit');21function testInvalidStrings() {22 assertEquals(null, goog.net.IpAddress.fromString(''));23 assertEquals(null, goog.net.IpAddress.fromString('016.016.016.016'));24 assertEquals(null, goog.net.IpAddress.fromString('016.016.016'));25 assertEquals(null, goog.net.IpAddress.fromString('016.016'));26 assertEquals(null, goog.net.IpAddress.fromString('016'));27 assertEquals(null, goog.net.IpAddress.fromString('000.000.000.000'));28 assertEquals(null, goog.net.IpAddress.fromString('000'));29 assertEquals(null, goog.net.IpAddress.fromString('0x0a.0x0a.0x0a.0x0a'));30 assertEquals(null, goog.net.IpAddress.fromString('0x0a.0x0a.0x0a'));31 assertEquals(null, goog.net.IpAddress.fromString('0x0a.0x0a'));32 assertEquals(null, goog.net.IpAddress.fromString('0x0a'));33 assertEquals(null, goog.net.IpAddress.fromString('42.42.42.42.42'));34 assertEquals(null, goog.net.IpAddress.fromString('42.42.42'));35 assertEquals(null, goog.net.IpAddress.fromString('42.42'));36 assertEquals(null, goog.net.IpAddress.fromString('42'));37 assertEquals(null, goog.net.IpAddress.fromString('42..42.42'));38 assertEquals(null, goog.net.IpAddress.fromString('42..42.42.42'));39 assertEquals(null, goog.net.IpAddress.fromString('42.42.42.42.'));40 assertEquals(null, goog.net.IpAddress.fromString('42.42.42.42...'));41 assertEquals(null, goog.net.IpAddress.fromString('.42.42.42.42'));42 assertEquals(null, goog.net.IpAddress.fromString('...42.42.42.42'));43 assertEquals(null, goog.net.IpAddress.fromString('42.42.42.-0'));44 assertEquals(null, goog.net.IpAddress.fromString('42.42.42.+0'));45 assertEquals(null, goog.net.IpAddress.fromString('.'));46 assertEquals(null, goog.net.IpAddress.fromString('...'));47 assertEquals(null, goog.net.IpAddress.fromString('bogus'));48 assertEquals(null, goog.net.IpAddress.fromString('bogus.com'));49 assertEquals(null, goog.net.IpAddress.fromString('192.168.0.1.com'));50 assertEquals(51 null, goog.net.IpAddress.fromString('12345.67899.-54321.-98765'));52 assertEquals(null, goog.net.IpAddress.fromString('257.0.0.0'));53 assertEquals(null, goog.net.IpAddress.fromString('42.42.42.-42'));54 assertEquals(null, goog.net.IpAddress.fromString('3ff3:::1'));55 assertEquals(null, goog.net.IpAddress.fromString('3ffe::1.net'));56 assertEquals(null, goog.net.IpAddress.fromString('3ffe::1::1'));57 assertEquals(null, goog.net.IpAddress.fromString('1::2::3::4:5'));58 assertEquals(null, goog.net.IpAddress.fromString('::7:6:5:4:3:2:'));59 assertEquals(null, goog.net.IpAddress.fromString(':6:5:4:3:2:1::'));60 assertEquals(null, goog.net.IpAddress.fromString('2001::db:::1'));61 assertEquals(null, goog.net.IpAddress.fromString('FEDC:9878'));62 assertEquals(null, goog.net.IpAddress.fromString('+1.+2.+3.4'));63 assertEquals(null, goog.net.IpAddress.fromString('1.2.3.4e0'));64 assertEquals(null, goog.net.IpAddress.fromString('::7:6:5:4:3:2:1:0'));65 assertEquals(null, goog.net.IpAddress.fromString('7:6:5:4:3:2:1:0::'));66 assertEquals(null, goog.net.IpAddress.fromString('9:8:7:6:5:4:3::2:1'));67 assertEquals(null, goog.net.IpAddress.fromString('0:1:2:3::4:5:6:7'));68 assertEquals(null, goog.net.IpAddress.fromString('3ffe:0:0:0:0:0:0:0:1'));69 assertEquals(null, goog.net.IpAddress.fromString('3ffe::10000'));70 assertEquals(null, goog.net.IpAddress.fromString('3ffe::goog'));71 assertEquals(null, goog.net.IpAddress.fromString('3ffe::-0'));72 assertEquals(null, goog.net.IpAddress.fromString('3ffe::+0'));73 assertEquals(null, goog.net.IpAddress.fromString('3ffe::-1'));74 assertEquals(null, goog.net.IpAddress.fromString(':'));75 assertEquals(null, goog.net.IpAddress.fromString(':::'));76 assertEquals(null, goog.net.IpAddress.fromString('a:'));77 assertEquals(null, goog.net.IpAddress.fromString('::a:'));78 assertEquals(null, goog.net.IpAddress.fromString('0xa::'));79 assertEquals(null, goog.net.IpAddress.fromString('::1.2.3'));80 assertEquals(null, goog.net.IpAddress.fromString('::1.2.3.4.5'));81 assertEquals(null, goog.net.IpAddress.fromString('::1.2.3.4:'));82 assertEquals(null, goog.net.IpAddress.fromString('1.2.3.4::'));83 assertEquals(null, goog.net.IpAddress.fromString('2001:db8::1:'));84 assertEquals(null, goog.net.IpAddress.fromString(':2001:db8::1'));85}86function testVersion() {87 var ip4 = goog.net.IpAddress.fromString('1.2.3.4');88 assertEquals(ip4.getVersion(), 4);89 var ip6 = goog.net.IpAddress.fromString('2001:dead::beef:1');90 assertEquals(ip6.getVersion(), 6);91 ip6 = goog.net.IpAddress.fromString('::192.168.1.1');92 assertEquals(ip6.getVersion(), 6);93}94function testStringIpv4Address() {95 assertEquals(96 '192.168.1.1', new goog.net.Ipv4Address('192.168.1.1').toString());97 assertEquals('1.1.1.1', new goog.net.Ipv4Address('1.1.1.1').toString());98 assertEquals(99 '224.56.33.2', new goog.net.Ipv4Address('224.56.33.2').toString());100 assertEquals(101 '255.255.255.255',102 new goog.net.Ipv4Address('255.255.255.255').toString());103 assertEquals('0.0.0.0', new goog.net.Ipv4Address('0.0.0.0').toString());104}105function testIntIpv4Address() {106 var ip4Str = new goog.net.Ipv4Address('1.1.1.1');107 var ip4Int = new goog.net.Ipv4Address(new goog.math.Integer([16843009], 0));108 assertTrue(ip4Str.equals(ip4Int));109 assertEquals(ip4Str.toString(), ip4Int.toString());110 assertThrows(111 'Ipv4(-1)',112 goog.partial(goog.net.Ipv4Address, goog.math.Integer.fromInt(-1)));113 assertThrows(114 'Ipv4(2**32)',115 goog.partial(goog.net.Ipv4Address, goog.math.Integer.ONE.shiftLeft(32)));116}117function testStringIpv6Address() {118 assertEquals(119 '1:2:3:4:5:6:7:8',120 new goog.net.Ipv6Address('1:2:3:4:5:6:7:8').toString());121 assertEquals(122 '::1:2:3:4:5:6:7',123 new goog.net.Ipv6Address('::1:2:3:4:5:6:7').toString());124 assertEquals(125 '1:2:3:4:5:6:7::',126 new goog.net.Ipv6Address('1:2:3:4:5:6:7:0').toString());127 assertEquals(128 '2001:0:0:4::8',129 new goog.net.Ipv6Address('2001:0:0:4:0:0:0:8').toString());130 assertEquals(131 '2001::4:5:6:7:8',132 new goog.net.Ipv6Address('2001:0:0:4:5:6:7:8').toString());133 assertEquals(134 '2001::3:4:5:6:7:8',135 new goog.net.Ipv6Address('2001:0:3:4:5:6:7:8').toString());136 assertEquals(137 '0:0:3::ffff', new goog.net.Ipv6Address('0:0:3:0:0:0:0:ffff').toString());138 assertEquals(139 '::4:0:0:0:ffff',140 new goog.net.Ipv6Address('0:0:0:4:0:0:0:ffff').toString());141 assertEquals(142 '::5:0:0:ffff',143 new goog.net.Ipv6Address('0:0:0:0:5:0:0:ffff').toString());144 assertEquals(145 '1::4:0:0:7:8', new goog.net.Ipv6Address('1:0:0:4:0:0:7:8').toString());146 assertEquals('::', new goog.net.Ipv6Address('0:0:0:0:0:0:0:0').toString());147 assertEquals('::1', new goog.net.Ipv6Address('0:0:0:0:0:0:0:1').toString());148 assertEquals(149 '2001:658:22a:cafe::',150 new goog.net.Ipv6Address('2001:0658:022a:cafe:0000:0000:0000:0000')151 .toString());152 assertEquals('::102:304', new goog.net.Ipv6Address('::1.2.3.4').toString());153 assertEquals(154 '::ffff:303:303', new goog.net.Ipv6Address('::ffff:3.3.3.3').toString());155 assertEquals(156 '::ffff:ffff', new goog.net.Ipv6Address('::255.255.255.255').toString());157}158function testIntIpv6Address() {159 var ip6Str = new goog.net.Ipv6Address('2001::dead:beef:1');160 var ip6Int = new goog.net.Ipv6Address(161 new goog.math.Integer([3203334145, 57005, 0, 536936448], 0));162 assertTrue(ip6Str.equals(ip6Int));163 assertEquals(ip6Str.toString(), ip6Int.toString());164 assertThrows(165 'Ipv6(-1)',166 goog.partial(goog.net.Ipv6Address, goog.math.Integer.fromInt(-1)));167 assertThrows(168 'Ipv6(2**128)',169 goog.partial(goog.net.Ipv6Address, goog.math.Integer.ONE.shiftLeft(128)));170}171function testDottedQuadIpv6() {172 var ip6 = new goog.net.Ipv6Address('7::0.128.0.127');173 ip6 = new goog.net.Ipv6Address('7::0.128.0.128');174 ip6 = new goog.net.Ipv6Address('7::128.128.0.127');175 ip6 = new goog.net.Ipv6Address('7::0.128.128.127');176}177function testMappedIpv4Address() {178 var testAddresses = ['::ffff:1.2.3.4', '::FFFF:102:304'];179 var ipv4Str = '1.2.3.4';180 var ip1 = new goog.net.Ipv6Address(testAddresses[0]);181 var ip2 = new goog.net.Ipv6Address(testAddresses[1]);182 var ipv4 = new goog.net.Ipv4Address(ipv4Str);183 assertTrue(ip1.isMappedIpv4Address());184 assertTrue(ip2.isMappedIpv4Address());185 assertTrue(ip1.equals(ip2));186 assertTrue(ipv4.equals(ip1.getMappedIpv4Address()));187 assertTrue(ipv4.equals(ip2.getMappedIpv4Address()));188}189function testUriString() {190 var ip4Str = '192.168.1.1';191 var ip4Uri = goog.net.IpAddress.fromUriString(ip4Str);192 var ip4 = goog.net.IpAddress.fromString(ip4Str);193 assertTrue(ip4Uri.equals(ip4));194 var ip6Str = '2001:dead::beef:1';195 assertEquals(null, goog.net.IpAddress.fromUriString(ip6Str));196 var ip6Uri = goog.net.IpAddress.fromUriString('[' + ip6Str + ']');197 var ip6 = goog.net.IpAddress.fromString(ip6Str);198 assertTrue(ip6Uri.equals(ip6));199 assertEquals(ip6Uri.toString(), ip6Str);200 assertEquals(ip6Uri.toUriString(), '[' + ip6Str + ']');...
index.js
Source:index.js
1/**2 * @license3 * Copyright 2017 Google LLC4 *5 * Licensed under the Apache License, Version 2.0 (the "License");6 * you may not use this file except in compliance with the License.7 * You may obtain a copy of the License at8 *9 * http://www.apache.org/licenses/LICENSE-2.010 *11 * Unless required by applicable law or agreed to in writing, software12 * distributed under the License is distributed on an "AS IS" BASIS,13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.14 * See the License for the specific language governing permissions and15 * limitations under the License.16 */17/**18 * Bring in closure-library dependencies19 */20goog.provide('firebase.webchannel.wrapper');21// goog.net.WebChannelTransport22goog.require('goog.net.createWebChannelTransport');23goog.require('goog.labs.net.webChannel.requestStats');24goog.require('goog.labs.net.webChannel.WebChannelBaseTransport');25/**26 * NOTE: The `createWebChannel` function takes an options object as a second param27 * whose properties are typically mangled. We override these in externs/overrides.js28 * Without those externs, this does not function properly.29 */30goog.labs.net.webChannel.WebChannelBaseTransport.prototype['createWebChannel'] =31 goog.labs.net.webChannel.WebChannelBaseTransport.prototype.createWebChannel;32goog.labs.net.webChannel.WebChannelBaseTransport.Channel.prototype['send'] =33 goog.labs.net.webChannel.WebChannelBaseTransport.Channel.prototype.send;34goog.labs.net.webChannel.WebChannelBaseTransport.Channel.prototype['open'] =35 goog.labs.net.webChannel.WebChannelBaseTransport.Channel.prototype.open;36goog.labs.net.webChannel.WebChannelBaseTransport.Channel.prototype['close'] =37 goog.labs.net.webChannel.WebChannelBaseTransport.Channel.prototype.close;38// goog.net.ErrorCode39goog.require('goog.net.ErrorCode');40goog.net.ErrorCode['NO_ERROR'] = goog.net.ErrorCode.NO_ERROR;41goog.net.ErrorCode['TIMEOUT'] = goog.net.ErrorCode.TIMEOUT;42goog.net.ErrorCode['HTTP_ERROR'] = goog.net.ErrorCode.HTTP_ERROR;43// goog.net.ErrorType44goog.require('goog.net.EventType');45goog.net.EventType['COMPLETE'] = goog.net.EventType.COMPLETE;46// goog.net.WebChannel47goog.require('goog.net.WebChannel');48goog.require('goog.events.EventTarget');49goog.net.WebChannel['EventType'] = goog.net.WebChannel.EventType;50goog.net.WebChannel.EventType['OPEN'] = goog.net.WebChannel.EventType.OPEN;51goog.net.WebChannel.EventType['CLOSE'] = goog.net.WebChannel.EventType.CLOSE;52goog.net.WebChannel.EventType['ERROR'] = goog.net.WebChannel.EventType.ERROR;53goog.net.WebChannel.EventType['MESSAGE'] =54 goog.net.WebChannel.EventType.MESSAGE;55goog.events.EventTarget.prototype['listen'] =56 goog.events.EventTarget.prototype.listen;57goog.require('goog.net.XhrIo');58goog.net.XhrIo.prototype['listenOnce'] = goog.net.XhrIo.prototype.listenOnce;59goog.net.XhrIo.prototype['getLastError'] =60 goog.net.XhrIo.prototype.getLastError;61goog.net.XhrIo.prototype['getLastErrorCode'] =62 goog.net.XhrIo.prototype.getLastErrorCode;63goog.net.XhrIo.prototype['getStatus'] = goog.net.XhrIo.prototype.getStatus;64goog.net.XhrIo.prototype['getResponseJson'] =65 goog.net.XhrIo.prototype.getResponseJson;66goog.net.XhrIo.prototype['getResponseText'] =67 goog.net.XhrIo.prototype.getResponseText;68goog.net.XhrIo.prototype['send'] = goog.net.XhrIo.prototype.send;69module['exports']['createWebChannelTransport'] =70 goog.net.createWebChannelTransport;71module['exports']['getStatEventTarget'] =72 goog.labs.net.webChannel.requestStats.getStatEventTarget;73module['exports']['ErrorCode'] = goog.net.ErrorCode;74module['exports']['EventType'] = goog.net.EventType;75module['exports']['Event'] = goog.labs.net.webChannel.requestStats.Event;76module['exports']['Stat'] = goog.labs.net.webChannel.requestStats.Stat;77module['exports']['WebChannel'] = goog.net.WebChannel;...
Using AI Code Generation
1var net = require('net');2var client = new net.Socket();3client.connect(2525, 'localhost', function() {4 console.log('Connected');5 client.write('POST /imposters HTTP/1.1\r\n');6 client.write('Content-Type: application/json\r\n');7 client.write('Host: localhost:2525\r\n');8 client.write('Content-Length: 48\r\n\r\n');9 client.write('{"port": 3000, "protocol": "http"}\r\n');10});11client.on('data', function(data) {12 console.log('Received: ' + data);13});14client.on('close', function() {15 console.log('Connection closed');16});17client.on('error', function(err) {18 console.log('Error: ' + err);19});20var request = require('request');21var options = {22 headers: {23 },24 json: {25 }26};27request(options, function(error, response, body) {28 if (error) {29 console.log('Error: ' + error);30 } else {31 console.log('Response: ' + response.statusCode);32 console.log('Body: ' + JSON.stringify(body));33 }34});35var mb = require('mountebank');36mb.create({37}, function() {38 mb.post('/imposters', {39 }, function(error, response) {40 if (error) {41 console.log('Error: ' + error);42 } else {43 console.log('Response: ' + response.statusCode);44 console.log('Body: ' + JSON.stringify(response.body));45 }46 });47});48var mb = require('mountebank');49mb.create({50}, function() {51 mb.post('/imposters', {
Using AI Code Generation
1const mb = require('mountebank');2const port = 2525;3const imposterPort = 4545;4const imposter = {5 {6 {7 is: {8 }9 }10 }11};12mb.create(port, imposter)13 .then(() => console.log(`API is running on port ${imposterPort}`))14 .catch(error => console.error(`Failed to start API: ${error.message}`));15const mb = require('mountebank');16const port = 2525;17const imposterPort = 4545;18const imposter = {19 {20 {21 is: {22 }23 }24 }25};26mb.create(port, imposter)27 .then(() => console.log(`API is running on port ${imposterPort}`))28 .catch(error => console.error(`Failed to start API: ${error.message}`));
Using AI Code Generation
1var net = require('net');2var client = new net.Socket();3client.connect(2525, 'localhost', function() {4 console.log('Connected');5 client.write('POST /imposters HTTP/1.1\r\n');6 client.write('Content-Type: application/json\r\n');7 client.write('Content-Length: 93\r\n');8 client.write('\r\n');9 client.write('{"port": 4545, "protocol": "http", "stubs": [{"responses": [{"is": {"body": "Hello world"}}]}]}\r\n');10 client.write('\r\n');11});12client.on('data', function(data) {13 console.log('Received: ' + data);14});15client.on('close', function() {16 console.log('Connection closed');17});18var http = require('http');19var options = {20 headers: {21 }22};23var req = http.request(options, function(res) {24 res.setEncoding('utf8');25 res.on('data', function (chunk) {26 console.log('Response: ' + chunk);27 });28});29req.write('{"port": 4545, "protocol": "http", "stubs": [{"responses": [{"is": {"body": "Hello world"}}]}]}');30req.end();31var request = require('request');32request.post({33 json: {34 "stubs": [{35 "responses": [{36 "is": {37 }38 }]39 }]40 }41}, function (error, response, body) {42 console.log(body);43});44var rp = require('request-promise');45rp({46 body: {
Using AI Code Generation
1var http = require('http');2var fs = require('fs');3var path = require('path');4var mb = require('mountebank');5var port = 2525;6var mbPath = path.resolve(__dirname, 'node_modules', '.bin', 'mb');7var mbProcess = mb.create(mbPath, {port: port});8var imposters = JSON.parse(fs.readFileSync('imposters.json', 'utf8'));9mbProcess.then(function (mb) {10 mb.start().then(function (mb) {11 mb.createImposter(imposters[0]).then(function (imposter) {12 console.log(imposter);13 });14 });15});16 {17 {18 {19 "equals": {20 }21 }22 {23 "is": {24 "headers": {25 },26 "body": "[{\"id\":1,\"name\":\"John\"},{\"id\":2,\"name\":\"Jane\"}]"27 }28 }29 }30 }
Using AI Code Generation
1var mb = require('mountebank');2var fs = require('fs');3var path = require('path');4var Q = require('q');5var port = 2525;6var protocol = 'http';7var imposter = {8 {9 {10 equals: {11 }12 }13 {14 is: {15 }16 }17 }18};19var options = {20 headers: {21 }22};23var deferred = Q.defer();24var req = mb.createRequest(options, function (res) {25 res.setEncoding('utf8');26 res.on('data', function (chunk) {27 deferred.resolve(chunk);28 });29});30req.on('error', function (e) {31 deferred.reject(e);32});33req.write(JSON.stringify(imposter));34req.end();35deferred.promise.then(function (data) {36 console.log(data);37});38var mb = require('mountebank');39var fs = require('fs');40var path = require('path');41var Q = require('q');42var port = 2525;43var protocol = 'http';44var imposter = {45 {46 {47 equals: {48 }49 }50 {51 is: {52 }53 }54 }55};56var options = {57 headers: {58 }59};60var deferred = Q.defer();61var req = mb.createRequest(options, function (res) {62 res.setEncoding('utf8');63 res.on('data', function (chunk
Using AI Code Generation
1var net = require('net');2var mb = require('mountebank');3var port = 2525;4var mbServer = net.createServer(mb.create().then(function (server) {5 server.listen(port);6}));7mbServer.listen(port);8var http = require('http');9var mb = require('mountebank');10var port = 2525;11var mbServer = http.createServer(mb.create().then(function (server) {12 server.listen(port);13}));14mbServer.listen(port);15var https = require('https');16var mb = require('mountebank');17var port = 2525;18var mbServer = https.createServer(mb.create().then(function (server) {19 server.listen(port);20}));21mbServer.listen(port);
Using AI Code Generation
1var mb = require('mountebank');2var request = require('request');3var port = 2525;4var host = 'localhost';5var protocol = 'http';6var path = '/test';7var stub = {8 {9 is: {10 }11 }12};13var imposter = {14};15var options = {16};17mb.create({port: port, ipWhitelist: ['*']}, function (error, mbServer) {18 if (error) {19 console.error(error);20 }21 mbServer.post('/imposters', imposter, function (error, response) {22 if (error) {23 console.error(error);24 }25 request(options, function (error, response, body) {26 if (error) {27 console.error(error);28 }29 console.log(response.statusCode);30 console.log(body);31 mbServer.del('/imposters', function (error, response) {32 if (error) {33 console.error(error);34 }35 mbServer.close();36 });37 });38 });39});40{41 "scripts": {42 },43 "dependencies": {44 }45}
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!