type stringclasses 7
values | content stringlengths 4 9.55k | repo stringlengths 7 96 | path stringlengths 4 178 | language stringclasses 1
value |
|---|---|---|---|---|
MethodDeclaration |
async delete(where?: Where, options?: Options): Promise<number> {
return await this.targetRepository.deleteAll(
constrainWhere(where, this.constraint),
options,
);
} | sybarite/loopback-next | packages/repository/src/repositories/relation.repository.ts | TypeScript |
MethodDeclaration |
async patch(
dataObject: Partial<TargetEntity>,
where?: Where,
options?: Options,
): Promise<number> {
return await this.targetRepository.updateAll(
constrainDataObject(dataObject, this.constraint),
constrainWhere(where, this.constraint),
options,
);
} | sybarite/loopback-next | packages/repository/src/repositories/relation.repository.ts | TypeScript |
ArrowFunction |
(num: number) => Math.round(num) | aliyun/alibabacloud-console-chart | packages/console-line-chart/demo/YAxisMin.tsx | TypeScript |
ArrowFunction |
() => (
<ConsoleLineChart data={data} | aliyun/alibabacloud-console-chart | packages/console-line-chart/demo/YAxisMin.tsx | TypeScript |
ArrowFunction |
(): Keypair => {
return new Keypair(this.privKey.copy())
} | therealyingtong/maci | domainobjs/ts/index.ts | TypeScript |
ArrowFunction |
(): PrivKey => {
return new PrivKey(bigInt(this.rawPrivKey.toString()))
} | therealyingtong/maci | domainobjs/ts/index.ts | TypeScript |
ArrowFunction |
() => {
return formatPrivKeyForBabyJub(this.rawPrivKey).toString()
} | therealyingtong/maci | domainobjs/ts/index.ts | TypeScript |
ArrowFunction |
(): PubKey => {
return new PubKey([
bigInt(this.rawPubKey[0].toString()),
bigInt(this.rawPubKey[1].toString()),
])
} | therealyingtong/maci | domainobjs/ts/index.ts | TypeScript |
ArrowFunction |
() => {
return {
x: this.rawPubKey[0].toString(),
y: this.rawPubKey[1].toString(),
}
} | therealyingtong/maci | domainobjs/ts/index.ts | TypeScript |
ArrowFunction |
() => {
return this.rawPubKey.map((x) => x.toString())
} | therealyingtong/maci | domainobjs/ts/index.ts | TypeScript |
ArrowFunction |
(): SnarkBigInt[] => {
return [
this.rawPubKey[0],
this.rawPubKey[1],
]
} | therealyingtong/maci | domainobjs/ts/index.ts | TypeScript |
ArrowFunction |
(): SnarkBigInt[] => {
return [
this.iv,
...this.data,
]
} | therealyingtong/maci | domainobjs/ts/index.ts | TypeScript |
ArrowFunction |
() => {
return {
iv: this.iv.toString(),
data: this.data.map((x: SnarkBigInt) => x.toString()),
}
} | therealyingtong/maci | domainobjs/ts/index.ts | TypeScript |
ArrowFunction |
(x: SnarkBigInt) => x.toString() | therealyingtong/maci | domainobjs/ts/index.ts | TypeScript |
ArrowFunction |
(): SnarkBigInt[] => {
return this.asArray()
} | therealyingtong/maci | domainobjs/ts/index.ts | TypeScript |
ArrowFunction |
(): SnarkBigInt => {
return hash(this.asArray())
} | therealyingtong/maci | domainobjs/ts/index.ts | TypeScript |
ArrowFunction |
(): Message => {
return new Message(
bigInt(this.iv.toString()),
this.data.map((x: SnarkBigInt) => bigInt(x.toString())),
)
} | therealyingtong/maci | domainobjs/ts/index.ts | TypeScript |
ArrowFunction |
(x: SnarkBigInt) => bigInt(x.toString()) | therealyingtong/maci | domainobjs/ts/index.ts | TypeScript |
ArrowFunction |
(): SnarkBigInt[] => {
return [
...this.pubKey.asArray(),
this.voteOptionTreeRoot,
this.voiceCreditBalance,
this.nonce,
]
} | therealyingtong/maci | domainobjs/ts/index.ts | TypeScript |
ArrowFunction |
(): Command => {
return new Command(
bigInt(this.stateIndex.toString()),
this.newPubKey.copy(),
bigInt(this.voteOptionIndex.toString()),
bigInt(this.newVoteWeight.toString()),
bigInt(this.nonce.toString()),
bigInt(this.salt.toString()),
... | therealyingtong/maci | domainobjs/ts/index.ts | TypeScript |
ArrowFunction |
(): SnarkBigInt[] => {
return [
this.stateIndex,
...this.newPubKey.asArray(),
this.voteOptionIndex,
this.newVoteWeight,
this.nonce,
this.salt,
]
} | therealyingtong/maci | domainobjs/ts/index.ts | TypeScript |
ArrowFunction |
(command: Command): boolean => {
return this.stateIndex == command.stateIndex &&
this.newPubKey[0] == command.newPubKey[0] &&
this.newPubKey[1] == command.newPubKey[1] &&
this.voteOptionIndex == command.voteOptionIndex &&
this.newVoteWeight == command.newVoteWei... | therealyingtong/maci | domainobjs/ts/index.ts | TypeScript |
ArrowFunction |
(
privKey: PrivKey,
): Signature => {
return sign(privKey.rawPrivKey, hash(this.asArray()))
} | therealyingtong/maci | domainobjs/ts/index.ts | TypeScript |
ArrowFunction |
(
signature: Signature,
pubKey: PubKey,
): boolean => {
return verifySignature(
hash(this.asArray()),
signature,
pubKey.rawPubKey,
)
} | therealyingtong/maci | domainobjs/ts/index.ts | TypeScript |
ArrowFunction |
(
signature: Signature,
sharedKey: EcdhSharedKey,
): Message => {
const plaintext: Plaintext = [
...this.asArray(),
signature.R8[0],
signature.R8[1],
signature.S,
]
const ciphertext: Ciphertext = encrypt(plaintext, sharedKey)... | therealyingtong/maci | domainobjs/ts/index.ts | TypeScript |
ArrowFunction |
(
message: Message,
sharedKey: EcdhSharedKey,
) => {
const decrypted = decrypt(message, sharedKey)
const command = new Command(
decrypted[0],
new PubKey([decrypted[1], decrypted[2]]),
decrypted[3],
decrypted[4],
decrypted... | therealyingtong/maci | domainobjs/ts/index.ts | TypeScript |
ClassDeclaration |
class Keypair implements Keypair {
public privKey: PrivKey
public pubKey: PubKey
constructor (
privKey?: PrivKey,
) {
if (privKey) {
this.privKey = privKey
this.pubKey = new PubKey(genPubKey(privKey.rawPrivKey))
} else {
const rawKeyPair = ge... | therealyingtong/maci | domainobjs/ts/index.ts | TypeScript |
ClassDeclaration |
class PrivKey {
public rawPrivKey: RawPrivKey
constructor (rawPrivKey: RawPrivKey) {
this.rawPrivKey = rawPrivKey
}
public copy = (): PrivKey => {
return new PrivKey(bigInt(this.rawPrivKey.toString()))
}
public asCircuitInputs = () => {
return formatPrivKeyForBabyJub(... | therealyingtong/maci | domainobjs/ts/index.ts | TypeScript |
ClassDeclaration |
class PubKey {
public rawPubKey: RawPubKey
constructor (rawPubKey: RawPubKey) {
assert(rawPubKey.length === 2)
this.rawPubKey = rawPubKey
}
public copy = (): PubKey => {
return new PubKey([
bigInt(this.rawPubKey[0].toString()),
bigInt(this.rawPubKey[1]... | therealyingtong/maci | domainobjs/ts/index.ts | TypeScript |
ClassDeclaration | /*
* An encrypted command and signature.
*/
class Message {
public iv: SnarkBigInt
public data: SnarkBigInt[]
constructor (
iv: SnarkBigInt,
data: SnarkBigInt[],
) {
assert(data.length === 10)
this.iv = iv
this.data = data
}
private asArray = (): Snark... | therealyingtong/maci | domainobjs/ts/index.ts | TypeScript |
ClassDeclaration | /*
* A leaf in the state tree, which maps public keys to votes
*/
class StateLeaf implements IStateLeaf {
public pubKey: PubKey
public voteOptionTreeRoot: SnarkBigInt
public voiceCreditBalance: SnarkBigInt
public nonce: SnarkBigInt
constructor (
pubKey: PubKey,
voteOptionTreeRoot:... | therealyingtong/maci | domainobjs/ts/index.ts | TypeScript |
ClassDeclaration | /*
* Unencrypted data whose fields include the user's public key, vote etc.
*/
class Command implements ICommand {
public stateIndex: SnarkBigInt
public newPubKey: PubKey
public voteOptionIndex: SnarkBigInt
public newVoteWeight: SnarkBigInt
public nonce: SnarkBigInt
public salt: SnarkBigInt
... | therealyingtong/maci | domainobjs/ts/index.ts | TypeScript |
InterfaceDeclaration |
interface Keypair {
privKey: RawPrivKey,
pubKey: RawPubKey,
} | therealyingtong/maci | domainobjs/ts/index.ts | TypeScript |
InterfaceDeclaration |
interface IStateLeaf {
pubKey: PubKey;
voteOptionTreeRoot: SnarkBigInt;
voiceCreditBalance: SnarkBigInt;
nonce: SnarkBigInt;
} | therealyingtong/maci | domainobjs/ts/index.ts | TypeScript |
InterfaceDeclaration |
interface VoteOptionTreeLeaf {
votes: SnarkBigInt;
} | therealyingtong/maci | domainobjs/ts/index.ts | TypeScript |
InterfaceDeclaration |
interface ICommand {
stateIndex: SnarkBigInt;
newPubKey: PubKey;
voteOptionIndex: SnarkBigInt;
newVoteWeight: SnarkBigInt;
nonce: SnarkBigInt;
sign: (PrivKey) => Signature;
encrypt: (EcdhSharedKey, Signature) => Message;
} | therealyingtong/maci | domainobjs/ts/index.ts | TypeScript |
MethodDeclaration |
public static genEcdhSharedKey(
privKey: PrivKey,
pubKey: PubKey,
) {
return genEcdhSharedKey(privKey.rawPrivKey, pubKey.rawPubKey)
} | therealyingtong/maci | domainobjs/ts/index.ts | TypeScript |
MethodDeclaration |
public equals(
keypair: Keypair,
): boolean {
const equalPrivKey = this.privKey.rawPrivKey === keypair.privKey.rawPrivKey
const equalPubKey =
this.pubKey.rawPubKey[0] === keypair.pubKey.rawPubKey[0] &&
this.pubKey.rawPubKey[1] === keypair.pubKey.rawPubKey[1]
... | therealyingtong/maci | domainobjs/ts/index.ts | TypeScript |
MethodDeclaration |
public copy(): StateLeaf {
return new StateLeaf(
this.pubKey.copy(),
bigInt(this.voteOptionTreeRoot.toString()),
bigInt(this.voiceCreditBalance.toString()),
bigInt(this.nonce.toString()),
)
} | therealyingtong/maci | domainobjs/ts/index.ts | TypeScript |
MethodDeclaration |
public static genBlankLeaf(
emptyVoteOptionTreeRoot: SnarkBigInt,
): StateLeaf {
return new StateLeaf(
new PubKey([0, 0]),
emptyVoteOptionTreeRoot,
bigInt(0),
bigInt(0),
)
} | therealyingtong/maci | domainobjs/ts/index.ts | TypeScript |
MethodDeclaration |
public static genRandomLeaf() {
return new StateLeaf(
new PubKey([genRandomSalt(), genRandomSalt()]),
genRandomSalt(),
genRandomSalt(),
genRandomSalt(),
)
} | therealyingtong/maci | domainobjs/ts/index.ts | TypeScript |
ArrowFunction |
(data) => data.json() | YiSiWang/G2Plot | examples/radar/basic/demo/grid-axis.ts | TypeScript |
ArrowFunction |
(data) => {
const radarPlot = new Radar('container', {
data,
xField: 'item',
yField: 'score',
meta: {
score: {
alias: '分数',
},
},
xAxis: {
line: null,
tickLine: null,
grid: {
line: {
style: {
l... | YiSiWang/G2Plot | examples/radar/basic/demo/grid-axis.ts | TypeScript |
ArrowFunction |
(error: errors.SpreeSDKError): string => {
let prettyOutput = `Name: ${error.name}\nMessage: ${error.message}`
if (error instanceof errors.BasicSpreeError) {
prettyOutput += `\nSpree summary: ${error.summary}`
if (error instanceof errors.ExpandedSpreeError) {
prettyOutput += `\nSpree validation err... | AaronEscobar1/commerce | packages/spree/src/utils/pretty-print-spree-sdk-errors.ts | TypeScript |
FunctionDeclaration | // 获取时间的数字类型
export function getTimeNum (date) {
const dateNum = !date ? 0 : new Date(date).getTime()
return dateNum
} | fawaikuangtuzs/blog3 | packages/@vuepress-reco/plugin-page/src/node/Classifiable.ts | TypeScript |
FunctionDeclaration | // 比对时间
export function compareDate (a, b) {
const aDateNum = getTimeNum(a.frontmatter.date)
const bDateNum = getTimeNum(b.frontmatter.date)
if (aDateNum === 0 || bDateNum === 0) return 0
return bDateNum - aDateNum
} | fawaikuangtuzs/blog3 | packages/@vuepress-reco/plugin-page/src/node/Classifiable.ts | TypeScript |
ArrowFunction |
(option: PageOptions) => {
if ((option as ClassificationPageOptions).type === 'frontmatter') {
const {
frontmatterKey: key,
pagination,
layout,
} = option as ClassificationPageOptions
this.frontmatterKeys.push(key)
this.classificationData[key] = {
... | fawaikuangtuzs/blog3 | packages/@vuepress-reco/plugin-page/src/node/Classifiable.ts | TypeScript |
ArrowFunction |
(page: Page) => {
page.path = convertToPinyin(decodeURIComponent(page.path))
return page
} | fawaikuangtuzs/blog3 | packages/@vuepress-reco/plugin-page/src/node/Classifiable.ts | TypeScript |
ArrowFunction |
(page: Page) => {
const publishFlag = !(
page?.frontmatter?.home === true
|| page?.frontmatter?.publish === false
|| page?.title === '')
if (autoSetCategory && publishFlag) {
this.setCategory(page)
}
return publishFlag
} | fawaikuangtuzs/blog3 | packages/@vuepress-reco/plugin-page/src/node/Classifiable.ts | TypeScript |
ArrowFunction |
(prev, next) => {
const prevSticky = prev.frontmatter.sticky as number
const nextSticky = next.frontmatter.sticky as number
if (prevSticky && nextSticky) {
return prevSticky == nextSticky ? compareDate(prev, next) : (prevSticky - nextSticky)
} else if (prevSticky && !nextStic... | fawaikuangtuzs/blog3 | packages/@vuepress-reco/plugin-page/src/node/Classifiable.ts | TypeScript |
ArrowFunction |
(page: Page) => {
if (
page?.frontmatter?.home === true ||
page?.frontmatter?.publish === false ||
page?.title === ''
) {
return
}
const classificationKeys = Object.keys(page.frontmatter).filter(
(key: string) => {
return this.frontmatterKeys.... | fawaikuangtuzs/blog3 | packages/@vuepress-reco/plugin-page/src/node/Classifiable.ts | TypeScript |
ArrowFunction |
(key: string) => {
return this.frontmatterKeys.includes(key)
} | fawaikuangtuzs/blog3 | packages/@vuepress-reco/plugin-page/src/node/Classifiable.ts | TypeScript |
ArrowFunction |
(key: FrontmatterKey) => {
const values = page.frontmatter[key] as string[]
if (isEmptyPlainObject(this.classificationData[key].items)) {
this.classificationData[key].items = values.reduce(
(total, current) => {
total[convertToPinyin(current)] = {
pag... | fawaikuangtuzs/blog3 | packages/@vuepress-reco/plugin-page/src/node/Classifiable.ts | TypeScript |
ArrowFunction |
(total, current) => {
total[convertToPinyin(current)] = {
pages: [page],
length: 1,
label: current
}
return total
} | fawaikuangtuzs/blog3 | packages/@vuepress-reco/plugin-page/src/node/Classifiable.ts | TypeScript |
ArrowFunction |
(value: ItemKey) => {
if (!this.classificationData[key].items[convertToPinyin(value)]) {
this.classificationData[key].items[convertToPinyin(value)] = {
pages: [page],
length: 1,
label: value
}
} else {
con... | fawaikuangtuzs/blog3 | packages/@vuepress-reco/plugin-page/src/node/Classifiable.ts | TypeScript |
ArrowFunction |
(key: string) => {
const { items, layout, pagination } = this.classificationData[key]
const valuesOfKey = Object.keys(items)
this.classificationData[key].extendedPages = valuesOfKey.reduce(
(total: Promise<Page>[], value: string) => {
const num = items[convertToPinyin(value)].lengt... | fawaikuangtuzs/blog3 | packages/@vuepress-reco/plugin-page/src/node/Classifiable.ts | TypeScript |
ArrowFunction |
(total: Promise<Page>[], value: string) => {
const num = items[convertToPinyin(value)].length
const pageSize = Math.ceil(num / pagination)
const pages = Array.from({ length: pageSize }).map((item, index) => {
return createPage(this.app, {
path: `/${key}/${conver... | fawaikuangtuzs/blog3 | packages/@vuepress-reco/plugin-page/src/node/Classifiable.ts | TypeScript |
ArrowFunction |
(item, index) => {
return createPage(this.app, {
path: `/${key}/${convertToPinyin(value)}/${index + 1}/`,
frontmatter: { layout },
})
} | fawaikuangtuzs/blog3 | packages/@vuepress-reco/plugin-page/src/node/Classifiable.ts | TypeScript |
ArrowFunction |
(item, index) => {
return createPage(this.app, {
path: `/posts/${index + 1}/`,
frontmatter: { layout: 'Post' },
})
} | fawaikuangtuzs/blog3 | packages/@vuepress-reco/plugin-page/src/node/Classifiable.ts | TypeScript |
ArrowFunction |
(total: Promise<Page>[], option) => {
const classificationPages = this.resolvePageOptions(option)
return [...total, ...classificationPages]
} | fawaikuangtuzs/blog3 | packages/@vuepress-reco/plugin-page/src/node/Classifiable.ts | TypeScript |
ArrowFunction |
(key: string) => {
const { items, pagination } = this.classificationData[key]
const valuesOfKey = Object.keys(items)
valuesOfKey.forEach((value: string) => {
const { length, pages } = items[value]
const pageSize = Math.ceil(length / pagination)
const paginationDataOfValue = ... | fawaikuangtuzs/blog3 | packages/@vuepress-reco/plugin-page/src/node/Classifiable.ts | TypeScript |
ArrowFunction |
(value: string) => {
const { length, pages } = items[value]
const pageSize = Math.ceil(length / pagination)
const paginationDataOfValue = Array.from({
length: pageSize,
}).reduce(
(
total: Record<string, ClassificationPaginationPost>,
current... | fawaikuangtuzs/blog3 | packages/@vuepress-reco/plugin-page/src/node/Classifiable.ts | TypeScript |
ArrowFunction |
(
total: Record<string, ClassificationPaginationPost>,
current,
index
) => {
const currentPage = index + 1
total[`/${key}/${convertToPinyin(value)}/${currentPage}/`] = {
pageSize: pagination,
total: pages.length,
... | fawaikuangtuzs/blog3 | packages/@vuepress-reco/plugin-page/src/node/Classifiable.ts | TypeScript |
MethodDeclaration | // 初始化
init(): void {
this.options.forEach((option: PageOptions) => {
if ((option as ClassificationPageOptions).type === 'frontmatter') {
const {
frontmatterKey: key,
pagination,
layout,
} = option as ClassificationPageOptions
this.frontmatterKeys.push(ke... | fawaikuangtuzs/blog3 | packages/@vuepress-reco/plugin-page/src/node/Classifiable.ts | TypeScript |
MethodDeclaration | // 解析 key-value 对应的数量
resolveKeyValue(): void {
this.app.pages = this.app.pages.map((page: Page) => {
page.path = convertToPinyin(decodeURIComponent(page.path))
return page
})
const { autoSetCategory } = this.app.options.themeConfig
const publishPosts = this.app.pages
.filter((page: P... | fawaikuangtuzs/blog3 | packages/@vuepress-reco/plugin-page/src/node/Classifiable.ts | TypeScript |
MethodDeclaration | // 根据数量转化成 page 信息
resolvePages(): void {
this.frontmatterKeys.forEach((key: string) => {
const { items, layout, pagination } = this.classificationData[key]
const valuesOfKey = Object.keys(items)
this.classificationData[key].extendedPages = valuesOfKey.reduce(
(total: Promise<Page>[], val... | fawaikuangtuzs/blog3 | packages/@vuepress-reco/plugin-page/src/node/Classifiable.ts | TypeScript |
MethodDeclaration | // 解析 page 配置
private resolvePageOptions(option: PageOptions): Promise<Page>[] {
if ((option as ClassificationPageOptions).type === 'frontmatter') {
return this.classificationData[
(option as ClassificationPageOptions).frontmatterKey
].extendedPages
} else {
const { path, layout } = op... | fawaikuangtuzs/blog3 | packages/@vuepress-reco/plugin-page/src/node/Classifiable.ts | TypeScript |
MethodDeclaration | // 设置类别
private setCategory(page) {
const blogCategray = ((page.filePath || '') as string).match(/.+\/blogs\/(.+)\/.+\.md$/)
if (blogCategray) page.frontmatter.categories = [blogCategray[1]]
const docCategray = ((page.filePath || '') as string).match(/.+\/docs\/(.+)\/.+\.md$/)
if (docCategray) page.fro... | fawaikuangtuzs/blog3 | packages/@vuepress-reco/plugin-page/src/node/Classifiable.ts | TypeScript |
MethodDeclaration |
getPublishPostsPage(): Array<Promise<Page>> {
const pageSize = Math.ceil(this.publishPosts.length / 10)
const pages = Array.from({ length: pageSize }).map((item, index) => {
return createPage(this.app, {
path: `/posts/${index + 1}/`,
frontmatter: { layout: 'Post' },
})
})
... | fawaikuangtuzs/blog3 | packages/@vuepress-reco/plugin-page/src/node/Classifiable.ts | TypeScript |
FunctionDeclaration |
function sanitizeString(str) {
if (str.includes('*')) {
throw new VariableDynamicImportError('A dynamic import cannot contain * characters.');
}
return str;
} | ShuntaNakajima/vite-plugins | packages/dynamic-import/src/dynamic-import-vars.ts | TypeScript |
FunctionDeclaration |
function templateLiteralToGlob(node) {
let glob = '';
for (let i = 0; i < node.quasis.length; i += 1) {
glob += sanitizeString(node.quasis[i].value.raw);
if (node.expressions[i]) { // quasis 永远比 expressions 长一位
glob += expressionToGlob(node.expressions[i]);
}
}
return glob;
} | ShuntaNakajima/vite-plugins | packages/dynamic-import/src/dynamic-import-vars.ts | TypeScript |
FunctionDeclaration |
function callExpressionToGlob(node) {
const { callee } = node;
if (
callee.type === 'MemberExpression' &&
callee.property.type === 'Identifier' &&
callee.property.name === 'concat'
) {
return `${expressionToGlob(callee.object)}${node.arguments.map(expressionToGlob).join('')}`;
}
return '*';
} | ShuntaNakajima/vite-plugins | packages/dynamic-import/src/dynamic-import-vars.ts | TypeScript |
FunctionDeclaration |
function binaryExpressionToGlob(node) {
if (node.operator !== '+') {
throw new VariableDynamicImportError(`${node.operator} operator is not supported.`);
}
return `${expressionToGlob(node.left)}${expressionToGlob(node.right)}`;
} | ShuntaNakajima/vite-plugins | packages/dynamic-import/src/dynamic-import-vars.ts | TypeScript |
FunctionDeclaration |
function expressionToGlob(node) {
switch (node.type) {
case 'TemplateLiteral':
// import(`@/pages/${path}`)
return templateLiteralToGlob(node);
case 'CallExpression':
// import('@/pages/'.concat(path))
return callExpressionToGlob(node);
case 'BinaryExpression':
// import('@/... | ShuntaNakajima/vite-plugins | packages/dynamic-import/src/dynamic-import-vars.ts | TypeScript |
FunctionDeclaration |
function dynamicImportToGlob(node, sourceString) {
let glob = expressionToGlob(node);
if (!glob.includes('*') || glob.startsWith('data:')) {
return null;
}
glob = glob.replace(/\*\*/g, '*');
glob = DynamicImportVars.aliasReplace(glob);
if (glob.startsWith('*')) {
throw new VariableDynamicImportErr... | ShuntaNakajima/vite-plugins | packages/dynamic-import/src/dynamic-import-vars.ts | TypeScript |
ClassDeclaration |
export class DynamicImportVars {
static aliasContext: AliasContext
static _id: string
static _alias: ImporteeGlob['alias']
static aliasReplace(globImportee: string): string {
const replaced = this.aliasContext.replaceImportee(globImportee, this._id)
this._alias = replaced || undefined
return repla... | ShuntaNakajima/vite-plugins | packages/dynamic-import/src/dynamic-import-vars.ts | TypeScript |
ClassDeclaration | // The following part is the `@rollup/plugin-dynamic-import-vars` source code
// https://github.com/rollup/plugins/blob/master/packages/dynamic-import-vars/src/dynamic-import-to-glob.js
class VariableDynamicImportError extends Error { } | ShuntaNakajima/vite-plugins | packages/dynamic-import/src/dynamic-import-vars.ts | TypeScript |
InterfaceDeclaration |
export interface ImporteeGlob {
glob: string | null
/**
* with alias glob
*/
alias?: AliasReplaced
} | ShuntaNakajima/vite-plugins | packages/dynamic-import/src/dynamic-import-vars.ts | TypeScript |
MethodDeclaration |
static aliasReplace(globImportee: string): string {
const replaced = this.aliasContext.replaceImportee(globImportee, this._id)
this._alias = replaced || undefined
return replaced ? replaced.replacedImportee : globImportee
} | ShuntaNakajima/vite-plugins | packages/dynamic-import/src/dynamic-import-vars.ts | TypeScript |
MethodDeclaration |
public dynamicImportToGlob(
node: AcornNode,
sourceString: string,
id: string,
): ImporteeGlob {
DynamicImportVars._id = id
const glob = dynamicImportToGlob(node, sourceString)
const result: ImporteeGlob = {
glob,
alias: DynamicImportVars._alias,
}
DynamicImportVars._id ... | ShuntaNakajima/vite-plugins | packages/dynamic-import/src/dynamic-import-vars.ts | TypeScript |
ArrowFunction |
(token: TagToken) => {
if (token.name === 'endraw') stream.stop()
else this.tokens.push(token)
} | pdehaan/liquidjs | src/builtin/tags/raw.ts | TypeScript |
ArrowFunction |
() => {
throw new Error(`tag ${tagToken.raw} not closed`)
} | pdehaan/liquidjs | src/builtin/tags/raw.ts | TypeScript |
ArrowFunction |
(token: Token) => token.raw | pdehaan/liquidjs | src/builtin/tags/raw.ts | TypeScript |
ArrowFunction |
(type) => [StationModel] | kirban/nest-graphql-api | src/city/city.model.ts | TypeScript |
ArrowFunction |
(type) => StationModel | kirban/nest-graphql-api | src/city/city.model.ts | TypeScript |
ArrowFunction |
(station) => station.city | kirban/nest-graphql-api | src/city/city.model.ts | TypeScript |
ClassDeclaration |
@ObjectType()
@Entity()
export class CityModel {
@Field()
@PrimaryGeneratedColumn('uuid')
id: string;
@Field()
@Column({ length: 50, nullable: false })
name: string;
@Field()
@Column('varchar', { length: 15 })
phone: string;
@Field((type) => [StationModel], { nullable: true })
@OneToMany((type... | kirban/nest-graphql-api | src/city/city.model.ts | TypeScript |
InterfaceDeclaration |
interface MyApp {
"offset": number;
} | BMIOrganisationTestaccount/stencil | test/performance/src/components.d.ts | TypeScript |
InterfaceDeclaration |
interface MyItem {
"index": number;
} | BMIOrganisationTestaccount/stencil | test/performance/src/components.d.ts | TypeScript |
InterfaceDeclaration |
interface MyList {
"offset": number;
} | BMIOrganisationTestaccount/stencil | test/performance/src/components.d.ts | TypeScript |
InterfaceDeclaration |
interface HTMLMyAppElement extends Components.MyApp, HTMLStencilElement {
} | BMIOrganisationTestaccount/stencil | test/performance/src/components.d.ts | TypeScript |
InterfaceDeclaration |
interface HTMLMyItemElement extends Components.MyItem, HTMLStencilElement {
} | BMIOrganisationTestaccount/stencil | test/performance/src/components.d.ts | TypeScript |
InterfaceDeclaration |
interface HTMLMyListElement extends Components.MyList, HTMLStencilElement {
} | BMIOrganisationTestaccount/stencil | test/performance/src/components.d.ts | TypeScript |
InterfaceDeclaration |
interface HTMLElementTagNameMap {
"my-app": HTMLMyAppElement;
"my-item": HTMLMyItemElement;
"my-list": HTMLMyListElement;
} | BMIOrganisationTestaccount/stencil | test/performance/src/components.d.ts | TypeScript |
InterfaceDeclaration |
interface MyApp {
"offset"?: number;
} | BMIOrganisationTestaccount/stencil | test/performance/src/components.d.ts | TypeScript |
InterfaceDeclaration |
interface MyItem {
"index"?: number;
} | BMIOrganisationTestaccount/stencil | test/performance/src/components.d.ts | TypeScript |
InterfaceDeclaration |
interface MyList {
"offset"?: number;
} | BMIOrganisationTestaccount/stencil | test/performance/src/components.d.ts | TypeScript |
InterfaceDeclaration |
interface IntrinsicElements {
"my-app": MyApp;
"my-item": MyItem;
"my-list": MyList;
} | BMIOrganisationTestaccount/stencil | test/performance/src/components.d.ts | TypeScript |
InterfaceDeclaration |
interface IntrinsicElements {
"my-app": LocalJSX.MyApp & JSXBase.HTMLAttributes<HTMLMyAppElement>;
"my-item": LocalJSX.MyItem & JSXBase.HTMLAttributes<HTMLMyItemElement>;
"my-list": LocalJSX.MyList & JSXBase.HTMLAttributes<HTMLMyListElement>;
} | BMIOrganisationTestaccount/stencil | test/performance/src/components.d.ts | TypeScript |
ClassDeclaration |
@Injectable()
export class ContratoService {
apiUrl: string;
constructor(private http: HttpClient) { }
buscarDestino(): Observable<Contrato[]> {
return this.http.get<Contrato[]>(API_URL);
}
crearOActualizarDestino(contrato: Contrato): Observable<Contrato[]> {
return this.http.po... | DJRICHARD15/FrontEnd | .history/src/app/services/Contrato.service_20190318084726.ts | TypeScript |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.