lang
stringclasses 10
values | seed
stringlengths 5
2.12k
|
---|---|
typescript | )
})}
</ul>
</div>
); |
typescript |
public users: Array<any> = [];
// Inyecta el servicio en la variable _userService de la clase, declarada implícitamente
constructor(private _userService: UserService) {
console.log('GitHubUserComponent constructor'); |
typescript | readonly customerId: string;
canManageClients: boolean;
currencyCode: string;
dateTimeZone: string;
testAccount: boolean;
readonly accountLabels: IAccountLabel[];
readonly excludeHiddenAccounts: boolean;
} |
typescript | return {
total_pages: 1,
total_results: resources.length,
resources,
prev_url: null,
next_url: null,
};
} |
typescript | expect(myEl.textContent).toBe('Lorem ipsum dolor sit amet');
});
it('capitalizes all words', () => {
render(<StringCapitalize str="lorem ipsum dolor sit amet" allWords />);
const myEl = screen.getByTestId('str-cap');
expect(myEl.textContent).toBe('Lorem Ipsum Dolor Sit Amet'); |
typescript | // DON NOT EDIT IT MANUALLY
import * as React from 'react'
import DownSquareFilledSvg from '@ant-design/icons-svg/lib/asn/DownSquareFilled';
import AntdIcon, { AntdIconProps } from '../components/AntdIcon';
const DownSquareFilled = (
props: AntdIconProps,
ref: React.MutableRefObject<HTMLSpanElement>,
) => <AntdIcon {...props} ref={ref} icon={DownSquareFilledSvg} />;
DownSquareFilled.displayName = 'DownSquareFilled';
export default React.forwardRef<HTMLSpanElement, AntdIconProps>(DownSquareFilled); |
typescript | richtextString: "A very rich text string"
}
factory.createUnderlineAnnotation(val)
expect(CryptoUtil.MD5Hex(factory.write())).toBe("9adc072785be9b6c65981821be513cc7")
})
test('UnderlineAnnotation_color', () => {
let data = new Uint8Array(loadFromFile("./test_documents/test.pdf"))
let factory = new AnnotationFactory(data)
let textAnnotColor = {r:1, g:1, b:0}
|
typescript | {name: 2, count: 2},
{name: 3, count: 2},
{name: 4, count: 2}
]
mergeCountObjectArrays(target, selected);
expect(target).toEqual(expected);
});
}) |
typescript | import { Prisma } from '@prisma/client'
const trackWithLikes = Prisma.validator<Prisma.UserArgs>()({
include: { likes: true },
})
export type TrackWithLikes = Prisma.UserGetPayload<typeof trackWithLikes>
const userWithLikes = Prisma.validator<Prisma.UserArgs>()({
include: { likes: true },
})
export type userWithLikes = Prisma.UserGetPayload<typeof trackWithLikes>
|
typescript | <gh_stars>0
import Router from "router";
export class IndexController {
async getAlive(ctx: Router.RouterContext) {
ctx.body = {
message: 'server alive',
time: new Date(),
}; |
typescript | <svg
width="15"
height="15"
viewBox="0 0 20 20"
fill="currentColor"
xmlns="http://www.w3.org/2000/svg"
{...props}
>
<path d="M12.43 8L10 0L7.57 8H0L6.18 12.41L3.83 20L10 15.31L16.18 20L13.83 12.41L20 8H12.43Z" />
</svg>
)
}
export default Star
|
typescript | });
it('input = <p><br></p>, lastLeafNode = <br>', () => {
// Arrange
let rootNode = DomTestHelper.createElementFromContent(testID, '<p><br></p>');
runTest(rootNode.firstChild, rootNode.firstChild.firstChild);
});
it('input = <div>abc<br>123</div>, lastLeafNode = 123', () => {
// Arrange |
typescript | gboxByGbox {
id
meta
}
}
}
`),
branch(({ data }) => data.loading, renderNothing),
guardEmpty('stepById'),
withProps(({ data }) => ({ stepRank: data.stepById.rank, stepTitle: data.stepById.gboxByGbox.meta.title })),
withStyles(styles),
);
export default enhance(StepJustFinished); |
typescript | <h1 className="my-4 text-2xl text-gray-800 font-extrabold leading-tight text-center md:text-left">
{props.title}
</h1>
</div>
<p className="leading-normal font-sans font-thin text-sm md:text-m mb-8 text-center md:text-left pl-16">
{props.subtitle} |
typescript | public draw(ctx: CanvasRenderingContext2D) {
ctx.fillStyle = this.color;
ctx.beginPath();
ctx.arc(this.x, this.y, this.radius, 0, 2 * Math.PI);
ctx.fill();
return this;
}
|
typescript | case _?.c === R && _.l?.c === R: {
const { l: { l: a, v: x, n: i, r: b }, v: y, n: j, r: c } = _ as any
return mk(B, mk(R, a, x, i, b), y, j, c)
}
// blacken (T R a x (T R b y c)) = T B a x (T R b y c)
case _?.c === R && _.r?.c === R: {
const { l: a, v: x, n: i, r: { l: b, v: y, n: j, r: c} } = _ as any
return mk(B, a, x, i, mk(R, b, y, j, c))
} |
typescript | * 1 - the first version is greater than the second version
*
* Set `unstableFirst` to `true` to make versions with `dev`, `beta`, etc go last when the main version numbers are the
* same. It's useful for detecting compatible versions, for example:
* `isV3Api = compareVersions('3', version, true) <= 0 && compareVersions('4', version, true) < 0`.
*/
export function compareVersions(version1: string, version2: string, stableFirst?: boolean): -1 | 0 | 1 {
if (version1 === version2) {
return 0
}
|
typescript | new iam.PolicyStatement({
effect: iam.Effect.ALLOW,
resources: ['*'],
actions: ['logs:CreateLogGroup', 'logs:CreateLogStream', 'logs:PutLogEvents'],
}),
);
const storeAccountOutputs = new sfn.Map(this, `Store Account Outputs To SSM`, {
itemsPath: `$.accounts`,
resultPath: 'DISCARD', |
typescript | while (a) { b(); };
|
typescript | * Initialize a package with template.
*
* @param {string} name name of the new package
* @param {boolean} enableTS
* @param {string} template name of the template
* @returns {Promise<boolean>} whether the operation succeeded
*/
declare const loadTemplate: (name: string, enableTS: boolean, template: string) => Promise<boolean>;
export default loadTemplate;
|
typescript | guild: Guild;
connection: StreamConnection;
songs: Song[];
isPlaying: boolean;
data?: any; |
typescript |
constructor(
private httpClient: HttpClient,
private authService: AuthService
) {
super();
}
scrobble(input: SimpleTrack, timestamp: number = moment().unix()): Promise<ScrobbleResponse> {
return this.httpClient.post<ScrobbleResponse>(this.buildURL('track.scrobble', {
album: input.album,
artist: input.artist,
sk: this.authService.key,
timestamp: timestamp.toString(), |
typescript | public isLockedAsync(context: any) {
return new Promise(resolve => {
const checkLock = () => {
if (!this.isLocked(context)) {
return resolve();
}
setTimeout(() => checkLock(), 0);
};
checkLock();
});
}
public isLocked(context: any) {
return _.some(this.locks, lock => _.isEqual(lock, context)); |
typescript | hb = new Honeybee(HB_MONGO_URI!);
console.timeEnd("hb");
});
afterAll(async () => {
await hb.close();
}); |
typescript | <Wrapper>
<div>
<h1>Page you are looking forword is not found!</h1>
<h2>
{/* eslint-disable-next-line react/no-unescaped-entities */}
Don't worry I got you!{' '}
<Link to={`/`}>
<Button secondary={true}>Click here </Button>
</Link>{' '} |
typescript | // Copyright 2017-2021 @polkadot/api-contract authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { toRxMethod } from '@polkadot/api';
import { extendBlueprint, extendCode, extendContract } from '../base';
export const Blueprint = extendBlueprint<'rxjs'>('rxjs', toRxMethod);
export const Code = extendCode<'rxjs'>('rxjs', toRxMethod);
export const Contract = extendContract<'rxjs'>('rxjs', toRxMethod);
|
typescript | displayScope
}
}
}
}
`
export const ADD_ST = gql`
mutation createScriptTag($input: ScriptTagInput!) {
scriptTagCreate(input: $input) { |
typescript | <Text>---------</Text>
<Text>---------</Text>
<Text>---------</Text>
<Text>---------</Text>
<Text>---------</Text>
<Text>---------</Text>
<Text>---------</Text>
<Text>---------</Text>
<Text>---------</Text>
<Text>---------</Text>
<Text>---------</Text>
<Text>---------</Text>
<Text>---------</Text>
<Text>---------</Text>
<Text>---------</Text> |
typescript | } else {
accountsCopy.sort((a: Account, b: Account): number => {
if (a[sortId] < b[sortId]) {
return 1
}
if (a[sortId] > b[sortId]) {
return -1
}
return 0
})
}
}
if (sortId === 'dob') { |
typescript | return out;
}
export function whenNextMeeting(reunionType: string, possibleDate: Date): Date {
return possibleDate; // or null when no possibleDate found
}
export function dateToText(date: Date): string {
return Days[date.getDay()] + " "
+ date.getDate() + " de " + Months[date.getMonth()] + ", " + date.getHours() + ":"+ ("0" + date.getMinutes()).slice(-2) +" hs.";
}
export function twoDigits(num: number): string {
return ("0" + num).slice(-2);
} |
typescript | label: string;
timecode: string;
acrid: string;
urls: {
spotify: string;
deezer: string;
youtube: string; |
typescript | import mod = require("consume");
export function call() {
mod.call();
} |
typescript | }
return new Promise((resolve,reject)=>{
this.http.get<Repos>('https://api.github.com/users/'+searchName+"/repos?order=created&sort=asc?access_token="+environment.ApiKey).toPromise().then(
(results) => {
this.repo = results; |
typescript | }
async getAll(count = 10, offset = 0): Promise<Track[]> {
const tracks = await this.trackModel.find().skip(Number(offset)).limit(Number(count))
return tracks
|
typescript | if (this.clock.isToday(dp.activationDate)) {
id = dp.programId;
}
});
return this.getProgram(id);
}
|
typescript | }
describe('Api Gateway Nlb', () => {
it('Creates the stack', async () => {
const app = new MiraApp()
const stack = new MiraServiceStack(app, 'default')
const coreStack = new Core(stack) |
typescript | } = props;
return isLogged || authorized ? (
<User
{...otherProps}
as="button"
view="clear" |
typescript | import Data from "../Data";
export default class ItemTypes extends Data {
public nameId: string;
public superTypeId: number;
public plural: boolean;
public gender: number;
public rawZone: string;
public needUseConfirm: boolean;
}
|
typescript | import UnorderedList from './UnorderedList';
export default {
ol: OrderedList,
ul: UnorderedList,
}; |
typescript |
constructor(fileUploader: FileUploader) {
super();
this.fileUploader = fileUploader;
} |
typescript | setExpanded("");
} else {
setExpanded(cookie);
}
},
[expanded], |
typescript | static rotatePlayer = "rotate";
static create = "create"
static move = "move";
static createBoxes = "createBoxes";
static Close = "close";
static Jump = "jump";
static Shoot = "shoot"; |
typescript | *
* * [Usage](/docs/middlewares/override-middleware.md)
* * [Send response](/docs/middlewares/override/send-response.md)
* * [Authentication](/docs/middlewares/override/authentication.md)
* * [Response view](/docs/middlewares/override/response-view.md) |
typescript | import { FCBaseTrigger } from './base';
/**
* https://help.aliyun.com/document_detail/54788.html
*/
export class ApiGatewayTrigger extends FCBaseTrigger {
handler;
async toArgs(): Promise<any[]> { |
typescript |
it('should return col1Fields', () => {
let page = new WizardPage();
let field = createField(1);
let field2 = createField(undefined);
let field3 = createField(2);
page.case_fields = [field, field2, field3];
expect(page.getCol1Fields()).toEqual([field, field2]);
expect(page.getCol2Fields()).toEqual([field3]);
});
}); |
typescript | void bot.init();
} catch (e) {
console.error(e);
process.exit(0);
}
|
typescript | @UpdateDateColumn({
type: 'timestamp',
name: 'updated_at',
default: () => 'now()',
}) |
typescript | it('filters `input` tags by their disabled state', async () => {
dom(`
<p><input id="name-field" disabled/></p>
<p><input id="address-field"/></p>
`);
await expect(TextField({ id: 'name-field', disabled: true }).exists()).resolves.toBeUndefined();
await expect(TextField({ id: 'address-field', disabled: false }).exists()).resolves.toBeUndefined();
await expect(TextField({ id: 'name-field', disabled: false }).exists()).rejects.toHaveProperty('name', 'NoSuchElementError');
await expect(TextField({ id: 'address-field', disabled: true }).exists()).rejects.toHaveProperty('name', 'NoSuchElementError');
});
it('defaults to only enabled', async () => {
dom(` |
typescript | const [hasError, setHasError] = useState<string>(null);
const fetch = useCallback(async () => {
setIsLoading(true);
setHasError(null);
const response: HttpResponse<T> = await request();
if (!response.ok) setHasError(response.parsedBody.error);
if (response.ok) setData(response.parsedBody); |
typescript |
static newFilledMap(width: number, height: number, fillValue: number) {
return new NumberMap(
width,
height,
[...new Array(width * height)].fill(fillValue) |
typescript |
export interface ValueWithLabelProps {
key?: string;
label: string;
value?: string | number | boolean;
isUrl?: boolean;
renderIfEmptyValue?: boolean; |
typescript | import Bulbs from './Components/Bulbs';
import Nodes from './Components/Nodes';
import './App.css';
function App() {
return (
<div className="App">
<h2>Bulbs</h2>
<Bulbs />
<h2>Nodes</h2>
<Nodes />
</div> |
typescript | ],
timelineReplace: [
{
'locale': 'de',
'replaceSync': {
'Chudo-Yudo': 'Chudo-Yudo',
'Diabolos': 'Diabolos',
},
},
{
|
typescript | export const interactiveOption = new Option('-i, --interactive');
export const srcOption = new Option('--src <chain>');
export const destOption = new Option('--dest <chain>');
export const chainOption = new Option('--chain <chain>');
export const addLoggerOptionsTo = (command: commander.Command) => {
return command
.addOption(new Option('--log-level <level>').choices(Object.keys(levels)))
.option('-v, --verbose') |
typescript | import { StandardFieldsComponent } from './standardFields/standardFields.component';
import { ValidationStatesComponent } from './validationStates/validationStates.component';
import { InputGroupsComponent } from './inputGroups/inputGroups.component';
import { RatingInputsComponentt } from './ratingInputs/ratingInputs.component';
import { SelectInputsComponent } from './selectInputs/selectInputs.component';
import { CheckBoxesAndRadiosComponent } from './checkBoxesAndRadios/checkBoxesAndRadios.component';
import { PictureUploaderComponent } from './pictureUploader/pictureUploader.component';
import { CkeditorComponent } from './ckeditor/ckeditor.component';
import { LayoutBasciFormComponent } from './layoutBasicForm/layoutBascicForm.component';
import { LayoutBlockFormComponent } from './layoutBlockForm/layoutBlockForm.component'; |
typescript | import { Component } from "../type";
export function render(comp: Component<{}, any>) {
}
|
typescript | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import '../elements/line_chart'; |
typescript | <gh_stars>0
// normalized information about all possible types of personal wallets
export enum EWalletType {
LEDGER = "LEDGER",
BROWSER = "BROWSER",
LIGHT = "LIGHT",
UNKNOWN = "UNKNOWN",
}
export enum EWalletSubType {
METAMASK = "METAMASK",
PARITY = "PARITY",
UNKNOWN = "UNKNOWN",
} |
typescript | import { CustomQuery, DocumentDatabaseTableProvider, getFilterExpressionFromKeyValuePairs, getTableName, isCustomQuery, Query, QueryResults } from "@mcma/data";
import { McmaApiRequestContext } from "../../http";
import { McmaApiRoute } from "../route";
interface CustomQueryFactory<T> {
isMatch(requestContext: McmaApiRequestContext): boolean;
create(requestContext: McmaApiRequestContext): CustomQuery<T>; |
typescript | @Component({
selector: 'search-mobile',
templateUrl: './mobile.component.html',
styleUrls: ['../base/base.component.scss', './mobile.component.scss'],
providers: [SearchService],
changeDetection: ChangeDetectionStrategy.OnPush
})
export class MobileSearchComponent extends SearchComponent {
constructor(
private cdr: ChangeDetectorRef, |
typescript | export interface IUrlBase {
protocol: string
hostname: string
port: number
} |
typescript | transform: ${(props) => (props.flipped ? "rotate(0deg)" : "rotateY(180deg)")};
`
export const BackImg = styled.img<Props>`
${sharedStyles}
z-index: ${(props) => (props.flipped ? 1 : 2)};
transform: ${(props) =>
props.flipped ? "rotateY(180deg)" : "rotate(360deg)"};
position: absolute;
top: 0px;
left: 0px; |
typescript | this.editor = null;
this.state.knownEntityElements = [];
this.state.clickingPoint = null;
}
/**
* Get plugin state object
*/
getState() {
return this.state;
}
|
typescript | }
export default class SpFxAlmWebPart extends BaseClientSideWebPart<ISpFxAlmWebPartProps> {
protected async onInit(): Promise<void> {
HttpService.Init(this.context.spHttpClient);
}
public render(): void {
const element: React.ReactElement<ISpFxAlmProps> = React.createElement(
SpFxAlm,
{
url: this.context.pageContext.web.absoluteUrl, |
typescript | import { BehaviorSubject, combineLatest, defer } from 'rxjs';
import { shareReplay, switchMap } from 'rxjs/operators';
import { ClaimsService } from '@dsh/api/claims';
@Injectable()
export class ClaimService {
claim$ = combineLatest([this.route.params, defer(() => this.loadClaim$)]).pipe(
switchMap(([{ claimID }]) => this.claimsService.getClaimByID(claimID)), |
typescript | const {playList} = useSelector((state: RootState) => ({
playList: state.player.playList
}));
const play = (song: ITrack)=>{
const index = playList.length
dispatch(changePlayList({list: [song], type: 1}))
dispatch(changeIndex(index))
dispatch(changeFullScreen(true))
} |
typescript | window.clearTimeout(timerId)
timerId = null
}
if (rafId !== null) {
window.cancelAnimationFrame(rafId)
rafId = null
}
}
onMounted(() => {
watchEffect(() => {
if (props.active) {
pnow = performance.now()
frame()
} else {
const now = performance.now() |
typescript | import React from 'react';
import { StackNavigationProp } from '@react-navigation/stack';
import {
StatusBar
} from 'react-native'; |
typescript | fields: ['imageSizes'],
callback(err, data) {
if (err) {
return options.callback(err, data)
}
return options.callback(null, get(data, 'imageSizes', data))
},
})
},
subscribeDefaultPermissionsGroup(options: CF.Subscribe) {
return api.subscribe({
...options, |
typescript | };
webPublicationDate: string;
}
const TGuardianApiKey = '73d94c30-f8a6-43f4-a123-007136ff79e4'; |
typescript | export const AppConfig = {
clientId: process.env.REACT_APP_GOOGLE_CLIENT_ID ?? ""
};
|
typescript | export { getRoutingPriority } from './ecs-routing';
|
typescript | interface IdFormattedVerb {
readonly id: string;
}
export default IdFormattedVerb;
|
typescript | import { IFormattedDate } from '../types'
const dateFns = new DateFnsUtils();
const toDateFn = (date: Date | string | null) => dateFns.date(date)
const today = dateFns.date(new Date())
const getDateDelta = (date: string) => dateFns.getDiff(toDateFn(date), today)
const daysDiff = (date: number | Date): number => differenceInDays(date, today)
const hoursDiff = (date: number | Date) => differenceInHours(date, today)
export const timeRemaining = (date: Date | string | null): string => {
const dateStr = toDateFn(date)
const totalHours = hoursDiff(dateStr)
const remainder = totalHours % 24
const days = Math.floor(totalHours / 24) |
typescript | PLUGINS = 1,
CARDS = 2,
FOLDERS = 4,
}
export type ApiGameEntities = {
guid: string;
icon: string;
};
|
typescript |
export interface MinimalQueryIterator {
fetchNext: () => Promise<QueryResponse>;
}
// Pick<QueryIterator<any>, "fetchNext">;
|
typescript | type Msg2Content = { msg:string };
type Msg2 = Event<'2', Msg2Content>;
type Msg= Msg1 | Msg2;
const MkMsg1 = ():Msg1 => ({ eventKind: '1', type: undefined });
const MkMsg2 = (msg:Msg2Content):Msg2 => ({ eventKind: '2', type: msg }); |
typescript | export interface ClusterConnection {
clusterType: string;
id: string;
description?: string;
name: string;
settings?: string;
settingsJsonObject?: any;
}
|
typescript | import { Prompt } from '../../infrastructure/prompt';
@Component({
selector: 'app-force-push-prompt',
templateUrl: './force-push-prompt.component.html',
styleUrls: ['./force-push-prompt.component.scss']
})
export class ForcePushPromptComponent implements OnInit, Prompt {
toClose = new EventEmitter();
onResult = new EventEmitter<boolean>();
constructor() { } |
typescript | <gh_stars>1-10
import { DocumentSnapshot } from '@angular/fire/firestore';
import { Document } from './document';
export type DocumentSnapshot<T> = DocumentSnapshot<T> & {
/** Document reference corresponding to this snapshot */
document: Document<T>;
/** Custom object from the data of this document */
value: T;
};
|
typescript | import { Loader } from './Loader';
export { Loader };
|
typescript | declare module 'chimee' {
export let Chimee: any
}
declare module 'chimee-kernel-hls' {
const chimeeKernelHls: any;
export default chimeeKernelHls
}
|
typescript | import { UISettingsForm } from '../../../interfaces';
// UI
import { InputGroup, Button, SettingsHeadline } from '../../UI';
// Utils
import { uiSettingsTemplate, inputHandler } from '../../../utility';
export const UISettings = (): JSX.Element => {
const { loading, config } = useSelector((state: State) => state.config);
const dispatch = useDispatch();
const { updateConfig } = bindActionCreators(actionCreators, dispatch);
|
typescript | password if you forget to send it to them.
</DialogContentText>
<Grid container direction="row" alignItems="flex-start">
<Typography>Email: </Typography>
<Typography className={classes.boldText} color="secondary">
{latestCadet?.email ?? ""} |
typescript | // Helper module for vue
// TODO: Figure out how to use provided types instead.
declare const Vue: any;
export default {
reactive: Vue.reactive,
watch: Vue.watch,
h: Vue.h, |
typescript |
const file = readInput();
const input = getReportEntries(file);
console.group("Day 1");
console.time("Time");
const resultOne = partOne(input); |
typescript | import { ChangeLinkColorDirective } from './change-link-color.directive';
export const appDirectives = [
ChangeLinkColorDirective,
];
export * from './change-link-color.directive';
|
typescript | {
label: 'Berkeley City Club',
lat: 37.86751,
lng: -122.262759,
}, |
typescript | declare function convexpress(
options: convexpress.IOptions
): convexpress.IConvRouter;
export = convexpress; |
typescript | endTimeStr: string;
btnCls: string;
set propsData(value: any);
set disableBtn(value: any);
set formatStr(value: any);
set startDateTime(value: any);
set endDateTime(value: any);
set onConfirm(value: any);
confirmPane: boolean;
constructor();
formatTime(): void; |
typescript | <gh_stars>1-10
import * as b from "bobril";
import { IRouteWithNavDefinition } from "../../../common/routing";
import { Helpers } from "./Helpers";
import { clearfixRoute } from "./parts/Clearfix";
import { coloredLinksRoute } from "./parts/ColoredLinks";
import { positionHelperRoute } from "./parts/Position";
import { ratioRoute } from "./parts/Ratio";
import { stretchedLinkRoute } from "./parts/StretchedLink"; |
typescript | afterEach(() => wrapper?.unmount());
it.each([
[
Mock.all<NotFoundServer>(),
{
'Could not find this Shlink server.': true,
'Oops! Could not connect to this Shlink server.': false,
'Make sure you have internet connection, and the server is properly configured and on-line.': false,
'Alternatively, if you think you may have miss-configured this server': false, |
typescript |
export const INTERSECTION_MARK_STYLE = style(
{
fill: intersection_color,
opacity: 0.9,
cursor: "pointer",
},
hoverEffect
);
// Selection Style
|
typescript | ? theme.typography.body1.fontSize
: theme.typography.h6.fontSize,
},
"& span": {
display: "block",
color: theme.palette.grey[700],
},
[theme.breakpoints.down("md")]: {
marginBottom: 0,
paddingRight: 0,
},
}), |
typescript | updateCompletedSubFailures(diff: number) {
this.completedSubFailures += diff;
const newCompleted = this.completedSubFailures >= this.requiredSubFailures;
if (this.parent) {
if (this.hasFailed && !newCompleted) {
this.parent.updateCompletedSubFailures(-1);
}
else if (!this.hasFailed && newCompleted) {
this.parent.updateCompletedSubFailures(1);
}
} |
typescript | import { createAction, props } from '@ngrx/store';
import { Room } from '../models';
const actionName = (identifier: string): string => {
return `[Room] ${identifier}`;
};
export const load = createAction(actionName('Load'));
export const loadSuccess = createAction(actionName('LoadSuccess'), props<{ rooms: Room[] }>());
|
typescript |
/** Provide reducer in AoT-compilation happy way */
export function reducers(state: MembersState | undefined, action: Action) {
return combineReducers({
[fromMembers.membersEntityFeatureKey]: fromMembers.reducer
})(state, action);
}
export const selectMembersState = createFeatureSelector<State, MembersState>(
membersFeatureKey
);
export const selectMemberEntitiesState = createSelector( |
typescript | import config from './config/config';
async function bootstrap() {
const port = config.port || 3000;
const app = await NestFactory.create(AppModule);
await app.listen(port); |
typescript | importPath = fileSpec;
}
if (importPath == null) {
return null;
}
const parsed = url.parse(importPath);
if (!parsed || !parsed.path || parsed.protocol !== "file:") { |
typescript | import { Translations } from '../../app/state/language/types';
export interface ErrorObject {
description?: string;
descriptionKey: keyof Translations;
id: number;
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.