code stringlengths 12 2.05k | label_name stringclasses 5
values | label int64 0 4 |
|---|---|---|
func (x *GetWalletLedgerRequest) Reset() {
*x = GetWalletLedgerRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_console_proto_msgTypes[45]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
} | Base | 1 |
func defaultLocation(x ast.Node) *ast.Location {
return ast.NewLocation([]byte(x.String()), "", 1, 1)
} | Pillar | 3 |
func (f MigrateRepo) ParseRemoteAddr(user *db.User) (string, error) {
remoteAddr := strings.TrimSpace(f.CloneAddr)
// Remote address can be HTTP/HTTPS/Git URL or local path.
if strings.HasPrefix(remoteAddr, "http://") ||
strings.HasPrefix(remoteAddr, "https://") ||
strings.HasPrefix(remoteAddr, "git://") {
u,... | Base | 1 |
func (p *HTTPClient) Read(buf []byte) (int, error) {
if p.response == nil {
return 0, NewTransportException(NOT_OPEN, "Response buffer is empty, no request.")
}
n, err := p.response.Body.Read(buf)
if n > 0 && (err == nil || err == io.EOF) {
return n, nil
}
return n, NewTransportExceptionFromError(err)
} | Base | 1 |
func (x *DeleteStorageObjectRequest) Reset() {
*x = DeleteStorageObjectRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_console_proto_msgTypes[21]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
} | Base | 1 |
func (ctx *cbcAEAD) Seal(dst, nonce, plaintext, data []byte) []byte {
// Output buffer -- must take care not to mangle plaintext input.
ciphertext := make([]byte, len(plaintext)+ctx.Overhead())[:len(plaintext)]
copy(ciphertext, plaintext)
ciphertext = padBuffer(ciphertext, ctx.blockCipher.BlockSize())
cbc := ciph... | Base | 1 |
func (m *C) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowC
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= uint64... | Variant | 0 |
func TestReadMIMEHeaderNonCompliant(t *testing.T) {
// Invalid HTTP response header as sent by an Axis security
// camera: (this is handled by IE, Firefox, Chrome, curl, etc.)
r := reader("Foo: bar\r\n" +
"Content-Language: en\r\n" +
"SID : 0\r\n" +
"Audio Mode : None\r\n" +
"Privilege : 127\r\n\r\n")
m, er... | Base | 1 |
func (*StorageCollectionsList) Descriptor() ([]byte, []int) {
return file_console_proto_rawDescGZIP(), []int{34}
} | Base | 1 |
func (m *Int64Value) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowWrappers
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
... | Variant | 0 |
if rf, ok := ret.Get(0).(func(string, kube.ResourceKey, func(v1alpha1.ResourceNode, string)) error); ok {
r0 = rf(server, key, action)
} else {
r0 = ret.Error(0)
}
return r0
} | Class | 2 |
func (db *DB) Verify(s *data.Signed, role string, minVersion int64) error {
err := db.VerifyIgnoreExpiredCheck(s, role, minVersion)
if err != nil {
return err
}
sm := &signedMeta{}
if err := json.Unmarshal(s.Signed, sm); err != nil {
return err
}
if IsExpired(sm.Expires) {
return ErrExpired{sm.Expires}... | Base | 1 |
func (x *CallApiEndpointResponse) Reset() {
*x = CallApiEndpointResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_console_proto_msgTypes[13]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
} | Base | 1 |
func (*ListPurchasesRequest) Descriptor() ([]byte, []int) {
return file_console_proto_rawDescGZIP(), []int{28}
} | Base | 1 |
func (x *MatchStateRequest) ProtoReflect() protoreflect.Message {
mi := &file_console_proto_msgTypes[32]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
} | Base | 1 |
func TestCORSFilter_AllowedDomains(t *testing.T) {
for _, each := range allowedDomainInput {
tearDown()
ws := new(WebService)
ws.Route(ws.PUT("/cors").To(dummy))
Add(ws)
cors := CrossOriginResourceSharing{
AllowedDomains: each.domains,
CookiesAllowed: true,
Container: DefaultContainer}
Filte... | Base | 1 |
func TestService_ListSoftware(t *testing.T) {
ds := new(mock.Store)
var calledWithTeamID *uint
var calledWithOpt fleet.SoftwareListOptions
ds.ListSoftwareFunc = func(ctx context.Context, opt fleet.SoftwareListOptions) ([]fleet.Software, error) {
calledWithTeamID = opt.TeamID
calledWithOpt = opt
return []flee... | Class | 2 |
func (x *ConsoleSession) Reset() {
*x = ConsoleSession{}
if protoimpl.UnsafeEnabled {
mi := &file_console_proto_msgTypes[15]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
} | Base | 1 |
func (svc *Service) GetHost(ctx context.Context, id uint) (*fleet.HostDetail, error) {
alreadyAuthd := svc.authz.IsAuthenticatedWith(ctx, authz_ctx.AuthnDeviceToken)
if !alreadyAuthd {
// First ensure the user has access to list hosts, then check the specific
// host once team_id is loaded.
if err := svc.authz.... | Class | 2 |
func (x *MatchStateRequest) Reset() {
*x = MatchStateRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_console_proto_msgTypes[32]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
} | Base | 1 |
func TestUnsafeAllowPrivateRanges (t *testing.T) {
a := assert.New(t)
conf := NewConfig()
a.NoError(conf.SetDenyRanges([]string {"192.168.0.0/24", "10.0.0.0/8"}))
conf.ConnectTimeout = 10 * time.Second
conf.ExitTimeout = 10 * time.Second
conf.AdditionalErrorMessageOnDeny = "Proxy denied"
conf.UnsafeAllowPrivat... | Base | 1 |
func InitGenesis(
ctx sdk.Context,
k keeper.Keeper,
ak types.AccountKeeper,
sk types.StakingKeeper,
data types.GenesisState,
) {
// Ensure inflation module account is set on genesis
if acc := ak.GetModuleAccount(ctx, types.ModuleName); acc == nil {
panic("the inflation module account has not been set")
}
//... | Class | 2 |
func (m *NestedDefinition_NestedMessage_NestedNestedMsg) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowThetest
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
... | Variant | 0 |
func (svc *Service) ListUsers(ctx context.Context, opt fleet.UserListOptions) ([]*fleet.User, error) {
if err := svc.authz.Authorize(ctx, &fleet.User{}, fleet.ActionRead); err != nil {
return nil, err
}
return svc.ds.ListUsers(ctx, opt)
} | Class | 2 |
func queryMatches(rp *arrayPathResult, value Result) bool {
rpv := rp.query.value
if len(rpv) > 0 && rpv[0] == '~' {
// convert to bool
rpv = rpv[1:]
if value.Bool() {
value = Result{Type: True}
} else {
value = Result{Type: False}
}
}
if !value.Exists() {
return false
}
if rp.query.op == "" {
... | Class | 2 |
func ZeroTierJoinNetwork(c *gin.Context) {
networkId := c.Param("id")
service.MyService.ZeroTier().ZeroTierJoinNetwork(networkId)
if len(networkId) == 0 {
c.JSON(http.StatusOK, model.Result{Success: oasis_err2.INVALID_PARAMS, Message: oasis_err2.GetMsg(oasis_err2.INVALID_PARAMS)})
return
}
c.JSON(http.StatusOK... | Base | 1 |
func IsLatestSnapshot(err error) bool {
_, ok := err.(ErrLatestSnapshot)
return ok
} | Base | 1 |
func (x *StatusList) ProtoReflect() protoreflect.Message {
mi := &file_console_proto_msgTypes[40]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
} | Base | 1 |
func (c CrossOriginResourceSharing) isOriginAllowed(origin string) bool {
if len(origin) == 0 {
return false
}
if len(c.AllowedDomains) == 0 {
return true
}
allowed := false
for _, domain := range c.AllowedDomains {
if domain == origin {
allowed = true
break
}
}
if !allowed {
if len(c.allowedO... | Base | 1 |
func TestGetDynamic(t *testing.T) {
savedServices := services
savedGetVCSDirFn := getVCSDirFn
defer func() {
services = savedServices
getVCSDirFn = savedGetVCSDirFn
}()
services = []*service{{pattern: regexp.MustCompile(".*"), get: testGet}}
getVCSDirFn = testGet
client := &http.Client{Transport: testTranspo... | Base | 1 |
func (m *Bar9) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowIssue530
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire... | Variant | 0 |
func (o *casaService) GetServerList(index, size, tp, categoryId, key string) (recommend, list, community []model.ServerAppList) {
keyName := fmt.Sprintf("list_%s_%s_%s_%s", index, size, tp, categoryId)
if result, ok := Cache.Get(keyName); ok {
res, ok := result.(string)
if ok {
json2.Unmarshal([]byte(gjson.G... | Base | 1 |
func MigratePost(c *context.Context, f form.MigrateRepo) {
c.Data["Title"] = c.Tr("new_migrate")
ctxUser := checkContextUser(c, f.Uid)
if c.Written() {
return
}
c.Data["ContextUser"] = ctxUser
if c.HasError() {
c.Success(MIGRATE)
return
}
remoteAddr, err := f.ParseRemoteAddr(c.User)
if err != nil {
... | Base | 1 |
func Test_requireProxyProtocol(t *testing.T) {
b := New("local-grpc", "local-http", nil, nil)
t.Run("required", func(t *testing.T) {
li, err := b.buildMainListener(context.Background(), &config.Config{Options: &config.Options{
UseProxyProtocol: true,
InsecureServer: true,
}})
require.NoError(t, err)
t... | Class | 2 |
onAvatarChange (input: HTMLInputElement) {
this.avatarfileInput = new ElementRef(input)
const avatarfile = this.avatarfileInput.nativeElement.files[0]
if (avatarfile.size > this.maxAvatarSize) {
this.notifier.error('Error', $localize`This image is too large.`)
return
}
const formData... | Base | 1 |
function spliceOne(list, index) {
for (var i = index, k = i + 1, n = list.length; k < n; i += 1, k += 1)
list[i] = list[k];
list.pop();
} | Base | 1 |
resolve({root: require('os').homedir()});
} else reject('Bad username or password');
}); | Base | 1 |
function has(target, path) {
"use strict";
try {
var test = reduce(target, path);
if ( typeof test !== "undefined") {
return true;
}
return false;
} catch(ex) {
console.error(ex);
return;
}
} | Base | 1 |
function get(target, path) {
"use strict";
try {
return reduce(target, path);
} catch(ex) {
console.error(ex);
return;
}
} | Base | 1 |
function generate(
target: any,
hierarchies: SetupPropParam[],
forceOverride?: boolean
) {
let current = target;
hierarchies.forEach(info => {
const descriptor = normalizeDescriptor(info);
const {value, type, create, override, created, skipped, got} = descriptor;
const name = getNonEmptyPropName(current, de... | Variant | 0 |
search.stats = function(files) {
if(files.length) {
var file = files.shift();
fs.stat(relativePath + '/' + file, function(err, stats) {
if(err) { writeError(err); }
else {
stats.name = file;
stats.isFile... | Base | 1 |
const matrix = node.getScreenCTM();
if (res && matrix) {
const [x, y, content] = res;
const t = tooltip();
t.style.opacity = "1";
t.innerHTML = content;
t.style.left = `${window.scrollX + x + matrix.e}px`;
t.style.top = `${window.scrollY + y + matrix.f - 15}px`;
} else {
... | Base | 1 |
module.exports = function(url, options) {
return fetch(url, options);
}; | Base | 1 |
async function f(v) {
if (v == 3) {
return;
}
stages.push(`f>${v}`);
await "X";
f(v + 1);
stages.push(`f<${v}`);
} | Variant | 0 |
.on("finished", () => {
if (doTraceChunk) {
// tslint:disable-next-line: no-console
warningLog(
timestamp(),
" <$$ ",
msgType,
"nbChunk = " + nbChunks.toS... | Class | 2 |
export function render_markdown_timestamp(time: number | Date): {
text: string;
tooltip_content: string;
} {
const hourformat = user_settings.twenty_four_hour_time ? "HH:mm" : "h:mm a";
const timestring = format(time, "E, MMM d yyyy, " + hourformat);
const tz_offset_str = get_tz_with_UTC_offset(tim... | Base | 1 |
export function ffprobe(file: string): Promise<IFfprobe> {
return new Promise<IFfprobe>((resolve, reject) => {
if (!file) throw new Error('no file provided')
stat(file, (err, stats) => {
if (err) throw err
exec('ffprobe -v quiet -print_format json -show_format -show_streams ' + file, (error, std... | Base | 1 |
getUrl() {
return `http://localhost:${this.port}`
} | Base | 1 |
export function initSidebar(): void {
const errorCountEl = document.getElementById("error-count");
if (errorCountEl instanceof HTMLLIElement) {
errorCount.subscribe((errorCount_val) => {
errorCountEl.classList.toggle("hidden", errorCount_val === 0);
const span = errorCountEl.querySelector("span");
... | Base | 1 |
this.transport.init(socket, (err?: Error) => {
if (err) {
callback(err);
} else {
this._rememberClientAddressAndPort();
this.messageChunker.maxMessageSize = this.transport.maxMessageSize;
// bind low level TCP transport to... | Class | 2 |
text(notificationName, data) {
const username = `<span>${formatUsername(data.display_username)}</span>`;
let description;
if (data.topic_title) {
description = `<span data-topic-id="${this.attrs.topic_id}">${data.topic_title}</span>`;
} else {
description = this.description(d... | Base | 1 |
callParserIfExistsQuery(parseNumberTypeQueryParams([['requiredNum', false, false], ['optionalNum', true, false], ['optionalNumArr', true, true], ['emptyNum', true, false], ['requiredNumArr', false, true]])),
callParserIfExistsQuery(parseBooleanTypeQueryParams([['bool', false, false], ['optionalBool', tr... | Class | 2 |
): { destroy: () => void; update: (t: () => string) => void } { | Base | 1 |
const createCommand = ({ ref, path }: Input) => {
return `git show ${ref}:${path}`;
}; | Base | 1 |
const pushVal = (obj, path, val, options = {}) => {
if (obj === undefined || obj === null || path === undefined) {
return obj;
}
// Clean the path
path = clean(path);
const pathParts = split(path);
const part = pathParts.shift();
if (pathParts.length) {
// Generate the path part in the object if it doe... | Base | 1 |
set escape_for_html(arg:boolean)
{
this._escape_for_html = arg;
} | Base | 1 |
Object.keys(data).forEach((key) => {
obj.add(deserializer(data[key], baseType) as T);
}); | Base | 1 |
handler: function (grid, rowIndex) {
let data = grid.getStore().getAt(rowIndex);
pimcore.helpers.deleteConfirm(t('translation'), data.data.key, function () {
grid.getStore().removeAt(rowIndex);
}.bind... | Base | 1 |
function parseComplexParam(queryParams: Object, keys: Object, value: any): void {
let currentParams = queryParams;
let keysLastIndex = keys.length - 1;
for (let j = 0; j <= keysLastIndex; j++) {
let key = keys[j] === '' ? currentParams.length : keys[j];
if (j < keysLastIndex) {
// The value has to b... | Base | 1 |
constructor() {
super();
this._aborted = 0;
this._helloReceived = false;
this.receiveBufferSize = 0;
this.sendBufferSize = 0;
this.maxMessageSize = 0;
this.maxChunkCount = 0;
this.protocolVersion = 0;
} | Class | 2 |
async function validateSystemTransfer(
message: Message,
meta: ConfirmedTransactionMeta,
recipient: Recipient
): Promise<[BigNumber, BigNumber]> {
const accountIndex = message.accountKeys.findIndex((pubkey) => pubkey.equals(recipient));
if (accountIndex === -1) throw new ValidateTransferError('recip... | Class | 2 |
export function buildQueryString(params: Object, traditional?: Boolean): string {
let pairs = [];
let keys = Object.keys(params || {}).sort();
for (let i = 0, len = keys.length; i < len; i++) {
let key = keys[i];
pairs = pairs.concat(buildParam(key, params[key], traditional));
}
if (pairs.length === ... | Base | 1 |
var getDefaultObject = function () {
return {
nested: {
thing: {
foo: 'bar'
},
is: {
cool: true
}
},
dataUndefined: undefined,
dataDate: now,
dataNumber: 42,
dataString: 'foo',
dataNull: null,
dataBoolean: true
};
}; | Variant | 0 |
export const initAuth0: InitAuth0 = (params) => {
const { baseConfig, nextConfig } = getConfig(params);
// Init base layer (with base config)
const getClient = clientFactory(baseConfig, { name: 'nextjs-auth0', version });
const transientStore = new TransientStore(baseConfig);
const cookieStore = new CookieSt... | Base | 1 |
response.responseHeader.serviceResult.should.eql(StatusCodes.BadDiscoveryUrlMissing);
}
await send_registered_server_request(discoveryServerEndpointUrl, request, check_response);
}); | Base | 1 |
function detailedDataTableMapper(entry) {
const project = Projects.findOne({ _id: entry.projectId })
const mapping = [project ? project.name : '',
dayjs.utc(entry.date).format(getGlobalSetting('dateformat')),
entry.task,
projectUsers.findOne() ? projectUsers.findOne().users.find((elem) => elem._id === e... | Base | 1 |
from: globalDb.getServerTitle() + " <" + returnAddress + ">",
subject: "Testing your Sandstorm's SMTP setting",
text: "Success! Your outgoing SMTP is working.",
smtpConfig: restConfig,
});
} catch (e) {
// Attempt to give more accurate error messages for a variety of know... | Class | 2 |
use: (path) => {
useCount++;
expect(path).toEqual('somepath');
}, | Class | 2 |
function detailedDataTableMapper(entry) {
const project = Projects.findOne({ _id: entry.projectId })
const mapping = [project ? project.name : '',
dayjs.utc(entry.date).format(getGlobalSetting('dateformat')),
entry.task,
projectUsers.findOne() ? projectUsers.findOne().users.find((elem) => elem._id === e... | Base | 1 |
Object.keys(data).forEach((key) => {
obj.set(key, ctx.next(data[key]) as T);
}); | Base | 1 |
userId: projectUsers.findOne().users.find((elem) => elem._id === entry._id.userId)?.profile?.name,
totalHours,
} | Base | 1 |
scroll_to_bottom_key: common.has_mac_keyboard()
? "Fn + <span class='tooltip_right_arrow'>→</span>"
: "End",
}),
);
$(`.enter_sends_${user_settings.enter_sends}`).show();
common.adjust_mac_shortcuts(".enter_sends kbd");
} | Base | 1 |
function sendResponse(response1: Response) {
try {
assert(response1 instanceof ResponseClass);
if (message.session) {
const counterName = ResponseClass.name.replace("Response", "");
message.session.incrementRequestTotalCounter(c... | Class | 2 |
on(eventName: "message", eventHandler: (message: Buffer) => void): this; | Class | 2 |
render() {}, | Base | 1 |
handler: function ({log} = {}) {
if (!this.server.options.pasv_url) {
return this.reply(502);
}
this.connector = new PassiveConnector(this);
return this.connector.setupServer()
.then((server) => {
let address = this.server.options.pasv_url;
// Allow connecting from local
i... | Base | 1 |
buildRawNFT1GenesisTx(config: configBuildRawNFT1GenesisTx, type = 0x01) {
let config2: configBuildRawGenesisTx = {
slpGenesisOpReturn: config.slpNFT1GenesisOpReturn,
mintReceiverAddress: config.mintReceiverAddress,
mintReceiverSatoshis: config.mintReceiverSatoshis,
... | Class | 2 |
void addPathParam(String name, String value, boolean encoded) {
if (relativeUrl == null) {
// The relative URL is cleared when the first query parameter is set.
throw new AssertionError();
}
relativeUrl = relativeUrl.replace("{" + name + "}", canonicalizeForPath(value, encoded));
} | Base | 1 |
constructor (
private sanitizer: DomSanitizer,
private serverService: ServerService,
private notifier: Notifier
) { } | Base | 1 |
const renderContent = (content: string | any) => {
if (typeof content === 'string') {
return renderHTML(content);
}
return content;
}; | Base | 1 |
privateKey: this.getPrivateKey() || undefined,
securityMode: this.securityMode
});
this._requests = {};
this.messageBuilder
.on("message", (response: Response, msgType: string, requestId: number) => {
this._on_message_received(response,... | Class | 2 |
isValidUser(username, password) {
const user = users.find(user => user.username === username);
if (!user) return false;
return user.password === password;
} | Class | 2 |
export default function handleLoginFactory(handler: BaseHandleLogin, nextConfig: NextConfig): HandleLogin {
return async (req, res, options = {}): Promise<void> => {
try {
assertReqRes(req, res);
if (req.query.returnTo) {
const returnTo = Array.isArray(req.query.returnTo) ? req.query.returnTo[... | Base | 1 |
async function decodeMessage(buffer: Buffer): Promise<any> {
/*
const offset = 16 * 3 + 6;
buffer = buffer.slice(offset);
*/
const messageBuilder = new MessageBuilder({});
messageBuilder.setSecurity(MessageSecurityMode.None, SecurityPolicy.None);
let objMessage: any = null;
messageBuilde... | Class | 2 |
PageantSock.prototype.end = PageantSock.prototype.destroy = function() {
this.buffer = null;
if (this.proc) {
this.proc.kill();
this.proc = undefined;
}
}; | Base | 1 |
export function store_isFeatFlagOn(store: Store, featureFlag: St): Bo {
return _.includes(store.siteFeatureFlags, featureFlag) ||
_.includes(store.serverFeatureFlags, featureFlag);
} | Base | 1 |
type: new GraphQLNonNull(parseGraphQLSchema.viewerType),
async resolve(_source, _args, context, queryInfo) {
try {
const { config, info } = context;
return await getUserFromSessionToken(
config,
info,
queryInfo,
'user.',
... | Class | 2 |
function isExternal(url) {
let match = url.match(
/^([^:/?#]+:)?(?:\/\/([^/?#]*))?([^?#]+)?(\?[^#]*)?(#.*)?/
);
if (
typeof match[1] === 'string' &&
match[1].length > 0 &&
match[1].toLowerCase() !== location.protocol
) {
return true;
}
if (
typeof match[2] === 'string' &&
match[2... | Base | 1 |
private onWebSocket(req, socket, websocket) {
websocket.on("error", onUpgradeError);
if (
transports[req._query.transport] !== undefined &&
!transports[req._query.transport].prototype.handlesUpgrades
) {
debug("transport doesnt handle upgraded requests");
websocket.close();
... | Class | 2 |
verifyEmail(req) {
const { token, username } = req.query;
const appId = req.params.appId;
const config = Config.get(appId);
if (!config) {
this.invalidRequest();
}
if (!config.publicServerURL) {
return this.missingPublicServerURL();
}
if (!token || !username) {
ret... | Class | 2 |
export function loadFromGitSync(input: Input): string | never {
try {
return execSync(createCommand(input), { encoding: 'utf-8' });
} catch (error) {
throw createLoadError(error);
}
} | Base | 1 |
constructor (
private sanitizer: DomSanitizer,
private serverService: ServerService
) {
this.bytesPipe = new BytesPipe()
this.maxSizeText = $localize`max size`
} | Base | 1 |
`${c.amount(d.value, d.name)}<em>${day(d.date)}</em>`,
});
} | Base | 1 |
content: Buffer.concat(buffers),
mimeType: resp.headers["content-type"] || null,
});
}); | Base | 1 |
constructor(
private readonly ptarmiganService: PtarmiganService,
private readonly bitcoinService: BitcoinService,
private readonly cacheService: CacheService,
private readonly invoicesGateway: InvoicesGateway
) {
} | Base | 1 |
{ host: serverB.getUrl(), clientAuthToken: serverB.authKey, enterprise: false },
],
})
garden.events.emit("_test", "foo")
// Make sure events are flushed
await streamer.close()
expect(serverEventBusA.eventLog).to.eql([{ name: "_test", payload: "foo" }])
expect(serverEventBusB.ev... | Base | 1 |
template() {
const { pfx, model, config } = this;
const label = model.get('label') || '';
return `
<span id="${pfx}checkbox" class="${pfx}tag-status" data-tag-status></span>
<span id="${pfx}tag-label" data-tag-name>${label}</span>
<span id="${pfx}close" class="${pfx}tag-close" data-tag-... | Base | 1 |
}) => Awaitable<void>
/**
* By default, we are generating a random verification token.
* You can make it predictable or modify it as you like with this method.
* @example
* ```js
* Providers.Email({
* async generateVerificationToken() {
* return "ABC123"
* }
* })
* ```
... | Base | 1 |
function add(obj, str, val) {
"use strict";
try {
if ( typeof str !== "string") {
return;
}
if ( typeof obj !== "object") {
return;
}
if (!val) {
return;
}
var items = str.split('.');
var initial = items.slice(0,... | Base | 1 |
export async function loadFromGit(input: Input): Promise<string | never> {
try {
return await new Promise((resolve, reject) => {
exec(createCommand(input), { encoding: 'utf-8', maxBuffer: 1024 * 1024 * 1024 }, (error, stdout) => {
if (error) {
reject(error);
} else {
reso... | Base | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.