@pnp/queryable
Advanced tools
Comparing version 3.0.0-v3nightly.20211001 to 3.0.0-v3nightly.20211002
{ | ||
"name": "@pnp/queryable", | ||
"version": "3.0.0-v3nightly.20211001", | ||
"version": "3.0.0-v3nightly.20211002", | ||
"description": "pnp - provides shared odata functionality and base classes", | ||
@@ -9,3 +9,3 @@ "main": "./index.js", | ||
"tslib": "2.1.0", | ||
"@pnp/core": "3.0.0-v3nightly.20211001" | ||
"@pnp/core": "3.0.0-v3nightly.20211002" | ||
}, | ||
@@ -12,0 +12,0 @@ "author": { |
import { IQueryableInternal } from "./queryable.js"; | ||
export declare function queryableFactory<InstanceType extends IQueryableInternal>(constructor: { | ||
new (init: IQueryableInternal<any> | string, path?: string): InstanceType; | ||
}): (init: IQueryableInternal<any> | string, path?: string) => InstanceType; | ||
new (init: string | IQueryableInternal<any> | [IQueryableInternal<any>, string], path?: string): InstanceType; | ||
}): (init: string | IQueryableInternal<any> | [IQueryableInternal<any>, string], path?: string) => InstanceType; | ||
//# sourceMappingURL=queryable-factory.d.ts.map |
@@ -1,2 +0,2 @@ | ||
import { Timeline } from "@pnp/core"; | ||
import { Timeline, TimelinePipe } from "@pnp/core"; | ||
import { IInvokable } from "./invokable.js"; | ||
@@ -22,3 +22,3 @@ export declare type QueryablePreObserver = (this: IQueryableInternal, url: string, init: RequestInit, result: any) => Promise<[string, RequestInit, any]>; | ||
protected InternalRejectEvent: symbol; | ||
constructor(init: Queryable<any> | string, path?: string); | ||
constructor(init: Queryable<any> | string | [Queryable<any>, string], path?: string); | ||
/** | ||
@@ -55,3 +55,3 @@ * Directly concatenates the supplied string to the current url, not normalizing "/" chars | ||
<T = R>(this: IQueryableInternal, init?: RequestInit): Promise<T>; | ||
using(behavior: (intance: Timeline<any>) => Timeline<any>): this; | ||
using(...behaviors: TimelinePipe[]): this; | ||
toRequestUrl(): string; | ||
@@ -58,0 +58,0 @@ toUrl(): string; |
import { __decorate } from "tslib"; | ||
import { combine, getGUID, Timeline, asyncReduce, broadcast, request, extendable } from "@pnp/core"; | ||
import { combine, getGUID, Timeline, asyncReduce, broadcast, request, extendable, isArray } from "@pnp/core"; | ||
import { invokable } from "./invokable.js"; | ||
@@ -23,6 +23,15 @@ const DefaultMoments = { | ||
} | ||
else if (isArray(init)) { | ||
if (init.length !== 2) { | ||
throw Error("When using the tuple first param only two arguments are supported"); | ||
} | ||
const q = init[0]; | ||
const _url = init[1]; | ||
url = combine(_url, path); | ||
observers = q.observers; | ||
} | ||
else { | ||
const { _url } = init; | ||
const { _url, observers: _observers } = init; | ||
url = combine(_url, path); | ||
observers = init.observers; | ||
observers = _observers; | ||
} | ||
@@ -29,0 +38,0 @@ super(DefaultMoments, observers); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
73329
835
+ Added@pnp/core@3.0.0-v3nightly.20211002(transitive)
- Removed@pnp/core@3.0.0-v3nightly.20211001(transitive)