repo_name stringlengths 5 122 | path stringlengths 3 232 | text stringlengths 6 1.05M |
|---|---|---|
predominant/builder | components/builder-web/app/util.test.ts | <reponame>predominant/builder
// Copyright (c) 2016-2017 Chef Software Inc. and/or applicable contributors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/... |
predominant/builder | components/builder-web/app/shared/channels/channels.component.ts | <filename>components/builder-web/app/shared/channels/channels.component.ts<gh_stars>10-100
// Copyright (c) 2016-2017 Chef Software Inc. and/or applicable contributors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obt... |
predominant/builder | components/builder-web/cypress/integration/search.spec.ts | describe('Search', () => {
const results = () => cy.get('.results-component li');
const summary = () => cy.get('.more');
const moreLink = () => cy.get('.more a');
const none = () => cy.get('.results-component .none');
beforeEach(() => {
cy.server();
cy.fixture(`search/page-1`).as('page1');
cy.f... |
predominant/builder | components/builder-web/app/shared/shared.module.ts | // Copyright (c) 2016-2017 Chef Software Inc. and/or applicable contributors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unl... |
predominant/builder | components/builder-web/app/shared/docker-export-settings/docker-export-settings.component.ts | <gh_stars>10-100
// Copyright (c) 2016-2017 Chef Software Inc. and/or applicable contributors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICE... |
predominant/builder | components/builder-web/app/package/package-detail/package-detail.component.spec.ts | // Copyright (c) 2016-2017 Chef Software Inc. and/or applicable contributors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unl... |
predominant/builder | components/builder-web/app/shared/job-status/job-status.component.ts | <reponame>predominant/builder
import { Component, Input } from '@angular/core';
@Component({
selector: 'hab-job-status',
template: `
<hab-job-status-icon [job]="job" [animate]="true"></hab-job-status-icon>
<hab-job-status-label [job]="job"></hab-job-status-label>
`
})
export class JobStatusComponent {
... |
predominant/builder | components/builder-web/app/notifications/notifications.component.spec.ts | <filename>components/builder-web/app/notifications/notifications.component.spec.ts<gh_stars>10-100
// Copyright (c) 2016-2017 Chef Software Inc. and/or applicable contributors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You... |
predominant/builder | components/builder-web/app/package/package-promote/package-promote.component.ts | <gh_stars>10-100
import { Component, Input } from '@angular/core';
import { MatDialog } from '@angular/material';
import { AppStore } from '../../app.store';
import { promotePackage } from '../../actions/index';
import { SimpleConfirmDialog } from '../../shared/dialog/simple-confirm/simple-confirm.dialog';
@Component(... |
predominant/builder | components/builder-web/app/package/package.module.ts | <gh_stars>1-10
// Copyright (c) 2016-2017 Chef Software Inc. and/or applicable contributors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENS... |
predominant/builder | components/builder-web/app/package/package-sidebar/package-sidebar.component.ts | <gh_stars>1-10
// Copyright (c) 2016-2017 Chef Software Inc. and/or applicable contributors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENS... |
predominant/builder | components/builder-web/app/actions/gitHub.ts | // Copyright (c) 2016-2017 Chef Software Inc. and/or applicable contributors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unl... |
predominant/builder | components/builder-web/app/origin/origin-page/origin-packages-tab/origin-packages-tab.component.ts | <gh_stars>0
// Copyright (c) 2016-2017 Chef Software Inc. and/or applicable contributors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2... |
predominant/builder | components/builder-web/app/side-nav/side-nav.component.spec.ts | // Copyright (c) 2016-2017 Chef Software Inc. and/or applicable contributors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unl... |
predominant/builder | components/builder-web/cypress/integration/home.spec.ts | <reponame>predominant/builder
describe('The default route', () => {
beforeEach(() => {
cy.server();
cy.fixture('search/some').as('some');
cy.route('GET', '/v1/depot/pkgs/core?range=0&distinct=true', '@some');
cy.visit('/#/');
});
it('renders the search view', () => {
cy.get('header h1').shou... |
predominant/builder | components/builder-web/app/origin/origin-page/origin-page-routing.module.ts | <reponame>predominant/builder
// Copyright (c) 2016-2017 Chef Software Inc. and/or applicable contributors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/... |
predominant/builder | components/builder-web/app/shared/copyable/copyable.component.ts | // Copyright (c) 2016-2017 Chef Software Inc. and/or applicable contributors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unl... |
predominant/builder | components/builder-web/app/shared/docker-export-settings/dialog/docker-export-settings.dialog.ts | <reponame>predominant/builder
// Copyright (c) 2016-2017 Chef Software Inc. and/or applicable contributors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/... |
predominant/builder | components/builder-web/app/shared/job-status-label/job-status-label.component.ts | import { Component, Input } from '@angular/core';
import { iconForJobState, labelForJobState } from '../../util';
@Component({
selector: 'hab-job-status-label',
template: `<span [class]="classFor(job)" [title]="labelFor(job)">{{ labelFor(job) }}</span>`
})
export class JobStatusLabelComponent {
@Input() job: ob... |
predominant/builder | components/builder-web/app/reducers/jobs.ts | <reponame>predominant/builder<filename>components/builder-web/app/reducers/jobs.ts
// Copyright (c) 2016-2017 Chef Software Inc. and/or applicable contributors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a co... |
predominant/builder | components/builder-web/app/sign-in-page/sign-in-page.component.ts | // Copyright (c) 2016-2017 Chef Software Inc. and/or applicable contributors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unl... |
Hyurl/sfn-schedule-parser | src/util.ts | <filename>src/util.ts
import { DateTimeLike, DateTime } from "./types";
import { TimeoutLimit, BigMonths, ReversedProps, Props } from "./consts";
export function ucfirst(str: string): string {
return str[0].toUpperCase() + str.substring(1);
}
export function isWildcard(data: any): boolean {
return typeof data... |
Hyurl/sfn-schedule-parser | src/index.ts | <reponame>Hyurl/sfn-schedule-parser<filename>src/index.ts
import assign = require("lodash/assign");
import { DateTimeLike, DateTime } from "./types";
import { parseDateString, parseDateStatement } from "./parser";
import { shouldRunOnce, getNextTick, getTicKState, getBestInterval, getBestTimeout } from "./util";
expor... |
Hyurl/sfn-schedule-parser | src/parser.ts | import trimRight = require("lodash/trimEnd");
import { DateTimeLike } from "./types";
import { Weekdays2, Months, Beginnings, Endings, Weekdays } from "./consts";
import { ucfirst, isWildcard } from "./util";
function getNum(str: string): string | number {
if (str === undefined) {
return undefined;
} e... |
Hyurl/sfn-schedule-parser | src/consts.ts | import { DateTime } from "./types";
export const Months = [
undefined,
"Jan",
"Feb",
"Mar",
"Apr",
"May",
"Jun",
"Jul",
"Aug",
"Sept",
"Oct",
"Nov",
"Dec"
];
export const BigMonths = [1, 3, 5, 7, 8, 10, 12];
export const Weekdays = [
"Sunday",
"Monday",
... |
Hyurl/sfn-schedule-parser | src/types.ts | <filename>src/types.ts
export interface DateTimeLike {
/** 2018+. */
year?: string | number;
/** Day of week, `0` - `6`, `0` represents Sunday. */
day?: string | number;
/** `1` - `12`. */
month?: string | number;
/** Day of month, `1` - `31`. */
date?: string | number;
/** `0` - `23... |
akito0107/favalid | src/__tests__/utils.test.ts | import * as assert from "power-assert";
import { hasError, isBlank } from "../util";
describe("isBlank", () => {
test("expected true when got null", () => {
const actual = isBlank(null);
assert.equal(actual, true);
});
test("expected true when got undefined", () => {
const actual = isBlank(undefined... |
akito0107/favalid | src/util.ts | <gh_stars>10-100
import { SchemaValidationResult, ValidationResult } from "./core";
const isNil = (arg: any): boolean => arg === null || arg === undefined;
const isEmpty = (arg: any): boolean => {
switch (typeof arg) {
case "string":
return arg === "";
case "object":
// refs: https://github.com/... |
akito0107/favalid | src/main.ts | <reponame>akito0107/favalid
export { tester, combine, combineWithReducer } from "./core";
export {
asyncCombine,
asyncCombineWithReducer,
asyncTester,
toAsync
} from "./async";
export { default as required } from "./validators/required";
export { default as max } from "./validators/numbers.max";
export { defaul... |
akito0107/favalid | src/__tests__/conditional.test.ts | <filename>src/__tests__/conditional.test.ts
import * as assert from "power-assert";
import { combine, tester } from "../core";
import { conditional, maxLength, minLength, required } from "../main";
import { isString } from "../util";
describe("conditional", () => {
test("stop early", () => {
const prerequiments ... |
akito0107/favalid | src/validators/date.min.ts | <reponame>akito0107/favalid
import { Messager, tester, ValueValidator } from "../core";
export default (date: Date, messager: Messager): ValueValidator => {
return tester((v: Date) => {
return date < v;
}, messager);
};
|
akito0107/favalid | src/schema.ts | <gh_stars>10-100
import { default as conditional } from "./conditional";
import { Messager, SchemaValidationResult, SchemaValidator } from "./core";
import required from "./validators/required";
export const shape = <T extends object>(obj: T): SchemaValidator<T> => {
return (o: object) => {
return Object.keys(ob... |
akito0107/favalid | src/validators/required.ts | <reponame>akito0107/favalid<gh_stars>10-100
import { Messager, tester, ValueValidator } from "../core";
import { isBlank, isString } from "../util";
export default (messager: Messager): ValueValidator => {
return tester(v => {
if (isString(v)) {
v = v.trim();
}
return !isBlank(v);
}, messager);
}... |
akito0107/favalid | src/conditional.ts | <filename>src/conditional.ts
import { Validator } from "./core";
import { hasError } from "./util";
export default (requirements: Validator, main: Validator): Validator => {
return <T>(...args: T[]) => {
const precondition = requirements(...args);
if (hasError(precondition)) {
return {
...preco... |
akito0107/favalid | src/__tests__/async.test.ts | import {
asyncCombine,
asyncCombineWithReducer,
asyncTester,
toAsync
} from "../async";
import { defaultReducer, tester } from "../core";
import { asyncHelper } from "../validators/__tests__/helper";
describe("async", () => {
test("basic", async () => {
await asyncHelper(
asyncTester(
() ... |
akito0107/favalid | src/examples/email.ts | <filename>src/examples/email.ts
import {
combine,
combineWithReducer,
maxLength,
minLength,
regexp,
required
} from "../main";
import { isBlank } from "../util";
const REQUIRED_EMAIL_MESSAGE = () => "required.";
const EMAIL_REGEXP = /^(([^<>()[\].,;:\s@"]+(\.[^<>()[\].,;:\s@"]+)*)|(".+"))@(([^<>()[\].,;:\... |
akito0107/favalid | src/__tests__/schema.test.ts | import * as assert from "power-assert";
import { combine, tester } from "../core";
import { emailValidator } from "../examples/email";
import {
conditional,
maxLength,
minLength,
required,
safeShape
} from "../main";
import { shape } from "../schema";
import { isString } from "../util";
describe("schema", ()... |
akito0107/favalid | src/core.ts | export type Test = (...v: any[]) => boolean;
export type AsyncTest = (...v: any[]) => Promise<boolean>;
export type SchemaValidator<T extends object> = (
v?: any
) => SchemaValidationResult<T>;
export type ValueValidator = (...v: any[]) => ValidationResult;
export type Validator = ValueValidator | SchemaValidator<ob... |
wwwwelton/nodejs-gobarber-gostack11 | src/shared/container/providers/CacheProvider/models/ICacheProvider.ts | <gh_stars>10-100
import ICacheProviderDTO from '../dtos/ICacheProviderDTO';
export default interface ICacheProvider {
save(data: ICacheProviderDTO): Promise<void>;
recover<T>(key: string): Promise<T | null>;
invalidate(key: string): Promise<void>;
invalidatePrefix(prefix: string): Promise<void>;
}
|
swimly/rollup-template | src/components/index.ts | <filename>src/components/index.ts
export default 'ddd'
|
roblav96/register-futon-media | src/plugins/HotFlash.ts | <filename>src/plugins/HotFlash.ts
import { PluginFunction } from 'vue'
export const HotFlash = {
install: function(Vue) {
if (process.env.NODE_ENV == 'production') return
module.hot.removeStatusHandler(HotFlash.statusHandler)
module.hot.addStatusHandler(HotFlash.statusHandler)
} as PluginFunction<never>,
sta... |
roblav96/register-futon-media | src/vm.ts | <gh_stars>0
import { Vue, Component } from 'vue-property-decorator'
import router from './router'
import App from './App.vue'
@Component({ router, render: h => h(App) })
class Vm extends Vue {
created() {
console.log(`created`)
router.onReady(route => {
this.$mount('#app')
})
}
mounted() {
console.log(`m... |
roblav96/register-futon-media | src/main.ts | // import 'dts-generate'
import '@ibm/plex/css/ibm-plex.css'
import '@mdi/font/css/materialdesignicons.css'
import './styles/variables.scss'
// import 'tailwindcss/base.css'
import 'tailwindcss/utilities.css'
import Vue from 'vue'
Vue.config.productionTip = false
Vue.config.performance = false
Vue.config.devtools = f... |
roblav96/register-futon-media | src/router.ts | <gh_stars>0
import Vue from 'vue'
import VueRouter from 'vue-router'
Vue.use(VueRouter)
export default new VueRouter({
mode: 'history',
base: process.env.BASE_URL,
linkActiveClass: 'is-active',
routes: [
{ path: '*', redirect: { name: 'home' } },
{
path: '/',
name: 'home',
component: () => import('./... |
roblav96/register-futon-media | types/vue.d.ts | import Vue, { VueConstructor, DirectiveOptions } from 'vue'
declare module 'vue/types/vue' {
interface VueConstructor {
prototype: Vue
}
}
declare module 'vue/types/options' {
interface DirectiveOptions {
[key: string]: any
}
}
declare module 'vue/types/vnode' {
interface VNodeDirective {
rawName: string
... |
roblav96/register-futon-media | src/plugins/VHelpers.ts | import Vue, { PluginFunction } from 'vue'
import * as _ from 'lodash'
export const VHelpers = {
install: function(Vue) {
Object.defineProperty(Vue.prototype, '$vm', {
get(this: Vue) {
return this.$root
},
configurable: false,
enumerable: false,
})
Vue.prototype.$_ = _
Vue.prototype.$log = cons... |
tojurnru/poe-guild-application-scanner | src/api/github.ts | import axios from 'axios';
import parse = require('csv-parse/lib/sync');
import { axiosErrorHandler } from './errorHandler';
export type Blacklist = {
account_name: string;
discord_id: string;
blacklisted_on: string;
reason: string;
active: string;
};
export const fetchBlacklist = async (): Promise<Blackli... |
tojurnru/poe-guild-application-scanner | src/api/pathofexile.ts | <filename>src/api/pathofexile.ts
import axios from 'axios';
import cheerio from 'cheerio';
import { axiosErrorHandler } from './errorHandler';
export type Profile = {
status: string;
guild?: string;
joined?: string;
lastVisit?: string;
achievement?: string;
};
export type Characters = {
name: string;
l... |
tojurnru/poe-guild-application-scanner | src/controllers/blacklist.ts | <reponame>tojurnru/poe-guild-application-scanner
import path from 'path';
import moment from 'moment';
import logger from './logger';
import { Blacklist, fetchBlacklist } from '../api/github';
const filename = path.basename(__filename);
let blacklists: Blacklist[] = [];
let createdAt: Date;
export const getBlacklis... |
tojurnru/poe-guild-application-scanner | src/api/discord.ts | <gh_stars>0
import axios from 'axios';
import {
Message as DiscordMessage,
Channel as DiscordChannel,
} from 'discord.js';
import { axiosErrorHandler } from './errorHandler';
const { DISCORD_BOT_TOKEN = '' } = process.env;
const headers = {
Authorization: `Bot ${DISCORD_BOT_TOKEN}`,
'Content-Type': 'applicati... |
tojurnru/poe-guild-application-scanner | src/parser/parseOutput.ts | import { Message as DiscordMessage } from 'discord.js';
import { Result } from './parseMessage';
export const parseOutput = async (
result: Result,
message: DiscordMessage,
): Promise<string> => {
const {
discordId,
accountName,
characterName,
poeProfile,
charactersCount,
characters95to10... |
tojurnru/poe-guild-application-scanner | src/parser/parseEmbed.ts | import { Message as DiscordMessage } from 'discord.js';
import { Result } from './parseMessage';
export const parseEmbed = async (
result: Result,
message: DiscordMessage,
): Promise<any> => {
const {
discordId,
accountName,
characterName,
poeProfile,
charactersCount,
characters80to94,
... |
tojurnru/poe-guild-application-scanner | src/api/errorHandler.ts | import { AxiosError, AxiosResponse } from 'axios';
import logger from '../controllers/logger';
export const axiosErrorHandler = (error: AxiosError) => {
const response = error.response as AxiosResponse;
const dataStr = JSON.stringify(response.data, null, 2);
logger.error(`Axios Request: ${response.config.url}`)... |
tojurnru/poe-guild-application-scanner | src/parser/parseMessage.ts | import path from 'path';
import { Message as DiscordMessage } from 'discord.js';
import { Blacklist } from '../api/github';
import {
Profile as PoeProfile,
fetchCharacters,
fetchProfile,
} from '../api/pathofexile';
import { getBlacklists } from '../controllers/blacklist';
import logger from '../controllers/logg... |
tojurnru/poe-guild-application-scanner | src/parser/parseApplicationError.ts | <reponame>tojurnru/poe-guild-application-scanner
import { Message as DiscordMessage } from 'discord.js';
import { postMessage } from '../api/discord';
import logger from '../controllers/logger';
import ApplicationError from '../error/applicationError';
const { DISCORD_CHANNEL_OUTPUT = '' } = process.env;
const delay... |
tojurnru/poe-guild-application-scanner | src/processor.ts | import discordClient from './controllers/discord';
const { DISCORD_BOT_TOKEN } = process.env;
const run = async () => {
// login into discord and start streaming
await discordClient.login(DISCORD_BOT_TOKEN);
};
run();
|
tojurnru/poe-guild-application-scanner | src/controllers/message.ts | import path from 'path';
import { Message as DiscordMessage } from 'discord.js';
import { parseMessage } from '../parser/parseMessage';
// import { parseOutput } from '../parser/parseOutput';
import { parseEmbed } from '../parser/parseEmbed';
import {
parseThreadMessage1,
parseThreadMessage2,
} from '../parser/par... |
tojurnru/poe-guild-application-scanner | src/parser/parseThreadMessage.ts | import { Message as DiscordMessage } from 'discord.js';
import { Result } from './parseMessage';
export const parseThreadMessage1 = async (
result: Result,
message: DiscordMessage,
): Promise<string> => {
const discordId = result.discordId ? result.discordId : message.author.id;
const discordTag = result.disco... |
tojurnru/poe-guild-application-scanner | src/controllers/logger.ts | <reponame>tojurnru/poe-guild-application-scanner
import winston from 'winston';
const { LOG_LEVEL = 'info' } = process.env;
const { printf, combine, timestamp } = winston.format;
const formatter = printf(({ level, message, timestamp }) => {
return `${timestamp} | ${level} | ${message}`;
});
export default winston.... |
tojurnru/poe-guild-application-scanner | src/controllers/discord.ts | <gh_stars>0
import path from 'path';
import { Client, Intents } from 'discord.js';
import logger from './logger';
import { handleMessage } from './message';
const filename = path.basename(__filename);
const client = new Client({
intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES],
});
client
.on('read... |
ShockTr/rustlabs | src/getItemList.ts | import fetch from "node-fetch";
import cheerio from "cheerio";
export async function getItemList() : Promise<GenericItem[]> {
let res = await fetch("https://rustlabs.com/group=itemlist")
let html = await res.text()
const $ = cheerio.load(html)
let items: GenericItem[] = []
$(".info-block").children... |
ShockTr/rustlabs | src/index.ts | export {getItemList} from "./getItemList";
|
ZANJIAHAO1008/Admin-Frame-vue3-template | src/common/event.ts | // event.js
import { onMounted, onUnmounted } from "vue";
export function useEventListener(target: any, event: any, callback: any) {
// 如果你想的话,
// 也可以用字符串形式的 CSS 选择器来寻找目标 DOM 元素
onMounted(() => target.addEventListener(event, callback));
onUnmounted(() => target.removeEventListener(event, callback));
}
|
ZANJIAHAO1008/Admin-Frame-vue3-template | src/pinia/modules/tag.ts | <reponame>ZANJIAHAO1008/Admin-Frame-vue3-template<gh_stars>1-10
import { defineStore } from "pinia";
import { Tag } from "@/types/layout";
interface State {
tagsList: Tag[];
MAX_TAG_LENGTH: number;
collapse: boolean;
BLACK_LIST: string[];
}
export const useTagStore = defineStore({
id: "tag_974813758", // id... |
ZANJIAHAO1008/Admin-Frame-vue3-template | src/assets/js/dictionarie.ts | export const FONT_SIZE = [
//字体大小设置
{
value: "large",
label: "大的按钮",
},
{
value: "default",
label: "标准按钮",
},
{
value: "small",
label: "小的按钮",
},
];
|
ZANJIAHAO1008/Admin-Frame-vue3-template | src/utils/index.ts | import { ElLoading } from "element-plus";
import { unref } from "vue";
import config from "../../package.json";
export const debounce = (function () {
//防重复提交
let timer = 0;
return function (callback: Function, ms: number) {
clearTimeout(timer);
timer = setTimeout(callback, ms);
}
})();
export function... |
ZANJIAHAO1008/Admin-Frame-vue3-template | vite.config.ts | import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import * as path from "path";
import { viteMockServe } from "vite-plugin-mock";
import viteCompression from "vite-plugin-compression";
import AutoImport from "unplugin-auto-import/vite";
import Components from "unplugin-vue-components/vite";
imp... |
ZANJIAHAO1008/Admin-Frame-vue3-template | src/common/mouse.ts | <filename>src/common/mouse.ts
// mouse.js
import { ref } from "vue";
import { useEventListener } from "./event";
export function useMouse() {
const x = ref<string | number>(0);
const y = ref<string | number>(0);
interface Event {
pageX: string | number;
pageY: string | number;
}
useEventListener(wi... |
ZANJIAHAO1008/Admin-Frame-vue3-template | src/main.ts | import { createApp } from "vue";
import App from "./App.vue";
import router from "@/router";
import pinia from "@/pinia";
import "@/assets/css/font-awesome.min.css"; //font 样式
import "animate.css/animate.min.css";
import "default-passive-events";
import "vue-global-api"; //自动引入vue插件
import { loadAllPlugins } from "@/pl... |
ZANJIAHAO1008/Admin-Frame-vue3-template | src/common/watermark.ts | <reponame>ZANJIAHAO1008/Admin-Frame-vue3-template
const id = "1.234523841642.1234124163";
const setWatermark = (str: string) => {
if (document.getElementById(id) !== null) {
document.body.removeChild(document.getElementById(id) as HTMLElement);
}
// 创建一个画布
const canvas = document.createElement("canvas");
... |
ZANJIAHAO1008/Admin-Frame-vue3-template | src/plugins/element.ts | import ElementPlus from "element-plus";
import "element-plus/dist/index.css";
import i18n from "@/locales/i18n";
import Cookies from "js-cookie";
import zhCn from "element-plus/lib/locale/lang/zh-cn";
import en from "element-plus/lib/locale/lang/en";
export default function load(app: any) {
app.use(ElementPlus, {
... |
ZANJIAHAO1008/Admin-Frame-vue3-template | src/types/layout.ts | import { RouteLocationNormalized } from "vue-router";
export interface HeaderState<T> {
collapse: T;
username: T;
passVisible: boolean;
baseVisible: boolean;
versionVisible: boolean;
driver: any;
}
export interface Tag extends RouteLocationNormalized {
title?: string;
}
|
ZANJIAHAO1008/Admin-Frame-vue3-template | src/pinia/modules/user.ts | import { defineStore } from "pinia";
import { BaseInfoState } from "@/types/setting";
interface State {
user: Partial<BaseInfoState["baseInfoForm"]>;
}
export const useUserStore = defineStore({
id: "user_974813758", // id必填,且需要唯一
persist: {
enabled: true, // 开启数据缓存
},
state: (): State => {
return {
... |
ZANJIAHAO1008/Admin-Frame-vue3-template | components.d.ts | // generated by unplugin-vue-components
// We suggest you to commit this file into source control
// Read more: https://github.com/vuejs/vue-next/pull/3399
declare module "vue" {
export interface GlobalComponents {
BaseInfo: typeof import("./src/components/Setting/baseInfo.vue")["default"];
CheckPass: typeof... |
billiramirez/express-server-with-typescript | src/controllers/decorators/controller.ts | import "reflect-metadata";
import { Request, Response, RequestHandler, NextFunction } from "express";
import { AppRouter } from "../../AppRouter";
import { Methods } from "./Methods";
import { MetadataKeys } from "./MetadataKeys";
function bodyValidators(keys: string[]): RequestHandler {
return function(req: Request... |
billiramirez/express-server-with-typescript | src/index.ts | <gh_stars>0
import express from "express";
import bodyParser from "body-parser";
import cookieSession from "cookie-session";
import { AppRouter } from "./AppRouter";
import "./controllers/LoginController";
import "./controllers/RootController";
const app = express();
app.use(bodyParser.urlencoded({ extended: true })... |
jerebtw/Sepa | src/index.ts | <reponame>jerebtw/Sepa<gh_stars>0
import {
type DeclarationAttributes,
type ElementCompact,
js2xml,
} from "xml-js";
import { isValidIBAN, isValidBIC } from "ibantools";
//#region Interfaces
export interface Options {
/**
* If the xml should be pretty printed
* @default false
*/
prettyPrint?: boolea... |
klan1/app.demo | ts-output/db-models.ts | <reponame>klan1/app.demo
import { Injectable } from '@angular/core';
@Injectable()
export class DiasFestivosModel {
IdDiaFestivo: number = null;
FechaDiaFestivo: string = null;
NombreDiaFestivo: string = null;
DiaDeLaSemana: number = null;
}
export class AmbientesModel {
id: number = null;
nam... |
JamesAliaga/nest_proyect | src/app.service.ts | <filename>src/app.service.ts
import { Injectable } from '@nestjs/common';
@Injectable()
export class AppService {
getHello(): any {
return this.manifestJSON();
}
async manifestJSON() {
const axios = require("axios");
const response = await axios.get(
"https://jsonplaceholder.typicode.com/posts... |
fraxken/move-concurrently2 | index.d.ts | declare function rename(from: string, to: string): Promise<void>;
export = rename;
|
Nebulis/blog | src/components/images/asia/japan/tokyo/yasukuni-dori.tsx | <gh_stars>0
import { useStaticQuery, graphql } from "gatsby"
import Img from "gatsby-image"
import React, { useEffect } from "react"
import { ExtraImageProps } from "../../../../../types/shared"
const alt = {
yasukuniDoriNight: "Yasukuni-Dori At Night",
yasukuniDoriNight2: "Yasukuni-Dori At Night",
yasukuniDoriN... |
Nebulis/blog | src/components/images/asia/japan/tokyo/ueno-park.tsx | <filename>src/components/images/asia/japan/tokyo/ueno-park.tsx
import { useStaticQuery, graphql } from "gatsby"
import Img from "gatsby-image"
import React, { useEffect } from "react"
import { ExtraImageProps } from "../../../../../types/shared"
const alt = {
restaurant: "Ueno Park Restaurant",
park: "Ueno Park",
... |
Nebulis/blog | src/components/layout/menu.context.tsx | <filename>src/components/layout/menu.context.tsx
import React, { useEffect, useState } from "react"
import { useWindowSize } from "../hooks/useWindowSize"
import {
pageDesktopHeightWithoutBanner,
pageMobileHeightWithoutBanner,
pageMobileLandscapeHeightWithoutBanner,
} from "../core/variables"
export const MenuCo... |
Nebulis/blog | src/components/images/asia/japan/himeji/himeji-castle-images.tsx | import { useStaticQuery, graphql } from "gatsby"
import Img from "gatsby-image"
import React, { useEffect } from "react"
import { ExtraImageProps } from "../../../../../types/shared"
const alt = {
gyuKaku: "Himeji Castle Gyu Kaku",
visit: "Himeji Castle",
garden: "Himeji Castle Garden",
garden2: "Himeji Castle... |
Nebulis/blog | src/services/newsletter.ts | export const subscribe = ({ mail }: { mail: string }) => {
return fetch("https://us-central1-blog-3dd22.cloudfunctions.net/newsletter", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({
mail,
}),
}).then((res) => {
if (!res.ok) {
thr... |
Nebulis/blog | src/pages/asia/malaysia/east-malaysia/weekend-in-kuching.tsx | import React, { useContext } from "react"
import { PageProps } from "gatsby"
import i18n from "i18next"
import SEO from "../../../../components/layout/seo"
import { useCustomTranslation } from "../../../../i18n-hook"
import { Comments } from "../../../../components/core/comments"
import translationFr from "../../../../... |
Nebulis/blog | plopfile.ts | <reponame>Nebulis/blog
import { NodePlopAPI } from "plop"
const uppercase = (text: string) => text.charAt(0).toUpperCase() + text.slice(1)
export default function (plop: NodePlopAPI) {
// controller generator
plop.setGenerator("page", {
description: "create new page",
prompts: [
{
type: "inp... |
Nebulis/blog | src/components/images/asia/philippines/palawan/el-nido-tour-a.tsx | import { useStaticQuery, graphql } from "gatsby"
import Img from "gatsby-image"
import React, { useEffect } from "react"
import { ExtraImageProps } from "../../../../../types/shared"
const alt = {
bigLagoon: "El Nido Tour A Big Lagoon",
bigLagoon2: "El Nido Tour A Big Lagoon",
bigLagoon3: "El Nido Tour A Big Lag... |
Nebulis/blog | src/components/core/asia/philippines/philippines.card.tsx | <gh_stars>0
import { Card } from "../../../card"
import styled from "@emotion/styled"
import { ExtraCardProps } from "../../../../types/shared"
import { useCustomTranslation } from "../../../../i18n-hook"
import commonFr from "../../../../locales/fr/common.json"
import commonEn from "../../../../locales/en/common.json"... |
Nebulis/blog | src/pages/asia/singapore/christmas-in-singapore.tsx | <reponame>Nebulis/blog<filename>src/pages/asia/singapore/christmas-in-singapore.tsx
import React from "react"
import { PageProps } from "gatsby"
import i18n from "i18next"
import SEO from "../../../components/layout/seo"
import { useCustomTranslation } from "../../../i18n-hook"
import { Comments } from "../../../compon... |
Nebulis/blog | src/components/core/asia/philippines/console-draw-sth.ts | <gh_stars>0
/* eslint-disable prettier/prettier */
export const drawSth = () => {
console.log("TODOOOOOO")
}
|
Nebulis/blog | src/components/images/asia/japan/nagoya/toganji-images.tsx | import { useStaticQuery, graphql } from "gatsby"
import Img from "gatsby-image"
import React, { useEffect } from "react"
import { ExtraImageProps } from "../../../../../types/shared"
const alt = {
visit: "Toganji Visit",
visit2: "Toganji Visit",
visit3: "Toganji Visit",
garden: "Toganji Garden",
garden2: "To... |
Nebulis/blog | src/components/core/asia/vietnam/vietnam.colors.ts | <reponame>Nebulis/blog<filename>src/components/core/asia/vietnam/vietnam.colors.ts
export const vietnamPrimaryColor = "#ffd966"
export const vietnamPrimaryColorWithOpacity = (opacity: number) => `rgba(255,217,102,${opacity})`
export const vietnamPrimaryColorDarker = "#B88A00" // using contrast checker - lighthouse happ... |
Nebulis/blog | src/components/core/asia/singapore/singapore.cards.tsx | import { ExtraCardProps } from "../../../../types/shared"
import { useCustomTranslation } from "../../../../i18n-hook"
import commonFr from "../../../../locales/fr/common.json"
import commonEn from "../../../../locales/en/common.json"
import React, { FunctionComponent } from "react"
import { Card } from "../../../card"... |
Nebulis/blog | src/__tests__/utils.test.ts | <reponame>Nebulis/blog
import { getPathForEnglish, getPathForFrench } from "../utils"
describe("getPathForFrench", () => {
it("should work when url start with /en", () => {
expect(getPathForFrench({ pathname: "/en/bla" })).toBe("/bla")
})
it("should work when url start is /en", () => {
expect(getPathForF... |
Nebulis/blog | src/pages/asia/philippines/palawan/el-nido-tour-a.tsx | import React from "react"
import { PageProps } from "gatsby"
import i18n from "i18next"
import SEO from "../../../../components/layout/seo"
import { useCustomTranslation } from "../../../../i18n-hook"
import { Comments } from "../../../../components/core/comments"
import translationFr from "../../../../locales/fr/asia/... |
Nebulis/blog | src/components/application.tsx | <reponame>Nebulis/blog<gh_stars>0
import { graphql, PageProps, useStaticQuery } from "gatsby"
import React, { useState } from "react"
import { configureI18n } from "../i18n"
import { isEnglishPage } from "../utils"
import { useCustomTranslation } from "../i18n-hook"
configureI18n()
export const Application: React.Func... |
Nebulis/blog | src/pages/asia/philippines/palawan/el-nido-tour-b.tsx | import React from "react"
import { PageProps } from "gatsby"
import i18n from "i18next"
import SEO from "../../../../components/layout/seo"
import { useCustomTranslation } from "../../../../i18n-hook"
import { Comments } from "../../../../components/core/comments"
import translationFr from "../../../../locales/fr/asia/... |
Nebulis/blog | firebase/functions/src/contact.ts | import { adminEmail, createCors, mailgunConfiguration } from "./shared";
import express from "express";
import mailgun from "mailgun-js";
export const app = express();
app.use(createCors());
app.post("/", (req, res) => {
console.log(JSON.stringify(req.body));
const { name, message, mail, title, isPro } = req.body... |
Nebulis/blog | src/pages/asia/philippines/palawan/el-nido-which-tour.tsx | <reponame>Nebulis/blog<gh_stars>0
import React, { useContext } from "react"
import { PageProps } from "gatsby"
import i18n from "i18next"
import SEO from "../../../../components/layout/seo"
import { useCustomTranslation } from "../../../../i18n-hook"
import { Comments } from "../../../../components/core/comments"
impor... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.