repo_name
stringlengths
5
122
path
stringlengths
3
232
text
stringlengths
6
1.05M
lhr0909/node-usbmux
src/connect.ts
import * as net from 'net'; import { debug } from './debug'; import { address } from './address'; import { protocol } from './protocol'; import { UsbmuxdError } from './error'; /** * Connects to a device through usbmuxd for a tunneled tcp connection * * @param {integer} deviceID - Target device's usbmuxd ID *...
lhr0909/node-usbmux
lib/relay.d.ts
/// <reference types="node" /> import { EventEmitter } from 'events'; export declare class Relay extends EventEmitter { private _devicePort; private _relayPort; private _udid; private _listener; private _server; constructor(devicePort: number, relayPort: number, opts: { timeout?: number;...
lhr0909/node-usbmux
lib/find.d.ts
<filename>lib/find.d.ts export declare function findDevice(opts: { timeout?: number; udid?: string; }): Promise<number>;
lhr0909/node-usbmux
src/find.ts
import { devices } from './devices'; import { createListener } from './listener'; /** * Find a device (specified or not) within a timeout * * Usbmuxd has IDs it assigned to devices as they are plugged in. The IDs * change as devices are unpplugged and plugged back in, so even if we have a * UDID we need to get th...
lhr0909/node-usbmux
lib/debug.d.ts
<gh_stars>0 /// <reference types="debug" /> export declare const debug: { relay: import("debug").Debugger; listen: import("debug").Debugger; connect: import("debug").Debugger; };
lhr0909/node-usbmux
lib/devices.d.ts
import { DeviceProperties } from './types/DeviceProperties'; export declare const devices: { [key: string]: DeviceProperties; };
lhr0909/node-usbmux
src/listener.ts
import * as net from 'net'; import { debug } from './debug'; import { devices } from './devices'; import { address } from './address'; import { protocol } from './protocol'; import { UsbmuxdError } from './error'; /** * Connects to usbmuxd and listens for ios devices * * This connection stays open, listening as de...
lhr0909/node-usbmux
src/devices.ts
<reponame>lhr0909/node-usbmux import { DeviceProperties } from './types/DeviceProperties'; /** * Keep track of connected devices * * Maps device UDID to device properties, ie: * '22226dd59aaac687f555f8521f8ffddac32d394b': { * ConnectionType: 'USB', * DeviceID: 19, * LocationID: 0, * ProductID: 4776, *...
lhr0909/node-usbmux
src/address.ts
/** * usbmuxd address * * OSX usbmuxd listens on a unix socket at /var/run/usbmuxd * Windows usbmuxd listens on port 27015 * * libimobiledevice[1] looks like it operates at /var/run/usbmuxd too, but if * your usbmuxd is listening somewhere else you'll need to set this manually. * * [1] github.com/libimobiledev...
lhr0909/node-usbmux
src/tunnel.ts
import * as net from 'net'; import { devices } from './devices'; import { connect } from './connect'; import { findDevice } from './find'; /** * Get a tunneled connection to a device (specified or not) within a timeout * * @param {integer} devicePort - Port to connect to on device * @param {object} [o...
lhr0909/node-usbmux
lib/listener.d.ts
<filename>lib/listener.d.ts /// <reference types="node" /> import * as net from 'net'; export declare function createListener(): net.Socket;
lhr0909/node-usbmux
src/types/DeviceProperties.ts
<reponame>lhr0909/node-usbmux export interface DeviceProperties { ConnectionType: string; DeviceID: number; LocationID: number; ProductID: number; SerialNumber: string; }
lhr0909/node-usbmux
lib/tunnel.d.ts
/// <reference types="node" /> import * as net from 'net'; export declare function getTunnel(devicePort: any, opts: { timeout?: number; udid?: string; }): Promise<net.Socket>;
lhr0909/node-usbmux
src/relay.ts
<filename>src/relay.ts import * as net from 'net'; import { EventEmitter } from 'events'; import { debug } from './debug'; import { devices } from './devices'; import { createListener } from './listener'; import { connect } from './connect'; /** * Creates a new tcp relay to a port on connected usb device * * @cons...
lhr0909/node-usbmux
lib/connect.d.ts
<gh_stars>0 /// <reference types="node" /> import * as net from 'net'; export declare function connect(deviceID: number, devicePort: number): Promise<net.Socket>;
lhr0909/node-usbmux
lib/protocol.d.ts
/// <reference types="node" /> export declare const protocol: { listen: Buffer; connect: (deviceID: any, port: any) => Buffer; makeParser: (onComplete: any) => (data: any) => void; };
lhr0909/node-usbmux
src/protocol.ts
import * as plist from 'plist'; /** * Exposes methods for dealing with usbmuxd protocol messages (send/receive) * * The usbmuxd message protocol has 2 versions. V1 doesn't look like its used * anymore. V2 is a header + plist format like this: * * Header: * UInt32LE Length - is the length of the header + plis...
lhr0909/node-usbmux
src/error.ts
/** * Custom usbmuxd error * * There's no documentation for usbmuxd responses, but I think I've figured * out these result numbers: * 0 - Success * 2 - Device requested isn't connected * 3 - Port requested isn't available \ open * 5 - Malformed request * * @param {string} message - Error message * @param {...
lhr0909/node-usbmux
src/usbmux.ts
<filename>src/usbmux.ts export { devices } from './devices'; export { Relay } from './relay'; export { getTunnel } from './tunnel'; export { createListener } from './listener';
lhr0909/node-usbmux
src/debug.ts
/** * Debugging * set with DEBUG=usbmux:* env variable * * on windows cmd set with: cmd /C "SET DEBUG=usbmux:* && node script.js" */ import { debug as bug } from 'debug'; export const debug = { relay: bug('usbmux:relay'), listen: bug('usbmux:listen'), connect: bug('usbmux:connect'), };
lhr0909/node-usbmux
lib/address.d.ts
export declare const address: { port: number; path?: undefined; } | { path: string; port?: undefined; };
lhr0909/node-usbmux
lib/error.d.ts
export declare class UsbmuxdError extends Error { name: any; number: any; constructor(message: string, number: number); }
Yogu/graphql-weaver
src/weave-schemas.ts
<gh_stars>100-1000 import { buildClientSchema, GraphQLList, GraphQLNonNull, GraphQLObjectType, GraphQLSchema, GraphQLString, getIntrospectionQuery, IntrospectionQuery, parse } from 'graphql'; import { transformSchema } from 'graphql-transformer/dist'; import { shouldAddPlaceholdersOnError, shouldContinueOnError, should...
Yogu/graphql-weaver
src/graphql/schema-utils.ts
import { getNamedType, getNullableType, GraphQLField, GraphQLFieldMap, GraphQLInterfaceType, GraphQLList, GraphQLNamedType, GraphQLNonNull, GraphQLObjectType, GraphQLSchema, GraphQLType, GraphQLUnionType, isNonNullType } from 'graphql'; /** * Finds a field by traversing a schema from field to field * @pa...
Yogu/graphql-weaver
spec/regression/data/scalar-as-link-key.config.ts
<filename>spec/regression/data/scalar-as-link-key.config.ts import { WeavingConfig } from '../../../src/config/weaving-config'; import gql from 'graphql-tag'; import { makeExecutableSchema } from '@graphql-tools/schema'; import { NonNegativeInt } from '../../helpers/non-negative-int'; export async function getConfig()...
Yogu/graphql-weaver
src/graphql-client/client-execution-result.ts
<gh_stars>100-1000 import { ExecutionResult, GraphQLError, GraphQLFormattedError } from 'graphql'; /** * The result of executing a GraphQL operation via a GraphQLClient * * The difference to ExecutionResult is that errors do not need to be Error instances, so that the direct response * (sent over HTTP) can be used...
Yogu/graphql-weaver
spec/performance/profiling/join.ts
<gh_stars>100-1000 import { makeExecutableSchema } from '@graphql-tools/schema'; import { IResolvers } from '@graphql-tools/utils'; import { graphql, GraphQLSchema, print } from 'graphql'; import gql from 'graphql-tag'; import { assertSuccessfulResult } from '../../../src/graphql/execution-result'; import { weaveSchema...
Yogu/graphql-weaver
spec/helpers/server.ts
import { ApolloServer } from 'apollo-server'; import { GraphQLObjectType, GraphQLSchema, GraphQLString } from 'graphql'; import { WeavingConfig } from '../../src/config/weaving-config'; import { weaveSchemas } from '../../src/weave-schemas'; import { loadProxyConfig } from './load-config'; const defaultPort = 3200; i...
Yogu/graphql-weaver
spec/regression/regressions.spec.ts
import * as fs from 'fs'; import { formatError, GraphQLError, GraphQLFormattedError } from 'graphql'; import * as path from 'path'; import { TO_EQUAL_JSON_MATCHERS } from '../helpers/equal-json'; import { GraphQLHTTPTestEndpoint } from '../helpers/grapqhl-http-test/graphql-http-test-endpoint'; import { testConfigWithQu...
Yogu/graphql-weaver
spec/helpers/grapqhl-http-test/graphql-http-test-endpoint.ts
import { ApolloServer } from 'apollo-server'; import { GraphQLSchema } from 'graphql'; import { defaultTestSchema } from './graphql-http-test-schema'; export class GraphQLHTTPTestEndpoint { private server: ApolloServer | undefined; public async start(port: number, schema?: GraphQLSchema) { const serve...
Yogu/graphql-weaver
spec/regression/data/endpoint-schema-errors-continue.config.ts
import { WeavingConfig } from '../../../src/config/weaving-config'; import { GraphQLClient } from '../../../src/graphql-client/graphql-client'; import { ExecutionResult } from 'graphql'; import { defaultTestSchema } from '../../helpers/grapqhl-http-test/graphql-http-test-schema'; import { WeavingErrorHandlingMode } fro...
rohmanhm/nullfined
types/index.d.ts
<filename>types/index.d.ts<gh_stars>1-10 export default function <T = any>(data: T): T;
rohmanhm/nullfined
src/index.ts
// Copyright (c) 2019 rohmanhm // // This software is released under the MIT License. // https://opensource.org/licenses/MIT import vaper from 'vaper' export default function<T = any>(data: T): T { return vaper(null, undefined)(data) }
sviscione13/fittrackweb2017
jquery-mockup/src/workouts.ts
<filename>jquery-mockup/src/workouts.ts<gh_stars>0 import * as $ from 'jquery'; export class WorkoutList { name: string; } export class YourWorkoutList{ name: string; date: string; constructor(name:string, date:string) { this.name = name; this.date = date; } } ...
Fignocius/Appointments
src/app/ducks/api.ts
import fetch from 'isomorphic-fetch'; import Immutable from 'immutable'; import createReducer from 'app/util/createReducer'; import { createSelector } from 'reselect'; const CancelFormTracker = { default: false }; // action types for api export const ActionTypes = { PreFetch: 'API_PreFetch', SuccessFetc...
Fignocius/Appointments
src/app/containers/Home/index.tsx
<reponame>Fignocius/Appointments<filename>src/app/containers/Home/index.tsx import * as React from 'react'; import { withStyles, WithStyles} from '@material-ui/core/styles'; import Calendar from 'react-calendar'; require("react-calendar/dist/Calendar"); import Grid from '@material-ui/core/Grid'; import Fab from '@...
Fignocius/Appointments
src/app/components/PageLoader/index.tsx
import React from 'react'; import { WithStyles, withStyles } from '@material-ui/core/styles'; import CircularProgress from '@material-ui/core/CircularProgress'; export namespace PageLoader { export interface Props { classes: any; } } const styles = (theme) => ({ root: { display: 'flex', ...
Fignocius/Appointments
src/app/components/CardsList/index.tsx
import React from 'react'; import { withStyles } from '@material-ui/core/styles'; import classnames from 'classnames'; import Card from '@material-ui/core/Card'; import CardHeader from '@material-ui/core/CardHeader'; // import CardMedia from '@material-ui/core/CardMedia'; import CardContent from '@material-ui/cor...
Fignocius/Appointments
src/app/containers/Home/Appointments/index.tsx
<filename>src/app/containers/Home/Appointments/index.tsx import * as React from 'react'; import { WithStyles} from '@material-ui/core/styles'; import CardList from 'app/components/CardsList'; import { connect } from 'react-redux'; import { getAppointment, deleteAppointment} from 'app/ducks/appointment'; // import ...
Fignocius/Appointments
src/app/components/Header/index.tsx
import * as React from 'react'; import { WithStyles, withStyles } from '@material-ui/core/styles'; import Typography from '@material-ui/core/Typography'; import AppBar from '@material-ui/core/AppBar'; import Toolbar from '@material-ui/core/Toolbar'; import IconButton from '@material-ui/core/IconButton'; import Me...
Fignocius/Appointments
src/app/containers/App/index.tsx
<reponame>Fignocius/Appointments import * as React from 'react'; import { connect } from 'react-redux'; import { Route, Switch, RouteComponentProps } from 'react-router'; import Header from 'app/containers/Header'; import Divider from '@material-ui/core/Divider'; import Loader from 'app/components/PageLoader'; ...
Fignocius/Appointments
src/app/util/index.ts
<gh_stars>0 export function omit<T extends object, K extends keyof T>(target: T, ...omitKeys: K[]): Omit<T, K> { return (Object.keys(target) as K[]).reduce( (res, key) => { if (!omitKeys.includes(key)) { res[key] = target[key]; } return res; }, {} as Omit<T, K> ); } ...
Fignocius/Appointments
src/app/components/Form/index.tsx
<filename>src/app/components/Form/index.tsx<gh_stars>0 import * as React from 'react'; import { createForm, formShape } from 'rc-form'; import TextField from '@material-ui/core/TextField'; import Button from '@material-ui/core/Button'; import Dialog from '@material-ui/core/Dialog'; import DialogActions from '@mate...
Fignocius/Appointments
src/app/index.tsx
<gh_stars>0 import * as React from 'react'; import { Route, Switch } from 'react-router'; import { hot } from 'react-hot-loader'; import { MuiThemeProvider, createMuiTheme } from '@material-ui/core/styles'; import Loadable from 'react-loadable'; import Loader from 'app/components/PageLoader'; // const SecureC...
Fignocius/Appointments
src/app/reducers/state.ts
<reponame>Fignocius/Appointments import { RouterState } from 'react-router-redux'; export interface RootState { router: RouterState; } export namespace RootState { }
Fignocius/Appointments
src/app/middleware/index.ts
export * from 'app/middleware/logger';
Fignocius/Appointments
src/app/containers/Home/Create/index.tsx
<gh_stars>0 import * as React from 'react'; import {connect} from 'react-redux'; import Form from 'app/components/Form'; // import { format } from 'app/util'; import {createAppointment, Appointment} from 'app/ducks/appointment'; import * as Moment from 'moment'; Moment.locale('pt-br'); export namespace Creat...
Fignocius/Appointments
src/app/components/Modal/index.tsx
import React from 'react'; import Button from '@material-ui/core/Button'; import Dialog from '@material-ui/core/Dialog'; import DialogActions from '@material-ui/core/DialogActions'; import DialogContent from '@material-ui/core/DialogContent'; import DialogContentText from '@material-ui/core/DialogContentText'; im...
Fignocius/Appointments
src/app/ducks/appointment.ts
<reponame>Fignocius/Appointments import createReducer from 'app/util/createReducer'; import {createSelector} from 'reselect'; import Immutable from 'immutable'; import api from 'app/ducks/api'; export enum ActionTypes { LoadStart = 'appointment.LoadStart', LoadError = 'appointment.LoadError', LoadSuccess...
Fignocius/Appointments
src/app/containers/Header/index.tsx
import * as React from 'react'; import { WithStyles, withStyles } from '@material-ui/core/styles'; import { RouteComponentProps } from 'react-router'; import Typography from '@material-ui/core/Typography'; import AppBar from '@material-ui/core/AppBar'; import Toolbar from '@material-ui/core/Toolbar'; export n...
Fignocius/Appointments
src/app/util/excel.ts
<filename>src/app/util/excel.ts<gh_stars>0 import { Workbook } from 'exceljs'; import * as Excel from 'exceljs/dist/exceljs.min.js'; export interface Column { key: string; header: string; style?: object; width?: number; render?: (k: string, i: number, r: object) => string | number | boolean; } ex...
Fignocius/Appointments
src/app/reducers/index.ts
import { combineReducers, Reducer } from 'redux'; import { RootState } from 'app/reducers/state'; import { apiReducer } from 'app/ducks/api'; import { routerReducer, RouterState } from 'react-router-redux'; import { Reducer as appointmentReducer } from 'app/ducks/appointment'; export { RootState, RouterState }; ...
chrisyoulden/fast-csv
packages/format/src/CsvFormatterStream.ts
import { Transform, TransformCallback } from 'stream'; import { FormatterOptions } from './FormatterOptions'; import { Row, RowTransformFunction } from './types'; import { RowFormatter } from './formatter'; export class CsvFormatterStream<I extends Row, O extends Row> extends Transform { private formatterOptions: ...
chrisyoulden/fast-csv
examples/formatting-ts/examples/quote_headers_array.example.ts
import { format } from '@fast-csv/format'; const csvStream = format({ headers: ['header1', 'header2'], quoteHeaders: [false, true] }); csvStream.pipe(process.stdout).on('end', process.exit); csvStream.write({ header1: 'value1a', header2: 'value2a' }); csvStream.write({ header1: 'value1a', header2: 'value2a' }); csvS...
chrisyoulden/fast-csv
packages/parse/__tests__/__fixtures__/RecordingStream.ts
import { Writable } from 'stream'; export class RecordingStream extends Writable { public readonly data: string[] = []; public constructor() { super({ write: (data, enc, cb): void => { this.data.push(data.toString()); cb(); }, }); } }...
chrisyoulden/fast-csv
examples/fast-csv-ts/examples/parse.example.ts
import * as fs from 'fs'; import * as path from 'path'; import * as csv from 'fast-csv'; fs.createReadStream(path.resolve(__dirname, '..', 'assets', 'parse.csv')) .pipe(csv.parse({ headers: true })) .on('error', error => console.error(error)) .on('data', row => console.log(row)) .on('end', (rowCount: n...
chrisyoulden/fast-csv
packages/parse/__tests__/__fixtures__/headerColumnMismatch.ts
/* eslint-disable @typescript-eslint/camelcase */ import { resolve } from 'path'; import { EOL } from 'os'; import { PathAndContent } from './helpers'; import { RowMap } from '../../src'; export const headerColumnMismatch: PathAndContent<RowMap> = { path: resolve(__dirname, 'tmp', 'header_column_mismatch.csv'), ...
chrisyoulden/fast-csv
packages/parse/__tests__/issues/issue131.spec.ts
import { EOL } from 'os'; import * as csv from '../../src'; describe('Issue #131 - https://github.com/C2FO/fast-csv/issues/131', () => { const csvWithBom = [ '\ufefffirst_name,last_name,email_address,address', 'First1,Last1,<EMAIL>,"1 Street St, State ST, 88888"', ].join(EOL); it('should p...
chrisyoulden/fast-csv
packages/format/__tests__/issues/issue97.spec.ts
<filename>packages/format/__tests__/issues/issue97.spec.ts import { RecordingStream } from '../__fixtures__'; import { RowMap, write } from '../../src'; describe('Issue #97 - https://github.com/C2FO/fast-csv/issues/97', () => { it('should keep the original row', next => { const rs = new RecordingStream(); ...
chrisyoulden/fast-csv
packages/parse/src/types.ts
export interface RowMap { [s: string]: string | undefined | null; } export type RowArray = string[]; export type Row = RowMap | RowArray; export interface RowValidationResult<R extends Row> { row: R | null; isValid: boolean; reason?: string; } export type RowValidatorCallback<R extends Row> = (error: ...
chrisyoulden/fast-csv
packages/parse/__tests__/__fixtures__/noHeadersAndQuotes.ts
import { resolve } from 'path'; import { EOL } from 'os'; import { PathAndContent } from './helpers'; import { RowArray } from '../../src'; export const noHeadersAndQuotes: PathAndContent<RowArray> = { path: resolve(__dirname, 'tmp', 'no_headers_and_quotes.csv'), content: [ 'First1,Last1,<EMAIL>,"1 St...
chrisyoulden/fast-csv
examples/parsing-ts/examples/skip_lines.example.ts
<gh_stars>1-10 import { parse } from '@fast-csv/parse'; const rows = [ 'skip1_header1,skip1_header2\n', 'skip2_header1,skip2_header2\n', 'header1,header2\n', 'col1,col1\n', 'col2,col2\n', 'col3,col3\n', 'col4,col4\n', ]; const stream = parse({ headers: true, skipLines: 2 }) .on('error'...
chrisyoulden/fast-csv
examples/fast-csv-ts/examples/format.example.ts
<filename>examples/fast-csv-ts/examples/format.example.ts import * as csv from 'fast-csv'; const csvStream = csv.format({ headers: true }); csvStream.pipe(process.stdout).on('end', process.exit); csvStream.write({ header1: 'row1-col1', header2: 'row1-col2' }); csvStream.write({ header1: 'row2-col1', header2: 'row2-c...
chrisyoulden/fast-csv
examples/formatting-ts/examples/write_to_path.example.ts
import { resolve } from 'path'; import { readFileSync } from 'fs'; import { writeToPath } from '@fast-csv/format'; const rows = [ ['a', 'b'], ['a1', 'b1'], ['a2', 'b2'], ]; const filePath = resolve(__dirname, 'write_to_path.tmp.csv'); writeToPath(filePath, rows) .on('error', err => console.error(err)) ...
chrisyoulden/fast-csv
examples/fast-csv-ts/examples/parse_and_format_transform_async.example.ts
<reponame>chrisyoulden/fast-csv import * as fs from 'fs'; import * as path from 'path'; import * as csv from 'fast-csv'; import { User } from './models/user'; interface UserCsvRow { id: string; first_name: string; last_name: string; address: string; } interface UserDetailsRow { id: number; fir...
chrisyoulden/fast-csv
examples/formatting-ts/examples/write_to_string.example.ts
<gh_stars>1-10 import { writeToString } from '@fast-csv/format'; const rows = [ ['a', 'b'], ['a1', 'b1'], ['a2', 'b2'], ]; writeToString(rows).then(data => console.log(data)); // Output: // a,b // a1,b1 // a2,b2
chrisyoulden/fast-csv
packages/parse/__tests__/parser/column/ColumnParser.spec.ts
<gh_stars>1-10 import * as sinon from 'sinon'; import { ParserOptions } from '../../../src'; import { ColumnParser } from '../../../src/parser/column'; import { Scanner } from '../../../src/parser'; describe('ColumnParser', () => { describe('#parse', () => { describe('with un-quoted data', () => { ...
chrisyoulden/fast-csv
packages/format/__tests__/issues/issue252.spec.ts
import * as csv from '../../src'; import { RecordingStream } from '../__fixtures__'; describe('Issue #252 - https://github.com/C2FO/fast-csv/issues/252', () => { it('should keep the original row', next => { const rs = new RecordingStream(); const data: csv.RowArray[] = [ ['a', 'b', 'c']...
chrisyoulden/fast-csv
packages/parse/__tests__/transforms/HeaderTransformer.spec.ts
import { ParserOptions, ParserOptionsArgs, RowArray, RowValidationResult } from '../../src'; import { HeaderTransformer } from '../../src/transforms'; describe('HeaderTransformer', () => { const createHeaderTransformer = (opts?: ParserOptionsArgs) => new HeaderTransformer<RowArray>(new ParserOptions(opts))...
chrisyoulden/fast-csv
packages/parse/__tests__/issues/issue317.spec.ts
import { EOL } from 'os'; import { parseString, RowMap, RowArray } from '../../src'; describe('Issue #317 - https://github.com/C2FO/fast-csv/issues/317', () => { const CSV_CONTENT = ['header1,header2', 'col1', 'col2,col2', 'col3', 'col4,col4', 'col5,col5', 'col6,col6'].join( EOL, ); const expectedI...
chrisyoulden/fast-csv
packages/parse/__tests__/__fixtures__/withHeadersAndQuotes.ts
<filename>packages/parse/__tests__/__fixtures__/withHeadersAndQuotes.ts /* eslint-disable @typescript-eslint/camelcase */ import { resolve } from 'path'; import { EOL } from 'os'; import { PathAndContent } from './helpers'; import { RowMap } from '../../src'; export const withHeadersAndQuotes: PathAndContent<RowMap> =...
chrisyoulden/fast-csv
packages/parse/__tests__/ParserOptions.spec.ts
import { ParserOptions, ParserOptionsArgs } from '../src'; describe('ParserOptions', () => { const createOptions = (opts: ParserOptionsArgs = {}) => new ParserOptions(opts); describe('#objectMode', () => { it('should have default objectMode', () => { expect(createOptions().objectMode).toBe...
magicjar/nusantara-valid
src/test/functions/_bank.spec.ts
import { expect } from "chai" import { getDataBank, getDataBanks } from "../../ts/functions" describe('Bank', () => { describe('getData()', () => { it('should return an object of Bank data', () => { expect(getDataBank('BCAK')).to.deep.equal({ key: 'BCAK', name: '...
magicjar/nusantara-valid
src/test/functions/_nomorIndukPegawaiNegeriSipil.spec.ts
<filename>src/test/functions/_nomorIndukPegawaiNegeriSipil.spec.ts import { expect } from "chai" import { isValidNIP as isValid, getDataNIP } from "../../ts/functions/index" import { NIP_LENGTH } from "../../ts/datas/nip" describe('NIP', () => { it('cannot be empty', () => { expect(isValid('')).to.be.false...
magicjar/nusantara-valid
src/test/functions/_email.spec.ts
import { expect } from "chai" import { isValidEmail as isValid } from "../../ts/functions/index" describe('Email', () => { it('cannot be empty', () => { expect(isValid('')).to.be.false; }) it('cannot be null', () => { expect(isValid(null as any)).to.be.false; }) describe('type', (...
magicjar/nusantara-valid
src/test/functions/extended/_nomorIndukKependudukan.extended.spec.ts
<reponame>magicjar/nusantara-valid<gh_stars>1-10 import { expect } from "chai" import { isValidNIK, getDataNIK, isValidNIKWithComparison } from "../../../ts/functions/index.extended" describe('NIK (Extended)', () => { describe('isValidNIK() = true', () => { it('if it has valid Regency code (BPS code)', () ...
magicjar/nusantara-valid
src/test/functions/_tandaNomorKendaraanBermotor.spec.ts
<gh_stars>1-10 import { expect } from "chai" import { isValidTNKB as isValid, getDataTNKB as getData } from "../../ts/functions" describe('TNKB', () => { it('cannot be empty', () => { expect(isValid('')).to.be.false }) it('cannot be null', () => { expect(isValid(null as any)).to.be.false ...
magicjar/nusantara-valid
src/test/functions/_zipCode.spec.ts
<filename>src/test/functions/_zipCode.spec.ts import { expect } from "chai" import { isValidZIP, isValidZIPWithComparison } from "../../ts/functions/index" describe('ZIP code', () => { it('cannot be empty', () => { expect(isValidZIP('')).to.be.false }) it('cannot be null', () => { expect(i...
magicjar/nusantara-valid
src/test/functions/_nomorIndukKependudukan.spec.ts
<filename>src/test/functions/_nomorIndukKependudukan.spec.ts import { expect } from "chai" import { isValidNIK, isValidNIKWithComparison, getDataNIK } from "../../ts/functions" import { NomorIndukKependudukan } from "../../ts/functions/_nomorIndukKependudukan" import { NIK_LENGTH } from "../../ts/datas/nik" describe('...
magicjar/nusantara-valid
src/test/functions/_cellularProvider.spec.ts
<reponame>magicjar/nusantara-valid<filename>src/test/functions/_cellularProvider.spec.ts<gh_stars>1-10 import { expect } from "chai" import { getDataCellularProvider, getDataCellularProviders } from "../../ts/functions" describe('Cellular Provider', () => { describe('getDataCellularProvider()', () => { it(...
magicjar/nusantara-valid
src/test/functions/_nomorIndukSiswaNasional.spec.ts
import { expect } from "chai" import { isValidNISN as isValid } from "../../ts/functions/index" import { NISN_LENGTH, NISN_AGE_VALIDITY } from "../../ts/datas/nisn" describe('NISN', () => { it('cannot be empty', () => { expect(isValid('')).to.be.false }) it('cannot be null', () => { expect...
magicjar/nusantara-valid
src/test/functions/_atmNumber.spec.ts
<reponame>magicjar/nusantara-valid import { expect } from "chai" import { isValidATMNumber as isValid, isValidATMNumberWithComparison } from "../../ts/functions" describe('ATM number', () => { it('cannot be empty', () => { expect(isValid('')).to.be.false; }) it('cannot be null', () => { e...
magicjar/nusantara-valid
src/test/functions/_province.spec.ts
import { expect } from "chai" import { getDataProvince, getDataProvinces } from "../../ts/functions" describe('Province', () => { describe('getDataProvince()', () => { it('should return an object of Province data', () => { expect(getDataProvince('34')).to.deep.equal( { bpsCode: ...
magicjar/nusantara-valid
src/test/functions/_telephoneNumber.spec.ts
import { expect } from "chai" import { isValidTelephoneNumber as isValid, formatTelephoneNumber as format, getDataTelephoneNumber } from "../../ts/functions/index" import { COUNTRY_CODE } from "../../ts/datas/province"; describe('Telephone number', () => { it('cannot be empty', () => { expect(isValid(''))...
magicjar/nusantara-valid
src/test/functions/_nomorPokokWajibPajak.spec.ts
import { expect } from "chai" import { isValidNPWP as isValid, formatNPWP as format } from "../../ts/functions/index" import { NPWP_LENGTH } from "../../ts/datas/npwp" describe('VRN', () => { it('cannot be empty', () => { expect(isValid('')).to.be.false }) it('cannot be null', () => { expe...
magicjar/nusantara-valid
src/test/helpers/_correctLength.spec.ts
<gh_stars>1-10 import { expect } from "chai" import { correctLength } from "../../ts/helpers" describe('Correct Length', () => { it('Return false if using a mode other than 0, 1, and 2', () => { expect(correctLength(3, 3, { collection: [1, 2, 3, 4, 5], minLength: 2, maxLength: 7 })).to.be.false }) })
magicjar/nusantara-valid
src/test/functions/_cellularNumber.spec.ts
<reponame>magicjar/nusantara-valid<gh_stars>1-10 import { expect } from "chai" import { isValidCellularNumber as isValid, getDataCellularNumber as getData, formatCellularNumber as format, isValidCellularNumberWithComparison } from "../../ts/functions/index" import { CELLULAR_MIN_LENGTH, CELLULAR_MAX_LENGTH } from "../....
magicjar/nusantara-valid
src/test/functions/_creditCard.spec.ts
import { expect } from "chai" import { isValidCCNumber as isValid, formatCCNumber as format } from "../../ts/functions/index" describe('Credit Card number', () => { it('cannot be empty', () => { expect(isValid('')).to.be.false; }) it('cannot be null', () => { expect(isValid(null as any))....
joohncruz/svg-stencil-tests
src/components.d.ts
<gh_stars>0 /* eslint-disable */ /* tslint:disable */ /** * This is an autogenerated file created by the Stencil compiler. * It contains typing information for all components that exist in this project. */ import { HTMLStencilElement, JSXBase } from '@stencil/core/internal'; export namespace Components { inter...
joohncruz/svg-stencil-tests
src/components/example-four/example-four.tsx
import { Component, Host, h } from "@stencil/core"; @Component({ assetsDirs: ["svg"], tag: "example-four", styleUrl: "example-four.css", shadow: true }) export class ExampleFour { render() { const addCircle = "<svg xmlns='http://www.w3.org/2000/svg' class='ionicon' viewBox='0 0 512 512'><path d='M256 48...
joohncruz/svg-stencil-tests
src/components/example-first/example-first.tsx
<gh_stars>0 import { Component, Host, h } from "@stencil/core"; @Component({ assetsDirs: ["svg"], tag: "example-first", styleUrl: "example-first.css", shadow: true }) export class ExampleFirst { render() { const iconPath = "M18 16v-5.087A5.91 5.91 0 0 0 13.59 5.2a2 2 0 1 0-3.18 0A5.91 5.91 0 0 0 6 10.91...
joohncruz/svg-stencil-tests
src/components/example-third/example-third.tsx
// import { Component, Host, h, State, getAssetPath } from '@stencil/core'; // @Component({ // tag: "example-third", // assetsDirs: ['assets'], // styleUrl: "example-third.css", // shadow: true // }) // export class ExampleThird { // @State() private svgContent?: string; // connectedCallback() { // th...
joohncruz/svg-stencil-tests
src/components/example-second/example-second.tsx
<gh_stars>0 import { Component, Host, h } from '@stencil/core'; import { iconPath } from './svgs'; @Component({ tag: "example-second", styleUrl: "example-second.css", shadow: true }) export class ExampleSecond { render() { return ( <Host> <svg xmlns="http://www.w3.org/2000/svg" ...
fongie/webhook-filtered-pipeline
src/index.ts
<filename>src/index.ts import { BuildSpec, FilterGroup, ISource, Project, Source } from '@aws-cdk/aws-codebuild'; import { Pipeline, PipelineProps } from '@aws-cdk/aws-codepipeline'; import { GitHubSourceAction, GitHubSourceActionProps, GitHubTrigger } from '@aws-cdk/aws-codepipeline-actions'; import { Effect, PolicySt...
50ra4/knowledge-article-character-counter
src/browser.ts
<gh_stars>0 import { TagName, ArticleContent } from './types'; export const articleContentHandler = (): HTMLElement[] => Array.from(document.querySelector('div#content')?.children ?? []) as HTMLElement[]; const EXCLUDED_TAG_NAMES: ReadonlyArray<TagName> = ['pre']; export const shouldIncludeTagName = (tagName: TagNa...
50ra4/knowledge-article-character-counter
test/browser.test.ts
<filename>test/browser.test.ts import { readFileSync } from 'fs'; import { resolve } from 'path'; import { articleContentHandler } from '../src/browser'; describe('articleContentHandler', () => { let previousHtml = ''; beforeAll(() => { previousHtml = document.body.innerHTML; const testHtml = readFileSync(...
50ra4/knowledge-article-character-counter
src/tasks.ts
import { Page, ElementHandle, Browser, Viewport, launch } from 'puppeteer'; import { TaskEither, tryCatch } from 'fp-ts/lib/TaskEither'; import { ArticleContent, TagName } from './types'; import { articleContentHandler } from './browser'; export const _launchBrowser = async (...params: Parameters<typeof launch>): Pro...
50ra4/knowledge-article-character-counter
src/types.ts
<gh_stars>0 export type TagName = keyof HTMLElementTagNameMap; export type ArticleContent = { tagName: TagName; innerText: string; };
50ra4/knowledge-article-character-counter
src/constants.ts
<reponame>50ra4/knowledge-article-character-counter<gh_stars>0 import { join } from 'path'; import { config } from 'dotenv'; import { Viewport } from 'puppeteer'; config(); export const BASE_URL = process.env.BASE_URL || ''; export const LOGIN_ID = process.env.ID || ''; export const LOGIN_PASSWORD = process.env.PASSWO...
50ra4/knowledge-article-character-counter
scripts/countCharacters.ts
<reponame>50ra4/knowledge-article-character-counter import { Command } from 'commander'; import { partial } from 'lodash'; import { Browser } from 'puppeteer'; import { log } from 'fp-ts/lib/Console'; import * as F from 'fp-ts/lib/function'; import * as IO from 'fp-ts/lib/IO'; import * as Task from 'fp-ts/lib/Task'; i...