repo_name
stringlengths
5
122
path
stringlengths
3
232
text
stringlengths
6
1.05M
pmkary/graph
core/api/stdlib/algorithms.ts
// // Copyright 2016 Kary Foundation, Inc. // Author: <NAME> <<EMAIL>> // namespace KaryGraph.API.StandardLibrary.Algorithms { // // ─── BFS ──────────────────────────────────────────────────────────────────────── // export function BFS ( start: Dot, steps: number ) { let bfs = ne...
pmkary/graph
core/ui/programmer-tab/ribbon.ts
// // Copyright 2016 Kary Foundation, Inc. // Author: <NAME> <<EMAIL>> // namespace KaryGraph.UI.ProgrammerTab.Ribbon { // // ─── ON RUN BUTTON CLICKED ────────────────────────────────────────────────────── // /** Run Button */ export function OnRunButtonClicked ( ) { let r...
pmkary/graph
core/ui/events.ts
<reponame>pmkary/graph // // Copyright 2016 Kary Foundation, Inc. // Author: <NAME> <<EMAIL>> // namespace KaryGraph.UI.Events { // // ─── WINDOW RESIZE ────────────────────────────────────────────────────────────── // window.onresize = event => { ProgrammerTab.Editor.layout( ); ...
pmkary/graph
core/objects/vertex/vertex-static.ts
// // Copyright 2016 Kary Foundation, Inc. // Author: <NAME> <<EMAIL>> // namespace KaryGraph.VertexStatic { // // ─── GENERATE VERTEX ID ───────────────────────────────────────────────────────── // /** * Returns the id associated to a vertex in `KaryGraph.Storage.Connections` ...
pmkary/graph
core/storage/storage.ts
// // Copyright 2016 Kary Foundation, Inc. // Author: <NAME> <<EMAIL>> // /** * This name space is used to store all the Graph's ***model information***. */ namespace KaryGraph.Storage { // // ─── CONNECTIONS ──────────────────────────────────────────────────────────────── // /** Contains all...
pmkary/graph
core/objects/vertex/arrow/line.ts
// // Copyright 2016 Kary Foundation, Inc. // Author: <NAME> <<EMAIL>> // namespace KaryGraph { // // ─── DIRECTED LINE OBJECT ─────────────────────────────────────────────────────── // export class LineArrow implements IArrow { // // ─── DEFS ─────────────────────────...
pmkary/graph
core/objects/dot/circle.ts
<gh_stars>10-100 // // Copyright 2016 Kary Foundation, Inc. // Author: <NAME> <<EMAIL>> // namespace KaryGraph.Circle { // // ─── GENERATOR ────────────────────────────────────────────────────────────────── // /** Generates a standard circle object */ export function Create ( x: number...
pmkary/graph
core/ui/editor-tab/view.ts
<filename>core/ui/editor-tab/view.ts // // Copyright 2016 Kary Foundation, Inc. // Author: <NAME> <<EMAIL>> // namespace KaryGraph { // // ─── GRAPH ────────────────────────────────────────────────────────────────────── // /** * Main ***memory*** containing the graph. Designed in ...
pmkary/graph
core/ui/loader.ts
<gh_stars>10-100 // // Copyright 2016 Kary Foundation, Inc. // Author: <NAME> <<EMAIL>> // namespace KaryGraph.UI { // // ─── LOAD IMAGES ──────────────────────────────────────────────────────────────── // /** Loads some of the necessary images to remove image loading lags. */ export f...
pmkary/graph
core/script/events.ts
<filename>core/script/events.ts<gh_stars>10-100 // // Copyright 2016 Kary Foundation, Inc. // Author: <NAME> <<EMAIL>> // namespace KaryGraph.ScriptEngine.EventHandler { // // ─── INTERFACES ───────────────────────────────────────────────────────────────── // export interface IDotEventFunctio...
pmkary/graph
core/main.ts
// // Copyright 2016 Kary Foundation, Inc. // Author: <NAME> <<EMAIL>> // /** * **Kary Graph** - A full featured Graph Theory Studio */ namespace KaryGraph { // // ─── INIT ─────────────────────────────────────────────────────────────────────── // /** * "T H E W H O L E W O R L...
pmkary/graph
core/api/api.ts
// // Copyright 2016 Kary Foundation, Inc. // Authors: <NAME> <<EMAIL>> // <NAME> <<EMAIL>> // <NAME> <<EMAIL>> // // // ────────────────────────────────────────────────── I ────────── // :::::: G R A P H : : : : : : : : // ──────────────────────────────────────────...
pmkary/graph
core/objects/vertex/arrow/interfaces.ts
// // Copyright 2016 Kary Foundation, Inc. // Author: <NAME> <<EMAIL>> // namespace KaryGraph { // // ─── ARROW BASE INTERFACE ─────────────────────────────────────────────────────── // /** * Implements the shared properties between _arrow objects_ * to implement a bridge bet...
pmkary/graph
core/objects/dot/drag-stop.ts
// // Copyright 2016 Kary Foundation, Inc. // Author: <NAME> <<EMAIL>> // namespace KaryGraph { // // ─── DRAG START FUNCTION LIST ─────────────────────────────────────────────────── // export const DragStopFunctions = [ DragStopFunctionMoveMode, DragStopFunctionRemoveM...
pmkary/graph
core/objects/vertex/vertex.ts
<reponame>pmkary/graph // // Copyright 2016 Kary Foundation, Inc. // Author: <NAME> <<EMAIL>> // module KaryGraph { // // ─── VERTEX CLASS ─────────────────────────────────────────────────────────────── // export class Vertex { // // ─── VARIABLES ─────────────────────...
pmkary/graph
core/editor/selection.ts
// // Copyright 2016 Kary Foundation, Inc. // Author: <NAME> <<EMAIL>> // namespace KaryGraph { /** * Selection - Creates a selection box and at the end of the selection * creates a list of selected nodes */ export class SelectionBox { // // ─── DEFS ────────────────────────...
pmkary/graph
core/script/engine.ts
<reponame>pmkary/graph // // Copyright 2016 Kary Foundation, Inc. // Author: <NAME> <<EMAIL>> // namespace KaryGraph.ScriptEngine { // // ─── STATUS VARS ──────────────────────────────────────────────────────────────── // /** Shows the status of runtime, good run or bad run. */ export ...
pmkary/graph
core/editor/svg.ts
// // Copyright 2016 Kary Foundation, Inc. // Author: <NAME> <<EMAIL>> // namespace KaryGraph { // // ─── ADD EVENT TO SVG ─────────────────────────────────────────────────────────── // /** Adds an ***event*** to the ***element*** */ export function AddEventOnClick ( element: ISnapObje...
pmkary/graph
core/karyfoundation/monaco/kf-comment-monaco.ts
<gh_stars>10-100 // // Copyright 2016 Kary Foundation, Inc. // Author: <NAME> <<EMAIL>> // namespace KaryFoundation.Monaco { // // ─── MAIN ─────────────────────────────────────────────────────────────────────── // export function AddSupportingMonacoTools ( editor: monaco.editor.IStandaloneCod...
pmkary/graph
core/language-tools.ts
<filename>core/language-tools.ts<gh_stars>10-100 // // Copyright 2016 Kary Foundation, Inc. // Author: <NAME> <<EMAIL>> // namespace KaryGraph.LanguageTools { // // ─── ARRAY EXISTS ─────────────────────────────────────────────────────────────── // export function ArrayExists ( array: any[ ], ...
pmkary/graph
core/constants.ts
<reponame>pmkary/graph // // Copyright 2016 Kary Foundation, Inc. // Author: <NAME> <<EMAIL>> // namespace KaryGraph { // // ─── GRAPH VIEW ───────────────────────────────────────────────────────────────── // /** Id of main Snap Paper for the Graph */ export const GraphViewId = 'GraphV...
omegadot-software/einheiten
src/index.ts
<gh_stars>0 import { Qty, isQty } from "./quantities/constructor"; import { UNITS } from "./quantities/definitions"; export { Qty, isQty }; export { UNITS };
omegadot-software/einheiten
src/quantities/constructor.ts
<reponame>omegadot-software/einheiten<filename>src/quantities/constructor.ts import { compareTo, eq, gt, gte, lt, lte, same } from "./comparators"; import { to, toBase, toPrec, toFloat, convertSingleUnit, swiftConverter } from "./conversion"; import { getAliases, getUnits, UNITY_ARRAY } from "./definitions"; import Qty...
omegadot-software/einheiten
src/__tests__/quantities.spec.ts
import { readFile as readFileFs } from "fs"; import { resolve } from "path"; import { promisify } from "util"; import { Qty } from "../index"; const readFile = promisify(readFileFs); function readUTF8File(...paths: string[]): Promise<string> { return readFile(resolve(...paths), "utf8"); } function readJSONFile(......
omegadot-software/einheiten
src/quantities/comparators.ts
<filename>src/quantities/comparators.ts import { Qty } from "./constructor"; import { throwIncompatibleUnits } from "./error"; import { UnitSource } from "./types"; import { isString } from "./utils"; export function eq(this: Qty, other: UnitSource) { return this.compareTo(other) === 0; } export function lt(this: Qt...
omegadot-software/einheiten
src/quantities/kind.ts
<gh_stars>0 import { Qty } from "./constructor"; import { IRegularObject } from "./types"; import { uniq } from "./utils"; const KINDS: IRegularObject<string> = { "-312078": "elastance", "-312058": "resistance", "-312038": "inductance", "-152058": "potential", "-152040": "magnetism", "-152038": "magnetism", "-7...
omegadot-software/einheiten
src/quantities/temperature.ts
import { Qty } from "./constructor"; import { UNITY_ARRAY } from "./definitions"; import QtyError from "./error"; import { compareArray } from "./utils"; export function isDegrees(this: Qty): boolean { // signature may not have been calculated yet return ( (!this.signature || this.signature === 400) && this.nume...
omegadot-software/einheiten
src/quantities/operators.ts
<filename>src/quantities/operators.ts import { Qty } from "./constructor"; import { PREFIX_VALUES, UNITY, UNITY_ARRAY } from "./definitions"; import QtyError, { throwIncompatibleUnits } from "./error"; import { addTempDegrees, subtractTempDegrees, subtractTemperatures } from "./temperature"; import { UnitSource, Source...
omegadot-software/einheiten
src/quantities/types.ts
import { Qty } from ".."; export interface IRegularObject<T> { [key: string]: T; } export interface IScalarAndUnit { scalar: number; numerator: string[]; denominator: string[]; } export type UnitSource = Qty | string; export type Source = UnitSource | number; export type UnitDefinition = [string[], number, stri...
omegadot-software/einheiten
src/quantities/utils.ts
<gh_stars>0 /** * Tests if a value is a string * * @param {*} value - Value to test * * @returns {boolean} true if value is a string, false otherwise */ import { isPrefix } from "./definitions"; export function isString(value: any): value is string { return typeof value === "string" || value instanceof String; ...
omegadot-software/einheiten
src/quantities/error.ts
<filename>src/quantities/error.ts /** * Custom error type definition * @constructor */ export default class QtyError extends Error {} /* * Throws incompatible units error * @param {string} left - units * @param {string} right - units incompatible with first argument * @throws "Incompatible units" error */ expo...
Zweer/tgtg-bot
src/libs/tooGoodToGo/dtos/user/retrieveUserSettings.response.dto.ts
export interface RetrieveUserSettingsResponseDto { country_iso_code: string; phone_country_code_suggestion: string; is_user_email_verified: boolean; terms_url: string; privacy_url: string; contact_form_url: string; blog_url: string; careers_url: string; education_url: string; instagram_url: string; ...
Zweer/tgtg-bot
src/functions/botSetWebhook/index.ts
<reponame>Zweer/tgtg-bot<filename>src/functions/botSetWebhook/index.ts import type { AWS } from '@serverless/typescript'; import { path, TELEGRAM_TOKEN } from '../bot'; const slsFunction: AWS['functions'][string] = { handler: `${__dirname.split(process.cwd())[1].substring(1)}/handler.main`, environment: { TEL...
Zweer/tgtg-bot
src/functions/reminder/index.ts
import type { AWS } from '@serverless/typescript'; import { DYNAMODB_TABLE_USERS, TELEGRAM_TOKEN } from '../bot'; const slsFunction: AWS['functions'][string] = { handler: `${__dirname.split(process.cwd())[1].substring(1)}/handler.main`, events: [{ schedule: 'rate(5 minutes)', }], environment: { DYNAMODB_T...
Zweer/tgtg-bot
src/models/user.ts
import { attribute, hashKey, table, } from '@aws/dynamodb-data-mapper-annotations'; import { TooGoodToGo } from '@libs/tooGoodToGo'; import { RetrieveUserResponseDto } from '@libs/tooGoodToGo/dtos/user/retrieveUser.response.dto'; import { RetrieveUserSettingsResponseDto } from '@libs/tooGoodToGo/dtos/user/retrie...
Zweer/tgtg-bot
src/libs/tooGoodToGo/dtos/auth/loginByEmail.response.dto.ts
import { RetrieveUserResponseDto } from '@libs/tooGoodToGo/dtos/user/retrieveUser.response.dto'; import { RetrieveUserSettingsResponseDto } from '@libs/tooGoodToGo/dtos/user/retrieveUserSettings.response.dto'; export interface LoginByEmailResponseDto { access_token: string; refresh_token: string; startup_data: {...
Zweer/tgtg-bot
src/libs/tooGoodToGo/models/item.ts
<gh_stars>0 import { ListItemsResponseDto } from '@libs/tooGoodToGo/dtos/item/listItems.response.dto'; export class Item { id: string; name: string; store: { id: string; name: string; address: string; latitude: number; longitude: number, }; price: number; priceCode: string; value...
Zweer/tgtg-bot
src/models/abstract.model.ts
import * as DynamoDB from 'aws-sdk/clients/dynamodb'; import { DataMapper, PutOptions } from '@aws/dynamodb-data-mapper'; import { GetOptions, ParallelScanWorkerOptions, QueryOptions, ScanOptions, } from '@aws/dynamodb-data-mapper/build/namedParameters'; import { ScanIterator } from '@aws/dynamodb-data-mapper/b...
Zweer/tgtg-bot
src/libs/tooGoodToGo/dtos/user/retrieveUser.response.dto.ts
export interface RetrieveUserResponseDto { user_id: string; name: string; country_id: string; email: string; phone_country_code: string; phone_number: string; role: string; is_partner: boolean; newsletter_opt_in: boolean; push_notifications_opt_in: boolean; }
Zweer/tgtg-bot
src/functions/index.ts
export { default as bot } from './bot'; export { default as botSetWebhook } from './botSetWebhook';
Zweer/tgtg-bot
src/functions/botSetWebhook/handler.ts
import { bot } from '@common/bot'; const { API_URL } = process.env; export const main = async () => { await bot.telegram.setWebhook(API_URL); };
Zweer/tgtg-bot
src/libs/tooGoodToGo/tooGoodToGo.ts
import axios from 'axios'; import { LoginByEmailResponseDto } from '@libs/tooGoodToGo/dtos/auth/loginByEmail.response.dto'; import { LoginByEmailRequestDto } from '@libs/tooGoodToGo/dtos/auth/loginByEmail.request.dto'; import { ListItemsResponseDto } from '@libs/tooGoodToGo/dtos/item/listItems.response.dto'; import { ...
Zweer/tgtg-bot
src/functions/bot/routes/remind.ts
<gh_stars>0 import { Context } from 'telegraf'; import { User } from '@models/user'; export const remindAction = 'remind'; export const remindHandler = async (ctx: Context) => { console.log(ctx); const user = await User.retrieve(`${ctx.message.chat.id}`); user.remind = !user.remind; await user.put(); aw...
Zweer/tgtg-bot
src/functions/bot/handler.ts
<reponame>Zweer/tgtg-bot<filename>src/functions/bot/handler.ts import 'source-map-support/register'; import DynamoDBSession from 'telegraf-session-dynamodb'; import { bot } from '@common/bot'; import { formatJSONResponse } from '@libs/apiGateway'; import { middyfy } from '@libs/lambda'; import { listAction, listHand...
Zweer/tgtg-bot
src/common/bot.ts
<reponame>Zweer/tgtg-bot import { Telegraf, Scenes } from 'telegraf'; import { Item } from '@libs/tooGoodToGo/models/item'; const token = process.env.TELEGRAM_TOKEN; if (!token) { throw new Error('TELEGRAM_TOKEN must be provided!'); } export const bot = new Telegraf<Scenes.WizardContext>(token, { telegram: { webh...
Zweer/tgtg-bot
serverless.ts
/* eslint-disable no-template-curly-in-string */ import type { AWS } from '@serverless/typescript'; import { bot, botSetWebhook } from './src/functions'; const serverlessConfiguration: AWS = { service: 'tgtg', frameworkVersion: '2', custom: { webpack: { webpackConfig: './webpack.config.js', inc...
Zweer/tgtg-bot
src/libs/tooGoodToGo/index.ts
export * from './tooGoodToGo';
Zweer/tgtg-bot
src/functions/bot/routes/list.ts
<filename>src/functions/bot/routes/list.ts import { Context } from 'telegraf'; import { User } from '@models/user'; import { itemsListToMessage } from '@common/bot'; export const listAction = 'list'; export const listHandler = async (ctx: Context) => { const user = await User.retrieve(`${ctx.message.chat.id}`); ...
Zweer/tgtg-bot
src/functions/bot/routes/start.ts
import { Composer, Scenes } from 'telegraf'; import { User } from '@models/user'; interface StartWizardSession extends Scenes.WizardSessionData { email: string; password: string; } type StartWizardContext = Scenes.WizardContext<StartWizardSession>; export const startSceneId = 'start-wizard'; const startWizard ...
Zweer/tgtg-bot
src/libs/tooGoodToGo/dtos/auth/refreshToken.request.dto.ts
<gh_stars>0 export interface RefreshTokenRequestDto { refresh_token: string; }
Zweer/tgtg-bot
src/libs/tooGoodToGo/dtos/item/listItems.response.dto.ts
export interface ListItemsResponseDto { items: { item: { item_id: string; price: { code: string; minor_units: number; decimals: number; }, sales_taxes: [], tax_amount: { code: string; minor_units: number; decimals: number; }, ...
Zweer/tgtg-bot
src/functions/reminder/handler.ts
import { createHash } from 'crypto'; import { bot, itemsListToMessage } from '@common/bot'; import { User } from '@models/user'; function hashObj(obj: any) { return createHash('sha256') .update(JSON.stringify(obj)) .digest('hex'); } export const main = async () => { // eslint-disable-next-line no-restric...
Zweer/tgtg-bot
src/libs/tooGoodToGo/dtos/item/listItems.request.dto.ts
<gh_stars>0 export interface ListItemsRequestDto { user_id: string; // "47625395", origin: { latitude: number; longitude: number; }; radius: number; // 21, page_size: number; // 20, page: number; // 1, discover: boolean; // false, favorites_only: boolean; // true, item_categories: []; diet_c...
Zweer/tgtg-bot
src/libs/tooGoodToGo/dtos/auth/loginByEmail.request.dto.ts
export interface LoginByEmailRequestDto { email: string; password: string; device_type: string; }
Zweer/tgtg-bot
test/libs/tooGoodToGo/tooGoodToGo.spec.ts
<reponame>Zweer/tgtg-bot<gh_stars>0 import { TooGoodToGo } from '@libs/tooGoodToGo/tooGoodToGo'; describe('Too Good To Go', () => { const email = process.env.TOOGOODTOGO_EMAIL || '<EMAIL>'; const password = process.env.TOOGOODTOGO_PASSWORD || 'password'; let tooGoodToGo: TooGoodToGo; beforeEach(async () => {...
Zweer/tgtg-bot
src/functions/bot/index.ts
import type { AWS } from '@serverless/typescript'; export const path = 'telegram'; // eslint-disable-next-line no-template-curly-in-string export const DYNAMODB_TABLE_USERS = '${self:custom.resourceNames.tables.users}'; // eslint-disable-next-line no-template-curly-in-string export const TELEGRAM_TOKEN = '${ssm:/aws/r...
Spikatrix/aws-s3
dist/src/Signature.d.ts
<filename>dist/src/Signature.d.ts import { IConfig, DateYMD } from "./types"; export default class Signature { static getSignature(config: IConfig, date: DateYMD, policyBase64: string): string; }
Spikatrix/aws-s3
dist/src/Date.d.ts
<filename>dist/src/Date.d.ts import { DateISOString, DateYMD, XAmzDate } from "./types"; export declare const dateISOString: DateISOString; export declare const xAmzDate: XAmzDate; export declare const dateYMD: DateYMD;
Spikatrix/aws-s3
utils.ts
interface ProgressResponse{ ok: boolean, status: number, event: XMLHttpRequest, } /** * Fetch with porgress callback * @param url * @param opts * @param onProgress * @returns {Promise} */ export function fetchWithProgress (url: string, opts: RequestInit, onProgress?: ((this: XMLHttpRequest, ev: ProgressEv...
Spikatrix/aws-s3
dist/src/ErrorThrower.d.ts
import { IConfig } from "./types"; export declare const throwError: (config: IConfig, file: File) => void;
Spikatrix/aws-s3
dist/utils.d.ts
<gh_stars>0 interface ProgressResponse { ok: boolean; status: number; event: XMLHttpRequest; } /** * Fetch with porgress callback * @param url * @param opts * @param onProgress * @returns {Promise} */ export declare function fetchWithProgress(url: string, opts: RequestInit, onProgress?: ((this: XMLHtt...
alitajs/umi-plugin-packages
packages/umi-plugin-authority/src/index.ts
import { IApi } from 'umi'; import { join } from 'path'; import getContextContent from './utils/get-context'; import getProviderContent from './utils/get-provider'; import getContent from './utils/get-content'; import getRootContainerContent from './utils/get-root-container'; import { checkIfHasDefaultExporting } from ...
alitajs/umi-plugin-packages
packages/umi-plugin-console-version/src/utils.ts
import { camelCase } from 'lodash'; /** * 获取处理后的项目名称 * @param pkgName */ export function getProjectName(pkgName: string) { // strip none @umijs scope if (pkgName.charAt(0) === '@') { pkgName = pkgName.split('/')[1]; } return nameToKey(pkgName); } function nameToKey(name: string) { return name .sp...
alitajs/umi-plugin-packages
packages/umi-plugin-authority/src/utils/get-provider.ts
import { utils } from 'umi'; import { join } from 'path'; export default function(util: typeof utils) { return `\ import React, { useMemo } from 'react'; import { IRoute } from 'umi'; import Policy from '@pansy/policy'; import { useModel } from '../core/umiExports'; import authorityFactory from '../../authority'; im...
alitajs/umi-plugin-packages
packages/umi-preset-react/src/index.ts
export default () => { return { plugins: [ require.resolve('@alitajs/umi-plugin-authority'), require.resolve('@alitajs/umi-plugin-locale-plus'), require.resolve('@umijs/plugin-analytics'), require.resolve('@umijs/plugin-antd'), require.resolve('@umijs/plugin-dva'), require.reso...
alitajs/umi-plugin-packages
packages/umi-plugin-authority/src/utils/get-context.ts
<reponame>alitajs/umi-plugin-packages<gh_stars>10-100 export default function() { return `\ import React from 'react'; import Policy from '@pansy/policy'; export type AuthorityInstance = Policy; const AuthorityContext = React.createContext<Policy>(null!); export default AuthorityContext; `; }
alitajs/umi-plugin-packages
packages/umi-plugin-console-version/src/index.ts
import { IApi } from '@umijs/types'; import { getProjectName } from './utils'; export default function (api: IApi) { const pkgName = api.pkg?.name; const pkgVersion = api.pkg?.version; api.describe({ key: 'consoleVersion', config: { default: { bindGlobal: false }, schema(joi) {...
alitajs/umi-plugin-packages
packages/umi-plugin-authority/tests/__mocks__/fs.ts
<reponame>alitajs/umi-plugin-packages<filename>packages/umi-plugin-authority/tests/__mocks__/fs.ts interface FS { existsSync: (filePath: string) => boolean; readFileSync: (filePath: string) => string; readdirSync: (dirPath: string) => string; } const fs = jest.genMockFromModule<FS>('fs'); const PathToAuthority ...
alitajs/umi-plugin-packages
packages/umi-plugin-authority/tests/utils/get-content.test.ts
import getContent from '../../src/utils/get-content'; describe('getAccessContent', () => { it('should return content string when call getAccessContent', () => { const result = getContent(); expect(typeof result).toBe('string'); expect(result.length).toBeGreaterThan(0); }); });
alitajs/umi-plugin-packages
packages/umi-plugin-authority/src/utils/get-content.ts
export default function() { return `\ import React, { useContext } from 'react'; import Policy, { Action, PolicyData, Separator } from '@pansy/policy'; import AuthorityContext from './context'; export type AuthorityInstance = Policy; export interface AuthorityProps { access?: string | string[]; accessible?: boo...
alitajs/umi-plugin-packages
packages/umi-plugin-authority/tests/utils/runtimeUtil.test.ts
<filename>packages/umi-plugin-authority/tests/utils/runtimeUtil.test.ts import { IRoute } from 'umi'; import Policy, { Action } from '@pansy/policy'; import { traverseModifyRoutes } from '../../src/utils/runtimeUtil'; const actions: Action[] = [ { module: 'module1', action: 'action1' }, { module: 'module1', action...
alitajs/umi-plugin-packages
packages/umi-plugin-antd-plus/src/index.ts
<gh_stars>10-100 import { dirname } from 'path'; import { IApi } from 'umi'; export default (api: IApi) => { api.modifyBabelPresetOpts(opts => { return { ...opts, import: (opts.import || []).concat([ { libraryName: '@alitajs/antd-plus', libraryDirectory: 'es', style: true }, ]), };...
alitajs/umi-plugin-packages
packages/umi-plugin-authority/src/utils/get-root-container.ts
export default function() { return `\ import React from 'react'; import AuthorityProvider from './authority-provider'; export function rootContainer(container: React.ReactNode, { routes }) { return React.createElement(AuthorityProvider, { routes }, container); } `; }
alitajs/umi-plugin-packages
packages/umi-plugin-authority/tests/utils/get-context.test.ts
import getAccessContent from '../../src/utils/get-context'; describe('getAccessContent', () => { it('should return content string when call getAccessContent', () => { const result = getAccessContent(); expect(typeof result).toBe('string'); expect(result.length).toBeGreaterThan(0); }); });
alitajs/umi-plugin-packages
packages/umi-plugin-authority/src/fixtures/normal/authority.ts
// src/access.ts export default function() { return { actions: [ { module: 'module1', action: 'action1' }, { module: 'module1', action: 'action2' }, { module: 'module1', action: 'action3' }, { module: 'module2', action: 'action1' }, { module: 'module2', action: 'action2' }, ], ...
alitajs/umi-plugin-packages
packages/umi-plugin-authority/src/fixtures/normal/.umirc.ts
export default { routes: [ { path: '/', component: 'index', authority: 'module1/action1' }, ], plugins: [ require.resolve('../../'), require.resolve('@umijs/plugin-initial-state'), require.resolve('@umijs/plugin-model'), ] }
alitajs/umi-plugin-packages
packages/umi-plugin-console-version/src/utils.test.ts
import { getProjectName } from './utils'; describe('getProjectName', () => { it('lins', () => { expect(getProjectName('lins')).toEqual('lins'); }); it('lins-plus', () => { expect(getProjectName('lins-plus')).toEqual('linsPlus'); }); it('@alita/lins', () => { expect(getProjectName('@alita/lins')...
zipmex/use-screenshot
example/src/close.tsx
import * as React from "react"; function CloseIcon(props: React.SVGProps<SVGSVGElement>) { return ( <svg height="1em" viewBox="0 0 329.269 329" width="1em" {...props}> <path d="M194.8 164.77L323.013 36.555c8.343-8.34 8.343-21.825 0-30.164-8.34-8.34-21.825-8.34-30.164 0L164.633 134.605 36.422 6.391c-8.344-8...
zipmex/use-screenshot
example/src/App.tsx
import React, { useRef } from "react"; import { useScreenshot } from "use-screenshot-hook"; import GithubIcon from "./github"; import CloseIcon from "./close"; const App = () => { const ref = useRef(null); const { image, takeScreenshot, isLoading, clear } = useScreenshot(); return ( <div className={["contai...
mooyoul/is-webp-extended
index.ts
const RIFF = new Uint8Array([ 0x52, 0x49, 0x46, 0x46, ]); const WEBP = new Uint8Array([ 0x57, 0x45, 0x42, 0x50, ]); const ANMF = new Uint8Array([ 0x41, 0x4e, 0x4d, 0x46, ]); export async function isWebP(input: ArrayBuffer | Blob) { const chunk = await readBytes(input, 0, 12); const buf = new Uint8Array(chu...
Vheissu/au-cardigan-ui
src/components/au-select.ts
<filename>src/components/au-select.ts import { bindable, ICustomElementViewModel, customElement, BindingMode, shadowCSS } from '@aurelia/runtime-html'; import SharedStyles from '../variables.css'; import styles from './au-select.css'; import template from './au-select.html'; @customElement({ name: 'au-select', ...
Vheissu/au-cardigan-ui
src/components/au-modal.ts
<filename>src/components/au-modal.ts import { bindable, ICustomElementViewModel, customElement, shadowCSS } from '@aurelia/runtime-html'; import SharedStyles from '../variables.css'; import styles from './au-modal.css'; import template from './au-modal.html'; export type ModalSize = 'sm' | 'md' | 'lg' | number; expo...
Vheissu/au-cardigan-ui
src/components/au-button.ts
<reponame>Vheissu/au-cardigan-ui import { bindable, ICustomElementViewModel, customElement, shadowCSS } from '@aurelia/runtime-html'; import SharedStyles from '../variables.css'; import styles from './au-button.css'; import template from './au-button.html'; @customElement({ name: 'au-button', template, de...
Vheissu/au-cardigan-ui
src/components/index.ts
<gh_stars>1-10 import {IRegistry } from '@aurelia/kernel'; import { AuSelectCustomElement } from './au-select'; import { AuModalCustomElement } from './au-modal'; import { AuImageCustomElement } from './au-image'; import { AuButtonCustomElement } from './au-button'; import { AuHeadingCustomElement } from './au-heading...
Vheissu/au-cardigan-ui
src/components/au-heading.ts
<gh_stars>1-10 import { bindable, ICustomElementViewModel, customElement, shadowCSS } from '@aurelia/runtime-html'; import SharedStyles from '../variables.css'; import styles from './au-heading.css'; import template from './au-heading.html'; @customElement({ name: 'au-heading', template, dependencies: [ ...
Vheissu/au-cardigan-ui
src/components/au-image.ts
import { bindable, ICustomElementViewModel, customElement, shadowCSS } from '@aurelia/runtime-html'; import SharedStyles from '../variables.css'; import styles from './au-image.css'; import template from './au-image.html'; @customElement({ name: 'au-image', template, dependencies: [ shadowCSS(Shar...
jdrios-dev/brueckner-prueba-juan-rios
src/app/material/material.module.ts
<gh_stars>0 import { NgModule } from '@angular/core'; import {MatToolbarModule} from '@angular/material/toolbar'; import {MatButtonModule} from '@angular/material/button'; import {MatExpansionModule} from '@angular/material/expansion'; import {MatIconModule} from '@angular/material/icon'; import {MatFormFieldModule} f...
jdrios-dev/brueckner-prueba-juan-rios
src/app/components/admin/admin.component.ts
import { Component, OnInit } from '@angular/core'; import { DataService } from 'src/app/service/data.service'; import * as d3 from 'd3'; @Component({ selector: 'app-admin', templateUrl: './admin.component.html', styleUrls: ['./admin.component.css'] }) export class AdminComponent implements OnInit { public emp...
jdrios-dev/brueckner-prueba-juan-rios
src/app/components/detail-employee/detail-employee.component.ts
import { Component, OnInit } from '@angular/core'; import { ActivatedRoute, Router } from '@angular/router'; import { DataService } from 'src/app/service/data.service'; import {MatDialog} from '@angular/material/dialog'; @Component({ selector: 'app-detail-employee', templateUrl: './detail-employee.component.html', ...
jdrios-dev/brueckner-prueba-juan-rios
src/app/components/list-employees/list-employees.component.ts
<reponame>jdrios-dev/brueckner-prueba-juan-rios import { Component, OnInit, ViewChild } from '@angular/core'; import { DataService } from 'src/app/service/data.service'; @Component({ selector: 'app-list-employees', templateUrl: './list-employees.component.html', styleUrls: ['./list-employees.component.css'] }) ...
jdrios-dev/brueckner-prueba-juan-rios
src/environments/environment.prod.ts
<gh_stars>0 export const environment = { baseUrl:'http://dummy.restapiexample.com/api/v1', production: true, name: 'production' };
jdrios-dev/brueckner-prueba-juan-rios
src/app/interfaces/employee-response.ts
export interface EmployeeResponse { status: string; data: EmployeeResponseData; message: string; } export interface EmployeeResponseData { id: number; employee_name: string; employee_salary: number; employee_age: number; profile_image: string; }
jdrios-dev/brueckner-prueba-juan-rios
src/app/components/new-employees/new-employees.component.ts
import { Component, OnInit } from '@angular/core'; import { DataService } from 'src/app/service/data.service'; @Component({ selector: 'app-new-employees', templateUrl: './new-employees.component.html', styleUrls: ['./new-employees.component.css'] }) export class NewEmployeesComponent implements OnInit { const...
jdrios-dev/brueckner-prueba-juan-rios
src/app/service/data.service.ts
<reponame>jdrios-dev/brueckner-prueba-juan-rios import { Injectable } from '@angular/core'; import { HttpClient, HttpHeaders } from '@angular/common/http'; import { environment } from '../../environments/environment'; @Injectable({ providedIn: 'root' }) export class DataService { constructor( private http: HttpCli...
jdrios-dev/brueckner-prueba-juan-rios
src/app/app-routing.module.ts
<reponame>jdrios-dev/brueckner-prueba-juan-rios import { NgModule } from '@angular/core'; import { Routes, RouterModule } from '@angular/router'; import { AppComponent } from './app.component'; import { AdminComponent } from './components/admin/admin.component'; import { DetailEmployeeComponent } from './components/det...
jdrios-dev/brueckner-prueba-juan-rios
src/app/app.module.ts
<filename>src/app/app.module.ts<gh_stars>0 import { BrowserModule } from '@angular/platform-browser'; import { NgModule } from '@angular/core'; import { HttpClientModule, HttpClient } from '@angular/common/http'; import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import { AppRoutingModule } from './app...
jdrios-dev/brueckner-prueba-juan-rios
src/app/pipes/pagination.pipe.ts
import { Pipe, PipeTransform } from '@angular/core'; @Pipe({ name: 'pagination' }) export class PaginationPipe implements PipeTransform { transform(array: [], page_size: any, page_number: number): any[] { if(!array.length) return []; if (page_size === 'all') { return array } page_size = pag...
aculab-com/react-native-aculab-client
example-AcuMobCom/src/App.tsx
<filename>example-AcuMobCom/src/App.tsx import 'react-native-gesture-handler'; import React from 'react'; import { View, StatusBar } from 'react-native'; import { createNativeStackNavigator } from '@react-navigation/native-stack'; import { NavigationContainer } from '@react-navigation/native'; import { styles, COLOURS ...
aculab-com/react-native-aculab-client
example-AcuMobCom/src/styles.ts
import { StyleSheet } from 'react-native'; export const COLOURS = { BACKGROUND: '#1d2c35', INPUT_PLACEHOLDER: '#81868a', SPEAKER_BUTTON: '#009688', RED: 'red', LIGHT_BLUE: 'lightblue', CALLING_TEXT: '#0b99ee', LIGHT_GRAY: 'lightgray', BLACK: 'black', GREEN: 'green', }; export const styles = StyleShe...
aculab-com/react-native-aculab-client
src/helpers.ts
import { Alert } from 'react-native'; /** * helper function - delete all white spaces in string * @param {string} stringIn string to be processed * @returns {string} string without any whitespace */ export const deleteSpaces = (stringIn: string): string => { let stringOut = stringIn.replace(/\s/g, ''); return ...