type
stringclasses 7
values | content
stringlengths 4
9.55k
| repo
stringlengths 7
96
| path
stringlengths 4
178
| language
stringclasses 1
value |
|---|---|---|---|---|
ArrowFunction
|
() => {
var s = Set('abc');
expect(s.size).toBe(3)
expect(s.has('a')).toBe(true);
expect(s.has('b')).toBe(true);
expect(s.has('c')).toBe(true);
expect(s.has('abc')).toBe(false);
}
|
DanielRosenwasser/immutable-js
|
__tests__/Set.ts
|
TypeScript
|
ArrowFunction
|
() => {
var seq = Immutable.Seq.of(1,2,3);
var s = Set(seq);
expect(s.has(1)).toBe(true);
expect(s.has(2)).toBe(true);
expect(s.has(3)).toBe(true);
expect(s.has(4)).toBe(false);
}
|
DanielRosenwasser/immutable-js
|
__tests__/Set.ts
|
TypeScript
|
ArrowFunction
|
() => {
var seq = Immutable.Seq({a:null, b:null, c:null}).flip();
var s = Set(seq);
expect(s.toArray()).toEqual([[null,'a'], [null,'b'], [null,'c']]);
// Explicitly getting the values sequence
var s2 = Set(seq.valueSeq());
expect(s2.toArray()).toEqual(['a','b','c']);
// toSet() does this for you.
var v3 = seq.toSet();
expect(v3.toArray()).toEqual(['a', 'b', 'c']);
}
|
DanielRosenwasser/immutable-js
|
__tests__/Set.ts
|
TypeScript
|
ArrowFunction
|
() => {
var s = Set.fromKeys({a:null, b:null, c:null});
expect(s.has('a')).toBe(true);
expect(s.has('b')).toBe(true);
expect(s.has('c')).toBe(true);
expect(s.has('d')).toBe(false);
}
|
DanielRosenwasser/immutable-js
|
__tests__/Set.ts
|
TypeScript
|
ArrowFunction
|
() => {
var seq = Immutable.Seq({a:null, b:null, c:null});
var s = Set.fromKeys(seq);
expect(s.has('a')).toBe(true);
expect(s.has('b')).toBe(true);
expect(s.has('c')).toBe(true);
expect(s.has('d')).toBe(false);
}
|
DanielRosenwasser/immutable-js
|
__tests__/Set.ts
|
TypeScript
|
ArrowFunction
|
() => {
var s = Set.of(1,2,3);
expect(s.has(1)).toBe(true);
expect(s.has(2)).toBe(true);
expect(s.has(3)).toBe(true);
expect(s.has(4)).toBe(false);
}
|
DanielRosenwasser/immutable-js
|
__tests__/Set.ts
|
TypeScript
|
ArrowFunction
|
() => {
var s = Set.of(1,2,3);
expect(s.toArray()).toEqual([1,2,3]);
}
|
DanielRosenwasser/immutable-js
|
__tests__/Set.ts
|
TypeScript
|
ArrowFunction
|
() => {
var s = Set.of('a','b','c');
expect(s.toObject()).toEqual({a:'a',b:'b',c:'c'});
}
|
DanielRosenwasser/immutable-js
|
__tests__/Set.ts
|
TypeScript
|
ArrowFunction
|
() => {
var s = Set.of(1,2,3);
var iterator = jest.genMockFunction();
s.forEach(iterator);
expect(iterator.mock.calls).toEqual([
[1, 1, s],
[2, 2, s],
[3, 3, s]
]);
}
|
DanielRosenwasser/immutable-js
|
__tests__/Set.ts
|
TypeScript
|
ArrowFunction
|
() => {
var s1 = Set.of('a', 'b', 'c');
var s2 = Set.of('d', 'b', 'wow');
var s3 = s1.union(s2);
expect(s3.toArray()).toEqual(['a', 'b', 'c', 'd', 'wow']);
}
|
DanielRosenwasser/immutable-js
|
__tests__/Set.ts
|
TypeScript
|
ArrowFunction
|
() => {
var s1 = Set.of('a', 'b', 'c');
var s2 = Set.of('c', 'a');
var s3 = s1.union(s2);
expect(s3).toBe(s1);
}
|
DanielRosenwasser/immutable-js
|
__tests__/Set.ts
|
TypeScript
|
ArrowFunction
|
() => {
var s1 = Set();
var s2 = Set.of('a', 'b', 'c');
var s3 = s1.union(s2);
expect(s3).toBe(s2);
}
|
DanielRosenwasser/immutable-js
|
__tests__/Set.ts
|
TypeScript
|
ArrowFunction
|
() => {
var s1 = Set([1,2,3]);
var emptySet = Set();
var l = Immutable.List([1,2,3]);
var s2 = s1.union(l);
var s3 = emptySet.union(l);
var o = Immutable.OrderedSet([1,2,3]);
var s4 = s1.union(o);
var s5 = emptySet.union(o);
expect(Set.isSet(s2)).toBe(true);
expect(Set.isSet(s3)).toBe(true);
expect(Set.isSet(s4) && !Immutable.OrderedSet.isOrderedSet(s4)).toBe(true);
expect(Set.isSet(s5) && !Immutable.OrderedSet.isOrderedSet(s5)).toBe(true);
}
|
DanielRosenwasser/immutable-js
|
__tests__/Set.ts
|
TypeScript
|
ArrowFunction
|
() => {
var s1 = Set();
var s2 = s1.add('a');
var s3 = s2.add('b');
var s4 = s3.add('c');
var s5 = s4.add('b');
expect(s1.size).toBe(0);
expect(s2.size).toBe(1);
expect(s3.size).toBe(2);
expect(s4.size).toBe(3);
expect(s5.size).toBe(3);
}
|
DanielRosenwasser/immutable-js
|
__tests__/Set.ts
|
TypeScript
|
ArrowFunction
|
() => {
var s1 = Set();
var s2 = s1.add('a');
var s3 = s2.add('b');
var s4 = s3.add('c');
var s5 = s4.remove('b');
expect(s1.size).toBe(0);
expect(s2.size).toBe(1);
expect(s3.size).toBe(2);
expect(s4.size).toBe(3);
expect(s5.size).toBe(2);
expect(s3.has('b')).toBe(true);
expect(s5.has('b')).toBe(false);
}
|
DanielRosenwasser/immutable-js
|
__tests__/Set.ts
|
TypeScript
|
ArrowFunction
|
() => {
var s = Set.of('A').remove('A');
expect(s).toBe(Set());
}
|
DanielRosenwasser/immutable-js
|
__tests__/Set.ts
|
TypeScript
|
ArrowFunction
|
() => {
var s = Set.of('A', 'B', 'C').union(Set.of('C', 'D', 'E'), Set.of('D', 'B', 'F'));
expect(s).is(Set.of('A','B','C','D','E','F'));
}
|
DanielRosenwasser/immutable-js
|
__tests__/Set.ts
|
TypeScript
|
ArrowFunction
|
() => {
var s = Set.of('A', 'B', 'C').intersect(Set.of('B', 'C', 'D'), Set.of('A', 'C', 'E'));
expect(s).is(Set.of('C'));
}
|
DanielRosenwasser/immutable-js
|
__tests__/Set.ts
|
TypeScript
|
ArrowFunction
|
() => {
var s = Set.of('A', 'B', 'C').subtract(Set.of('C', 'D', 'E'), Set.of('D', 'B', 'F'));
expect(s).is(Set.of('A'));
}
|
DanielRosenwasser/immutable-js
|
__tests__/Set.ts
|
TypeScript
|
ArrowFunction
|
() => {
var s1 = Set.of('A', 'B', 'C');
expect(s1.equals(null)).toBe(false);
var s2 = Set.of('C', 'B', 'A');
expect(s1 === s2).toBe(false);
expect(Immutable.is(s1, s2)).toBe(true);
expect(s1.equals(s2)).toBe(true);
// Map and Set are not the same (keyed vs unkeyed)
var v1 = Immutable.Map({ A: 'A', C: 'C', B: 'B' });
expect(Immutable.is(s1, v1)).toBe(false);
}
|
DanielRosenwasser/immutable-js
|
__tests__/Set.ts
|
TypeScript
|
ArrowFunction
|
() => {
var js = Immutable.Set().withMutations(set => {
set.union([ 'a' ]);
set.add('b');
}).toJS();
expect(js).toEqual(['a', 'b']);
}
|
DanielRosenwasser/immutable-js
|
__tests__/Set.ts
|
TypeScript
|
ArrowFunction
|
set => {
set.union([ 'a' ]);
set.add('b');
}
|
DanielRosenwasser/immutable-js
|
__tests__/Set.ts
|
TypeScript
|
ArrowFunction
|
() => {
var s = Set.of('A', 'B', 'C');
expect(s.isSuperset(['B', 'C'])).toBe(true);
expect(s.isSuperset(['B', 'C', 'D'])).toBe(false);
}
|
DanielRosenwasser/immutable-js
|
__tests__/Set.ts
|
TypeScript
|
InterfaceDeclaration
|
interface ExpectWithIs extends Expect {
is(expected: any): void;
not: ExpectWithIs;
}
|
DanielRosenwasser/immutable-js
|
__tests__/Set.ts
|
TypeScript
|
ArrowFunction
|
(manager: StatusBarItemsManager): readonly CommonStatusBarItem[] => {
const uiItemProviderIds = useAvailableUiItemsProviders();
const stageId = useActiveStageId();
const [items, setItems] = React.useState(manager.items);
const providersRef = React.useRef("");
const currentStageRef = React.useRef("");
// gathers items from registered extensions - dependent on when a UiItemsProvider is register or unregistered and if the
// current stage's composer allows entries from extensions.
React.useEffect(() => {
const uiProviders = uiItemProviderIds.join("-");
// istanbul ignore else
if (providersRef.current !== uiProviders || currentStageRef.current !== stageId) {
currentStageRef.current = stageId;
providersRef.current = uiProviders;
const statusBarItems = UiItemsManager.getStatusBarItems(stageId, StageUsage.General);
const updatedStatusBarItems = UiItemsArbiter.updateStatusBarItems(statusBarItems);
manager.loadItems(updatedStatusBarItems);
setItems(manager.items);
}
}, [manager, uiItemProviderIds, stageId]);
// handle item changes caused by calls to UiFramework.addonStatusBarItemsManager.setxxx
React.useEffect(() => {
const handleChanged = (args: StatusBarItemsChangedArgs) => {
setItems(args.items);
};
manager.onItemsChanged.addListener(handleChanged);
return () => {
manager.onItemsChanged.removeListener(handleChanged);
};
}, [manager]);
return items;
}
|
rssahai/imodeljs
|
ui/framework/src/ui-framework/statusbar/useUiItemsProviderStatusBarItems.tsx
|
TypeScript
|
ArrowFunction
|
() => {
const uiProviders = uiItemProviderIds.join("-");
// istanbul ignore else
if (providersRef.current !== uiProviders || currentStageRef.current !== stageId) {
currentStageRef.current = stageId;
providersRef.current = uiProviders;
const statusBarItems = UiItemsManager.getStatusBarItems(stageId, StageUsage.General);
const updatedStatusBarItems = UiItemsArbiter.updateStatusBarItems(statusBarItems);
manager.loadItems(updatedStatusBarItems);
setItems(manager.items);
}
}
|
rssahai/imodeljs
|
ui/framework/src/ui-framework/statusbar/useUiItemsProviderStatusBarItems.tsx
|
TypeScript
|
ArrowFunction
|
() => {
const handleChanged = (args: StatusBarItemsChangedArgs) => {
setItems(args.items);
};
manager.onItemsChanged.addListener(handleChanged);
return () => {
manager.onItemsChanged.removeListener(handleChanged);
};
}
|
rssahai/imodeljs
|
ui/framework/src/ui-framework/statusbar/useUiItemsProviderStatusBarItems.tsx
|
TypeScript
|
ArrowFunction
|
(args: StatusBarItemsChangedArgs) => {
setItems(args.items);
}
|
rssahai/imodeljs
|
ui/framework/src/ui-framework/statusbar/useUiItemsProviderStatusBarItems.tsx
|
TypeScript
|
ArrowFunction
|
() => {
manager.onItemsChanged.removeListener(handleChanged);
}
|
rssahai/imodeljs
|
ui/framework/src/ui-framework/statusbar/useUiItemsProviderStatusBarItems.tsx
|
TypeScript
|
ClassDeclaration
|
export abstract class CTRGladman extends BlockCipherMode {
public static Encryptor = CTRGladmanEncryptor;
public static Decryptor = CTRGladmanEncryptor;
}
|
star-dancer/crackpot
|
src/mode/CTR-GLADMAN.ts
|
TypeScript
|
InterfaceDeclaration
|
export interface IListConfig extends IDragConfig {
template?: (obj: IDataItem) => string;
data?: DataCollection<any> | any[];
virtual?: boolean;
itemHeight?: number | string;
css?: string;
height?: number | string;
selection?: boolean;
multiselection?: boolean | MultiselectionMode;
keyNavigation?: boolean | (() => boolean);
editable?: boolean;
hotkeys?: IHandlers;
eventHandlers?: {
[key: string]: any;
};
/** @deprecated See a documentation: https://docs.dhtmlx.com/ */
editing?: boolean;
/** @deprecated See a documentation: https://docs.dhtmlx.com/ */
multiselectionMode?: MultiselectionMode;
}
|
jorgemacias/solicitudes
|
public/libs/dhtmlx/types/ts-list/sources/types.d.ts
|
TypeScript
|
InterfaceDeclaration
|
export interface IListEventHandlersMap {
[key: string]: (...args: any[]) => any;
[ListEvents.click]: (id: string, e: Event) => any;
[ListEvents.itemMouseOver]: (id: string, e: Event) => any;
[ListEvents.doubleClick]: (id: string, e: Event) => any;
[ListEvents.itemRightClick]: (id: string, e: MouseEvent) => any;
[ListEvents.focusChange]: (focusIndex: number, id: string) => any;
[ListEvents.beforeEditStart]: (id: string) => void | boolean;
[ListEvents.afterEditStart]: (id: string) => void;
[ListEvents.beforeEditEnd]: (value: any, id: string) => void | boolean;
[ListEvents.afterEditEnd]: (value: any, id: string) => void;
[ListEvents.contextmenu]: (id: string, e: MouseEvent) => any;
}
|
jorgemacias/solicitudes
|
public/libs/dhtmlx/types/ts-list/sources/types.d.ts
|
TypeScript
|
InterfaceDeclaration
|
export interface ISelectionConfig {
multiselection?: boolean | MultiselectionMode;
disabled?: boolean;
}
|
jorgemacias/solicitudes
|
public/libs/dhtmlx/types/ts-list/sources/types.d.ts
|
TypeScript
|
InterfaceDeclaration
|
export interface IList<T = any> {
config: IListConfig;
data: DataCollection<T>;
events: IEventSystem<DataEvents | ListEvents | DragEvents, IListEventHandlersMap & IDataEventsHandlersMap & IDragEventsHandlersMap>;
selection: ISelection;
paint(): void;
destructor(): void;
editItem(id: string): void;
getFocusItem(): T;
setFocus(id: string): void;
getFocus(): string;
showItem(id: string): void;
/** @deprecated See a documentation: https://docs.dhtmlx.com/ */
disableSelection(): void;
/** @deprecated See a documentation: https://docs.dhtmlx.com/ */
enableSelection(): void;
}
|
jorgemacias/solicitudes
|
public/libs/dhtmlx/types/ts-list/sources/types.d.ts
|
TypeScript
|
InterfaceDeclaration
|
export interface ISelection<T = any> {
config: ISelectionConfig;
events: IEventSystem<SelectionEvents | DataEvents, ISelectionEventsHandlersMap & IDataEventsHandlersMap>;
getId(): string | string[] | undefined;
getItem(): T;
contains(id?: string): boolean;
remove(id?: string): void;
add(id?: string, isShift?: boolean, isCtrl?: boolean, silent?: boolean): void;
enable(): void;
disable(): void;
destructor(): void;
}
|
jorgemacias/solicitudes
|
public/libs/dhtmlx/types/ts-list/sources/types.d.ts
|
TypeScript
|
InterfaceDeclaration
|
export interface IListItem {
[key: string]: any;
}
|
jorgemacias/solicitudes
|
public/libs/dhtmlx/types/ts-list/sources/types.d.ts
|
TypeScript
|
EnumDeclaration
|
export declare enum ListEvents {
click = "click",
doubleClick = "doubleclick",
focusChange = "focuschange",
beforeEditStart = "beforeEditStart",
afterEditStart = "afterEditStart",
beforeEditEnd = "beforeEditEnd",
afterEditEnd = "afterEditEnd",
itemRightClick = "itemRightClick",
itemMouseOver = "itemMouseOver",
/** @deprecated See a documentation: https://docs.dhtmlx.com/ */
contextmenu = "contextmenu"
}
|
jorgemacias/solicitudes
|
public/libs/dhtmlx/types/ts-list/sources/types.d.ts
|
TypeScript
|
TypeAliasDeclaration
|
export declare type MultiselectionMode = "click" | "ctrlClick";
|
jorgemacias/solicitudes
|
public/libs/dhtmlx/types/ts-list/sources/types.d.ts
|
TypeScript
|
ClassDeclaration
|
/** Provides operations to manage the subscriptions property of the microsoft.graph.driveItem entity. */
export class SubscriptionItemRequestBuilder {
/** Path parameters for the request */
private readonly pathParameters: Record<string, unknown>;
/** The request adapter to use to execute the requests. */
private readonly requestAdapter: RequestAdapter;
/** Url template to use to build the URL for the current request builder */
private readonly urlTemplate: string;
/**
* Instantiates a new SubscriptionItemRequestBuilder and sets the default values.
* @param pathParameters The raw url or the Url template parameters for the request.
* @param requestAdapter The request adapter to use to execute the requests.
*/
public constructor(pathParameters: Record<string, unknown> | string | undefined, requestAdapter: RequestAdapter) {
if(!pathParameters) throw new Error("pathParameters cannot be undefined");
if(!requestAdapter) throw new Error("requestAdapter cannot be undefined");
this.urlTemplate = "{+baseurl}/drives/{drive%2Did}/items/{driveItem%2Did}/subscriptions/{subscription%2Did}{?%24select,%24expand}";
const urlTplParams = getPathParameters(pathParameters);
this.pathParameters = urlTplParams;
this.requestAdapter = requestAdapter;
};
/**
* Delete navigation property subscriptions for drives
* @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
* @returns a RequestInformation
*/
public createDeleteRequestInformation(requestConfiguration?: SubscriptionItemRequestBuilderDeleteRequestConfiguration | undefined) : RequestInformation {
const requestInfo = new RequestInformation();
requestInfo.urlTemplate = this.urlTemplate;
requestInfo.pathParameters = this.pathParameters;
requestInfo.httpMethod = HttpMethod.DELETE;
if (requestConfiguration) {
requestInfo.addRequestHeaders(requestConfiguration.headers);
requestInfo.addRequestOptions(requestConfiguration.options);
}
return requestInfo;
};
/**
* The set of subscriptions on the item. Only supported on the root of a drive.
* @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
* @returns a RequestInformation
*/
public createGetRequestInformation(requestConfiguration?: SubscriptionItemRequestBuilderGetRequestConfiguration | undefined) : RequestInformation {
const requestInfo = new RequestInformation();
requestInfo.urlTemplate = this.urlTemplate;
requestInfo.pathParameters = this.pathParameters;
requestInfo.httpMethod = HttpMethod.GET;
if (requestConfiguration) {
requestInfo.addRequestHeaders(requestConfiguration.headers);
requestInfo.setQueryStringParametersFromRawObject(requestConfiguration.queryParameters);
requestInfo.addRequestOptions(requestConfiguration.options);
}
return requestInfo;
};
/**
* Update the navigation property subscriptions in drives
* @param body
* @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
* @returns a RequestInformation
*/
public createPatchRequestInformation(body: Subscription | undefined, requestConfiguration?: SubscriptionItemRequestBuilderPatchRequestConfiguration | undefined) : RequestInformation {
if(!body) throw new Error("body cannot be undefined");
const requestInfo = new RequestInformation();
requestInfo.urlTemplate = this.urlTemplate;
requestInfo.pathParameters = this.pathParameters;
requestInfo.httpMethod = HttpMethod.PATCH;
if (requestConfiguration) {
requestInfo.addRequestHeaders(requestConfiguration.headers);
requestInfo.addRequestOptions(requestConfiguration.options);
}
requestInfo.setContentFromParsable(this.requestAdapter, "application/json", body);
return requestInfo;
};
/**
* Delete navigation property subscriptions for drives
* @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
* @param responseHandler Response handler to use in place of the default response handling provided by the core service
*/
public delete(requestConfiguration?: SubscriptionItemRequestBuilderDeleteRequestConfiguration | undefined, responseHandler?: ResponseHandler | undefined) : Promise<void> {
const requestInfo = this.createDeleteRequestInformation(
requestConfiguration
);
const errorMapping: Record<string, ParsableFactory<Parsable>> = {
"4XX": createODataErrorFromDiscriminatorValue,
"5XX": createODataErrorFromDiscriminatorValue,
};
return this.requestAdapter?.sendNoResponseContentAsync(requestInfo, responseHandler, errorMapping) ?? Promise.reject(new Error('http core is null'));
};
/**
* The set of subscriptions on the item. Only supported on the root of a drive.
* @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
* @param responseHandler Response handler to use in place of the default response handling provided by the core service
* @returns a Promise of Subscription
*/
public get(requestConfiguration?: SubscriptionItemRequestBuilderGetRequestConfiguration | undefined, responseHandler?: ResponseHandler | undefined) : Promise<Subscription | undefined> {
const requestInfo = this.createGetRequestInformation(
requestConfiguration
);
const errorMapping: Record<string, ParsableFactory<Parsable>> = {
"4XX": createODataErrorFromDiscriminatorValue,
"5XX": createODataErrorFromDiscriminatorValue,
};
return this.requestAdapter?.sendAsync<Subscription>(requestInfo, createSubscriptionFromDiscriminatorValue, responseHandler, errorMapping) ?? Promise.reject(new Error('http core is null'));
};
/**
* Update the navigation property subscriptions in drives
* @param body
* @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
* @param responseHandler Response handler to use in place of the default response handling provided by the core service
*/
public patch(body: Subscription | undefined, requestConfiguration?: SubscriptionItemRequestBuilderPatchRequestConfiguration | undefined, responseHandler?: ResponseHandler | undefined) : Promise<void> {
if(!body) throw new Error("body cannot be undefined");
const requestInfo = this.createPatchRequestInformation(
body, requestConfiguration
);
const errorMapping: Record<string, ParsableFactory<Parsable>> = {
"4XX": createODataErrorFromDiscriminatorValue,
"5XX": createODataErrorFromDiscriminatorValue,
};
return this.requestAdapter?.sendNoResponseContentAsync(requestInfo, responseHandler, errorMapping) ?? Promise.reject(new Error('http core is null'));
};
}
|
microsoftgraph/msgraph-sdk-typescript
|
src/drives/item/items/item/subscriptions/item/subscriptionItemRequestBuilder.ts
|
TypeScript
|
MethodDeclaration
|
/**
* Delete navigation property subscriptions for drives
* @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
* @returns a RequestInformation
*/
public createDeleteRequestInformation(requestConfiguration?: SubscriptionItemRequestBuilderDeleteRequestConfiguration | undefined) : RequestInformation {
const requestInfo = new RequestInformation();
requestInfo.urlTemplate = this.urlTemplate;
requestInfo.pathParameters = this.pathParameters;
requestInfo.httpMethod = HttpMethod.DELETE;
if (requestConfiguration) {
requestInfo.addRequestHeaders(requestConfiguration.headers);
requestInfo.addRequestOptions(requestConfiguration.options);
}
return requestInfo;
}
|
microsoftgraph/msgraph-sdk-typescript
|
src/drives/item/items/item/subscriptions/item/subscriptionItemRequestBuilder.ts
|
TypeScript
|
MethodDeclaration
|
/**
* The set of subscriptions on the item. Only supported on the root of a drive.
* @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
* @returns a RequestInformation
*/
public createGetRequestInformation(requestConfiguration?: SubscriptionItemRequestBuilderGetRequestConfiguration | undefined) : RequestInformation {
const requestInfo = new RequestInformation();
requestInfo.urlTemplate = this.urlTemplate;
requestInfo.pathParameters = this.pathParameters;
requestInfo.httpMethod = HttpMethod.GET;
if (requestConfiguration) {
requestInfo.addRequestHeaders(requestConfiguration.headers);
requestInfo.setQueryStringParametersFromRawObject(requestConfiguration.queryParameters);
requestInfo.addRequestOptions(requestConfiguration.options);
}
return requestInfo;
}
|
microsoftgraph/msgraph-sdk-typescript
|
src/drives/item/items/item/subscriptions/item/subscriptionItemRequestBuilder.ts
|
TypeScript
|
MethodDeclaration
|
/**
* Update the navigation property subscriptions in drives
* @param body
* @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
* @returns a RequestInformation
*/
public createPatchRequestInformation(body: Subscription | undefined, requestConfiguration?: SubscriptionItemRequestBuilderPatchRequestConfiguration | undefined) : RequestInformation {
if(!body) throw new Error("body cannot be undefined");
const requestInfo = new RequestInformation();
requestInfo.urlTemplate = this.urlTemplate;
requestInfo.pathParameters = this.pathParameters;
requestInfo.httpMethod = HttpMethod.PATCH;
if (requestConfiguration) {
requestInfo.addRequestHeaders(requestConfiguration.headers);
requestInfo.addRequestOptions(requestConfiguration.options);
}
requestInfo.setContentFromParsable(this.requestAdapter, "application/json", body);
return requestInfo;
}
|
microsoftgraph/msgraph-sdk-typescript
|
src/drives/item/items/item/subscriptions/item/subscriptionItemRequestBuilder.ts
|
TypeScript
|
MethodDeclaration
|
/**
* Delete navigation property subscriptions for drives
* @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
* @param responseHandler Response handler to use in place of the default response handling provided by the core service
*/
public delete(requestConfiguration?: SubscriptionItemRequestBuilderDeleteRequestConfiguration | undefined, responseHandler?: ResponseHandler | undefined) : Promise<void> {
const requestInfo = this.createDeleteRequestInformation(
requestConfiguration
);
const errorMapping: Record<string, ParsableFactory<Parsable>> = {
"4XX": createODataErrorFromDiscriminatorValue,
"5XX": createODataErrorFromDiscriminatorValue,
};
return this.requestAdapter?.sendNoResponseContentAsync(requestInfo, responseHandler, errorMapping) ?? Promise.reject(new Error('http core is null'));
}
|
microsoftgraph/msgraph-sdk-typescript
|
src/drives/item/items/item/subscriptions/item/subscriptionItemRequestBuilder.ts
|
TypeScript
|
MethodDeclaration
|
/**
* The set of subscriptions on the item. Only supported on the root of a drive.
* @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
* @param responseHandler Response handler to use in place of the default response handling provided by the core service
* @returns a Promise of Subscription
*/
public get(requestConfiguration?: SubscriptionItemRequestBuilderGetRequestConfiguration | undefined, responseHandler?: ResponseHandler | undefined) : Promise<Subscription | undefined> {
const requestInfo = this.createGetRequestInformation(
requestConfiguration
);
const errorMapping: Record<string, ParsableFactory<Parsable>> = {
"4XX": createODataErrorFromDiscriminatorValue,
"5XX": createODataErrorFromDiscriminatorValue,
};
return this.requestAdapter?.sendAsync<Subscription>(requestInfo, createSubscriptionFromDiscriminatorValue, responseHandler, errorMapping) ?? Promise.reject(new Error('http core is null'));
}
|
microsoftgraph/msgraph-sdk-typescript
|
src/drives/item/items/item/subscriptions/item/subscriptionItemRequestBuilder.ts
|
TypeScript
|
MethodDeclaration
|
/**
* Update the navigation property subscriptions in drives
* @param body
* @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
* @param responseHandler Response handler to use in place of the default response handling provided by the core service
*/
public patch(body: Subscription | undefined, requestConfiguration?: SubscriptionItemRequestBuilderPatchRequestConfiguration | undefined, responseHandler?: ResponseHandler | undefined) : Promise<void> {
if(!body) throw new Error("body cannot be undefined");
const requestInfo = this.createPatchRequestInformation(
body, requestConfiguration
);
const errorMapping: Record<string, ParsableFactory<Parsable>> = {
"4XX": createODataErrorFromDiscriminatorValue,
"5XX": createODataErrorFromDiscriminatorValue,
};
return this.requestAdapter?.sendNoResponseContentAsync(requestInfo, responseHandler, errorMapping) ?? Promise.reject(new Error('http core is null'));
}
|
microsoftgraph/msgraph-sdk-typescript
|
src/drives/item/items/item/subscriptions/item/subscriptionItemRequestBuilder.ts
|
TypeScript
|
FunctionDeclaration
|
/**
* connects to the nest.land api and returns a url for package installation.
* @param {string} pkgName - package name.
* @param {string} version - specific version of the package.
* @return {string} package url.
*/
export async function nestPackageUrl(
pkgName: string,
version: string
): Promise<string> {
if (STD.includes(pkgName)) {
return needProxy(pkgName)
? Proxy(pkgName)
: `https://x.nest.land/std@${version}/${pkgName}/mod.ts`;
}
else {
const response = (await fetch(
`https://x.nest.land/api/package/${pkgName}/${version}`,
{
method: "GET",
headers: {
Accept: "*/*",
"Accept-Encoding": "gzip, deflate, br",
Connection: "keep-alive",
},
}
).catch((_) => offLine())) as Response;
const data: NestResponse = await response.json();
return data.prefix + data.entry;
}
}
|
jajaperson/Trex
|
handlers/handle_third_party_package.ts
|
TypeScript
|
FunctionDeclaration
|
/**
* download all dependencies and install packages from nest.land.
* @param {string} url - the url of the package to install.
* @return {void} void
*/
export async function cacheNestpackage(url: string): Promise<void> {
const process = Deno.run({
cmd: ["deno", "install", "-f", "-n", "trex_Cache_Map", "--unstable", url],
});
if (!(await process.status()).success) {
process.close();
ErrorInstalling();
}
process.close();
}
|
jajaperson/Trex
|
handlers/handle_third_party_package.ts
|
TypeScript
|
FunctionDeclaration
|
/**
* generates the url for packages that are installed from a repository.
* @param {string} repoInfo - repository information { user/repo/path_file }
* @param {string} pkgName - the name of the package to be saved in the import map file, by default use repository name.
* @return {string} url package.
*/
export function pkgRepo(repoInfo: string, pkgName?: string): string[] {
const [user, repo, ...path] = repoInfo.split("/");
return [
pkgName ? pkgName : repo,
`https://denopkg.com/${user}/${repo}/${path.join("/")}${
path.length ? "" : "mod.ts"
}`,
];
}
|
jajaperson/Trex
|
handlers/handle_third_party_package.ts
|
TypeScript
|
ArrowFunction
|
(_) => offLine()
|
jajaperson/Trex
|
handlers/handle_third_party_package.ts
|
TypeScript
|
ArrowFunction
|
async (_parent, _args, ctx) => ctx.user !== null
|
link2cory/portfolio-backend
|
src/schema/permissions.ts
|
TypeScript
|
ArrowFunction
|
async (_parent, { where }, { prisma, user }) => {
// get the user based on the resource in question
const { userId: resourceOwnerId } = await prisma.bio.findOne({
where,
select: { userId: true },
});
// is the user the same as the one provided by context?
return resourceOwnerId === user.id;
}
|
link2cory/portfolio-backend
|
src/schema/permissions.ts
|
TypeScript
|
ArrowFunction
|
// where.id is guarenteed to exist on updateOneBio
async (_parent, { where }, { prisma, user }) => {
// get the resource owner
// is nested destructuring with an alias hard to read?
const {
profile: { userId: resourceOwnerId },
} = await prisma.job.findOne({
where,
select: {
profile: { select: { userId: true } },
},
});
return resourceOwnerId === user.id;
}
|
link2cory/portfolio-backend
|
src/schema/permissions.ts
|
TypeScript
|
ArrowFunction
|
() => {
test('request user', () => {
const action = actions.user.request({
name: 'rssviana',
});
const state = reducer(INITIAL_STATE, action);
expect({ ...state, updatedOn: 0 }).toStrictEqual(
{
...INITIAL_STATE,
loading: true,
success: false,
error: false,
messages: [],
}
)
})
test('success user response', () => {
const fakeRESP = userRESP
// @ts-ignore
const action = actions.user.success(fakeRESP)
const state = reducer(INITIAL_STATE, action);
expect({ ...state, updatedOn: 0 }).toStrictEqual({
...INITIAL_STATE,
data: [ fakeRESP ],
loading: false,
success: true,
error: false,
messages: [],
});
})
test('failure user response', () => {
const action = actions.user.failure(['error test']);
const state = reducer(INITIAL_STATE, action);
expect({ ...state, updatedOn: 0 }).toStrictEqual({
...INITIAL_STATE,
loading: false,
success: false,
error: true,
messages: ['error test'],
});
});
}
|
rssviana/foribus-oraculi
|
src/store/user/reducer.test.ts
|
TypeScript
|
ArrowFunction
|
() => {
const action = actions.user.request({
name: 'rssviana',
});
const state = reducer(INITIAL_STATE, action);
expect({ ...state, updatedOn: 0 }).toStrictEqual(
{
...INITIAL_STATE,
loading: true,
success: false,
error: false,
messages: [],
}
)
}
|
rssviana/foribus-oraculi
|
src/store/user/reducer.test.ts
|
TypeScript
|
ArrowFunction
|
() => {
const fakeRESP = userRESP
// @ts-ignore
const action = actions.user.success(fakeRESP)
const state = reducer(INITIAL_STATE, action);
expect({ ...state, updatedOn: 0 }).toStrictEqual({
...INITIAL_STATE,
data: [ fakeRESP ],
loading: false,
success: true,
error: false,
messages: [],
});
}
|
rssviana/foribus-oraculi
|
src/store/user/reducer.test.ts
|
TypeScript
|
ArrowFunction
|
() => {
const action = actions.user.failure(['error test']);
const state = reducer(INITIAL_STATE, action);
expect({ ...state, updatedOn: 0 }).toStrictEqual({
...INITIAL_STATE,
loading: false,
success: false,
error: true,
messages: ['error test'],
});
}
|
rssviana/foribus-oraculi
|
src/store/user/reducer.test.ts
|
TypeScript
|
ArrowFunction
|
() => {
it("should be empty object if no params given", () => {
const params: AttributeListUrlFilters = {};
const filterVariables = getFilterVariables(params);
expect(getExistingKeys(filterVariables)).toHaveLength(0);
});
it("should not be empty object if params given", () => {
const params: AttributeListUrlFilters = {
isVariantOnly: true.toString(),
};
const filterVariables = getFilterVariables(params);
expect(getExistingKeys(filterVariables)).toHaveLength(1);
});
}
|
DustinBracy/saleor-dashboard
|
src/attributes/views/AttributeList/filters.test.ts
|
TypeScript
|
ArrowFunction
|
() => {
const params: AttributeListUrlFilters = {};
const filterVariables = getFilterVariables(params);
expect(getExistingKeys(filterVariables)).toHaveLength(0);
}
|
DustinBracy/saleor-dashboard
|
src/attributes/views/AttributeList/filters.test.ts
|
TypeScript
|
ArrowFunction
|
() => {
const params: AttributeListUrlFilters = {
isVariantOnly: true.toString(),
};
const filterVariables = getFilterVariables(params);
expect(getExistingKeys(filterVariables)).toHaveLength(1);
}
|
DustinBracy/saleor-dashboard
|
src/attributes/views/AttributeList/filters.test.ts
|
TypeScript
|
ArrowFunction
|
() => {
const intl = createIntl(config);
const filters = createFilterStructure(intl, {
filterableInStorefront: {
active: false,
value: true,
},
isVariantOnly: {
active: false,
value: true,
},
valueRequired: {
active: false,
value: true,
},
visibleInStorefront: {
active: false,
value: true,
},
});
it("should be empty if no active filters", () => {
const filterQueryParams = getFilterQueryParams(
filters,
getFilterQueryParam,
);
expect(getExistingKeys(filterQueryParams)).toHaveLength(0);
});
it("should not be empty if active filters are present", () => {
const filterQueryParams = getFilterQueryParams(
setFilterOptsStatus(filters, true),
getFilterQueryParam,
);
expect(filterQueryParams).toMatchSnapshot();
expect(stringifyQs(filterQueryParams)).toMatchSnapshot();
});
}
|
DustinBracy/saleor-dashboard
|
src/attributes/views/AttributeList/filters.test.ts
|
TypeScript
|
ArrowFunction
|
() => {
const filterQueryParams = getFilterQueryParams(
filters,
getFilterQueryParam,
);
expect(getExistingKeys(filterQueryParams)).toHaveLength(0);
}
|
DustinBracy/saleor-dashboard
|
src/attributes/views/AttributeList/filters.test.ts
|
TypeScript
|
ArrowFunction
|
() => {
const filterQueryParams = getFilterQueryParams(
setFilterOptsStatus(filters, true),
getFilterQueryParam,
);
expect(filterQueryParams).toMatchSnapshot();
expect(stringifyQs(filterQueryParams)).toMatchSnapshot();
}
|
DustinBracy/saleor-dashboard
|
src/attributes/views/AttributeList/filters.test.ts
|
TypeScript
|
ArrowFunction
|
({
value,
min,
max,
onChange,
step,
markers,
formatValue,
}) => {
const { getRailProps, getTrackProps, getHandleProps, getMarkerProps } = useSlider({
value,
min,
max,
onChange,
step,
formatValue,
})
return (
<SliderContainer>
<SliderRail {...getRailProps()} />
<SliderTrack {...getTrackProps()} />
{markers?.map((marker)
|
strvcom/react-sliders
|
examples/with-formik/components/Slider.tsx
|
TypeScript
|
InterfaceDeclaration
|
export interface ISliderProps {
value: number
min: number
max: number
onChange: (value: number) => void
step?: number
markers?: IRangeMarker[]
formatValue?: (value: number) => string
}
|
strvcom/react-sliders
|
examples/with-formik/components/Slider.tsx
|
TypeScript
|
ArrowFunction
|
(t) => {
t.plan(1);
// Write test file
const targetFile = fileSync();
writeFileSync(targetFile.name, testContentsEmpty, 'utf8');
transform(targetFile.name, targetFile.name, blocks(startPattern, endPattern, id()))
.then((tfn: string) => {
const result = readFileSync(tfn, 'utf8');
const expected = testContentsEmpty;
t.is(result, expected);
});
}
|
jmelis/launcher-creator-backend
|
test/template/transformer.blocks.test.ts
|
TypeScript
|
ArrowFunction
|
(tfn: string) => {
const result = readFileSync(tfn, 'utf8');
const expected = testContentsEmpty;
t.is(result, expected);
}
|
jmelis/launcher-creator-backend
|
test/template/transformer.blocks.test.ts
|
TypeScript
|
ArrowFunction
|
(t) => {
t.plan(1);
// Write test file
const targetFile = fileSync();
writeFileSync(targetFile.name, testContentsWithEntries, 'utf8');
transform(targetFile.name, targetFile.name, blocks(startPattern, endPattern, id()))
.then((tfn: string) => {
const result = readFileSync(tfn, 'utf8');
const expected = testContentsWithEntries;
t.is(result, expected);
});
}
|
jmelis/launcher-creator-backend
|
test/template/transformer.blocks.test.ts
|
TypeScript
|
ArrowFunction
|
(tfn: string) => {
const result = readFileSync(tfn, 'utf8');
const expected = testContentsWithEntries;
t.is(result, expected);
}
|
jmelis/launcher-creator-backend
|
test/template/transformer.blocks.test.ts
|
TypeScript
|
ArrowFunction
|
(t) => {
t.plan(1);
// Write test file
const targetFile = fileSync();
writeFileSync(targetFile.name, testContentsEmpty, 'utf8');
transform(targetFile.name, targetFile.name, blocks(startPattern, endPattern, insertAtEnd(insertedEntry)))
.then((tfn: string) => {
const result = readFileSync(tfn, 'utf8');
const expected = resultInsertAtEndEmptySingle;
t.is(result, expected);
});
}
|
jmelis/launcher-creator-backend
|
test/template/transformer.blocks.test.ts
|
TypeScript
|
ArrowFunction
|
(tfn: string) => {
const result = readFileSync(tfn, 'utf8');
const expected = resultInsertAtEndEmptySingle;
t.is(result, expected);
}
|
jmelis/launcher-creator-backend
|
test/template/transformer.blocks.test.ts
|
TypeScript
|
ArrowFunction
|
(t) => {
t.plan(1);
// Write test file
const targetFile = fileSync();
writeFileSync(targetFile.name, testContentsEmpty, 'utf8');
transform(targetFile.name, targetFile.name, blocks(startPattern, endPattern, insertAtEnd(insertedEntryWithComma)))
.then((tfn: string) => {
const result = readFileSync(tfn, 'utf8');
const expected = resultInsertAtEndEmptySingle;
t.is(result, expected);
});
}
|
jmelis/launcher-creator-backend
|
test/template/transformer.blocks.test.ts
|
TypeScript
|
ArrowFunction
|
(t) => {
t.plan(1);
// Write test file
const targetFile = fileSync();
writeFileSync(targetFile.name, testContentsEmpty, 'utf8');
transform(targetFile.name, targetFile.name, blocks(startPattern, endPattern, insertAtEnd(insertedEntries)))
.then((tfn: string) => {
const result = readFileSync(tfn, 'utf8');
const expected = resultInsertAtEndEmptyMulti;
t.is(result, expected);
});
}
|
jmelis/launcher-creator-backend
|
test/template/transformer.blocks.test.ts
|
TypeScript
|
ArrowFunction
|
(tfn: string) => {
const result = readFileSync(tfn, 'utf8');
const expected = resultInsertAtEndEmptyMulti;
t.is(result, expected);
}
|
jmelis/launcher-creator-backend
|
test/template/transformer.blocks.test.ts
|
TypeScript
|
ArrowFunction
|
(t) => {
t.plan(1);
// Write test file
const targetFile = fileSync();
writeFileSync(targetFile.name, testContentsEmpty, 'utf8');
transform(targetFile.name, targetFile.name, blocks(startPattern, endPattern, insertAtEnd(insertedEntriesWithCommas)))
.then((tfn: string) => {
const result = readFileSync(tfn, 'utf8');
const expected = resultInsertAtEndEmptyMulti;
t.is(result, expected);
});
}
|
jmelis/launcher-creator-backend
|
test/template/transformer.blocks.test.ts
|
TypeScript
|
ArrowFunction
|
(t) => {
t.plan(1);
// Write test file
const targetFile = fileSync();
writeFileSync(targetFile.name, testContentsWithEntries, 'utf8');
transform(targetFile.name, targetFile.name, blocks(startPattern, endPattern, insertAtEnd(insertedEntry)))
.then((tfn: string) => {
const result = readFileSync(tfn, 'utf8');
const expected = resultInsertAtEndWithEntriesSingle;
t.is(result, expected);
});
}
|
jmelis/launcher-creator-backend
|
test/template/transformer.blocks.test.ts
|
TypeScript
|
ArrowFunction
|
(tfn: string) => {
const result = readFileSync(tfn, 'utf8');
const expected = resultInsertAtEndWithEntriesSingle;
t.is(result, expected);
}
|
jmelis/launcher-creator-backend
|
test/template/transformer.blocks.test.ts
|
TypeScript
|
ArrowFunction
|
(t) => {
t.plan(1);
// Write test file
const targetFile = fileSync();
writeFileSync(targetFile.name, testContentsWithEntries, 'utf8');
transform(targetFile.name, targetFile.name, blocks(startPattern, endPattern, insertAtEnd(insertedEntryWithComma)))
.then((tfn: string) => {
const result = readFileSync(tfn, 'utf8');
const expected = resultInsertAtEndWithEntriesSingle;
t.is(result, expected);
});
}
|
jmelis/launcher-creator-backend
|
test/template/transformer.blocks.test.ts
|
TypeScript
|
ArrowFunction
|
(t) => {
t.plan(1);
// Write test file
const targetFile = fileSync();
writeFileSync(targetFile.name, testContentsWithEntries, 'utf8');
transform(targetFile.name, targetFile.name, blocks(startPattern, endPattern, insertAtEnd(insertedEntries)))
.then((tfn: string) => {
const result = readFileSync(tfn, 'utf8');
const expected = resultInsertAtEndWithEntriesMulti;
t.is(result, expected);
});
}
|
jmelis/launcher-creator-backend
|
test/template/transformer.blocks.test.ts
|
TypeScript
|
ArrowFunction
|
(tfn: string) => {
const result = readFileSync(tfn, 'utf8');
const expected = resultInsertAtEndWithEntriesMulti;
t.is(result, expected);
}
|
jmelis/launcher-creator-backend
|
test/template/transformer.blocks.test.ts
|
TypeScript
|
ArrowFunction
|
(t) => {
t.plan(1);
// Write test file
const targetFile = fileSync();
writeFileSync(targetFile.name, testContentsWithEntries, 'utf8');
transform(targetFile.name, targetFile.name, blocks(startPattern, endPattern, insertAtEnd(insertedEntriesWithCommas)))
.then((tfn: string) => {
const result = readFileSync(tfn, 'utf8');
const expected = resultInsertAtEndWithEntriesMulti;
t.is(result, expected);
});
}
|
jmelis/launcher-creator-backend
|
test/template/transformer.blocks.test.ts
|
TypeScript
|
ArrowFunction
|
(t) => {
t.plan(1);
// Write test file
const targetFile = fileSync();
writeFileSync(targetFile.name, testContentsEmpty, 'utf8');
transform(targetFile.name, targetFile.name, blocks(startPattern, endPattern, insertAtStart(insertedEntry)))
.then((tfn: string) => {
const result = readFileSync(tfn, 'utf8');
const expected = resultInsertAtStartEmptySingle;
t.is(result, expected);
});
}
|
jmelis/launcher-creator-backend
|
test/template/transformer.blocks.test.ts
|
TypeScript
|
ArrowFunction
|
(tfn: string) => {
const result = readFileSync(tfn, 'utf8');
const expected = resultInsertAtStartEmptySingle;
t.is(result, expected);
}
|
jmelis/launcher-creator-backend
|
test/template/transformer.blocks.test.ts
|
TypeScript
|
ArrowFunction
|
(t) => {
t.plan(1);
// Write test file
const targetFile = fileSync();
writeFileSync(targetFile.name, testContentsEmpty, 'utf8');
transform(targetFile.name, targetFile.name, blocks(startPattern, endPattern, insertAtStart(insertedEntryWithComma)))
.then((tfn: string) => {
const result = readFileSync(tfn, 'utf8');
const expected = resultInsertAtStartEmptySingle;
t.is(result, expected);
});
}
|
jmelis/launcher-creator-backend
|
test/template/transformer.blocks.test.ts
|
TypeScript
|
ArrowFunction
|
(t) => {
t.plan(1);
// Write test file
const targetFile = fileSync();
writeFileSync(targetFile.name, testContentsEmpty, 'utf8');
transform(targetFile.name, targetFile.name, blocks(startPattern, endPattern, insertAtStart(insertedEntries)))
.then((tfn: string) => {
const result = readFileSync(tfn, 'utf8');
const expected = resultInsertAtStartEmptyMulti;
t.is(result, expected);
});
}
|
jmelis/launcher-creator-backend
|
test/template/transformer.blocks.test.ts
|
TypeScript
|
ArrowFunction
|
(tfn: string) => {
const result = readFileSync(tfn, 'utf8');
const expected = resultInsertAtStartEmptyMulti;
t.is(result, expected);
}
|
jmelis/launcher-creator-backend
|
test/template/transformer.blocks.test.ts
|
TypeScript
|
ArrowFunction
|
(t) => {
t.plan(1);
// Write test file
const targetFile = fileSync();
writeFileSync(targetFile.name, testContentsEmpty, 'utf8');
transform(targetFile.name, targetFile.name, blocks(startPattern, endPattern, insertAtStart(insertedEntriesWithCommas)))
.then((tfn: string) => {
const result = readFileSync(tfn, 'utf8');
const expected = resultInsertAtStartEmptyMulti;
t.is(result, expected);
});
}
|
jmelis/launcher-creator-backend
|
test/template/transformer.blocks.test.ts
|
TypeScript
|
ArrowFunction
|
(t) => {
t.plan(1);
// Write test file
const targetFile = fileSync();
writeFileSync(targetFile.name, testContentsWithEntries, 'utf8');
transform(targetFile.name, targetFile.name, blocks(startPattern, endPattern, insertAtStart(insertedEntry)))
.then((tfn: string) => {
const result = readFileSync(tfn, 'utf8');
const expected = resultInsertAtStartWithEntriesSingle;
t.is(result, expected);
});
}
|
jmelis/launcher-creator-backend
|
test/template/transformer.blocks.test.ts
|
TypeScript
|
ArrowFunction
|
(tfn: string) => {
const result = readFileSync(tfn, 'utf8');
const expected = resultInsertAtStartWithEntriesSingle;
t.is(result, expected);
}
|
jmelis/launcher-creator-backend
|
test/template/transformer.blocks.test.ts
|
TypeScript
|
ArrowFunction
|
(t) => {
t.plan(1);
// Write test file
const targetFile = fileSync();
writeFileSync(targetFile.name, testContentsWithEntries, 'utf8');
transform(targetFile.name, targetFile.name, blocks(startPattern, endPattern, insertAtStart(insertedEntryWithComma)))
.then((tfn: string) => {
const result = readFileSync(tfn, 'utf8');
const expected = resultInsertAtStartWithEntriesSingle;
t.is(result, expected);
});
}
|
jmelis/launcher-creator-backend
|
test/template/transformer.blocks.test.ts
|
TypeScript
|
ArrowFunction
|
(t) => {
t.plan(1);
// Write test file
const targetFile = fileSync();
writeFileSync(targetFile.name, testContentsWithEntries, 'utf8');
transform(targetFile.name, targetFile.name, blocks(startPattern, endPattern, insertAtStart(insertedEntries)))
.then((tfn: string) => {
const result = readFileSync(tfn, 'utf8');
const expected = resultInsertAtStartWithEntriesMulti;
t.is(result, expected);
});
}
|
jmelis/launcher-creator-backend
|
test/template/transformer.blocks.test.ts
|
TypeScript
|
ArrowFunction
|
(tfn: string) => {
const result = readFileSync(tfn, 'utf8');
const expected = resultInsertAtStartWithEntriesMulti;
t.is(result, expected);
}
|
jmelis/launcher-creator-backend
|
test/template/transformer.blocks.test.ts
|
TypeScript
|
ArrowFunction
|
(t) => {
t.plan(1);
// Write test file
const targetFile = fileSync();
writeFileSync(targetFile.name, testContentsWithEntries, 'utf8');
transform(targetFile.name, targetFile.name, blocks(startPattern, endPattern, insertAtStart(insertedEntriesWithCommas)))
.then((tfn: string) => {
const result = readFileSync(tfn, 'utf8');
const expected = resultInsertAtStartWithEntriesMulti;
t.is(result, expected);
});
}
|
jmelis/launcher-creator-backend
|
test/template/transformer.blocks.test.ts
|
TypeScript
|
ArrowFunction
|
() => {
this.setState({
visible: !this.state.visible,
})
}
|
Clouddou2016/Imagine
|
modules/renderer/components/Collapse.tsx
|
TypeScript
|
ClassDeclaration
|
export default class Collapse extends PureComponent<ICollapseProps, ICollapseState> {
constructor(props: ICollapseProps) {
super(props)
this.state = {
visible: props.initialVisible || false,
}
}
handleClick = () => {
this.setState({
visible: !this.state.visible,
})
}
render() {
return (
<div className={classnames('collapse', {
'-hide': !this.state.visible,
})}
|
Clouddou2016/Imagine
|
modules/renderer/components/Collapse.tsx
|
TypeScript
|
InterfaceDeclaration
|
interface ICollapseProps {
title: string
initialVisible?: boolean
}
|
Clouddou2016/Imagine
|
modules/renderer/components/Collapse.tsx
|
TypeScript
|
InterfaceDeclaration
|
interface ICollapseState {
visible: boolean
}
|
Clouddou2016/Imagine
|
modules/renderer/components/Collapse.tsx
|
TypeScript
|
MethodDeclaration
|
render() {
return (
<div className={classnames('collapse', {
'-hide': !this.state.visible,
})}
|
Clouddou2016/Imagine
|
modules/renderer/components/Collapse.tsx
|
TypeScript
|
MethodDeclaration
|
classnames('collapse', {
'-hide': !this
|
Clouddou2016/Imagine
|
modules/renderer/components/Collapse.tsx
|
TypeScript
|
ClassDeclaration
|
/**
* @private
* @class module:azure-iot-device.BlobUploadResult
* @classdesc Result object used by the {@link module:azure-iot-device.blobUpload.BlobUploader} class to describe a successful upload to a blob.
*
* @params isSuccess {Boolean} Indicates whether the upload was successful or failed
* @params statusCode {Number} Status code returned by the blob storage upload operation
* @params statusDescription {String} String containing useful information pertaining to the result of the blob upload.
*
* @augments {Error}
*/
export declare class BlobUploadResult {
isSuccess: boolean;
statusCode: number;
statusDescription: string;
constructor(isSuccess: boolean, statusCode: number, statusDescription: string);
/**
* @method module:azure-iot-device.BlobUploadResult#fromAzureStorageCallbackArgs
* @description The `fromAzureStorageCallbackArgs` static method creates a new BlobUploadResult instance from the arguments passed to the callback of the azure storage upload method.
*
* @param {Object} err The error object that is passed to the callback.
* @param {Object} body The body of the HTTP response.
* @param {Object} response The HTTP response object.
*
* @throws {ReferenceException} If err is null and either body or response are also falsy.
*/
static fromAzureStorageCallbackArgs(err?: Error, body?: any, response?: BlobResponse): BlobUploadResult;
}
|
SecureColdChain/Wipro-Ltd-ColdChain
|
Code/GatewayCode/OfflineAppSourceCode/node_modules/azure-iot-device/lib/blob_upload/blob_upload_result.d.ts
|
TypeScript
|
MethodDeclaration
|
/**
* @method module:azure-iot-device.BlobUploadResult#fromAzureStorageCallbackArgs
* @description The `fromAzureStorageCallbackArgs` static method creates a new BlobUploadResult instance from the arguments passed to the callback of the azure storage upload method.
*
* @param {Object} err The error object that is passed to the callback.
* @param {Object} body The body of the HTTP response.
* @param {Object} response The HTTP response object.
*
* @throws {ReferenceException} If err is null and either body or response are also falsy.
*/
static fromAzureStorageCallbackArgs(err?: Error, body?: any, response?: BlobResponse): BlobUploadResult;
|
SecureColdChain/Wipro-Ltd-ColdChain
|
Code/GatewayCode/OfflineAppSourceCode/node_modules/azure-iot-device/lib/blob_upload/blob_upload_result.d.ts
|
TypeScript
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.