-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
303 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,58 @@ | ||
export { | ||
graphql, | ||
GraphQLBoolean, | ||
type GraphQLFieldConfigMap, | ||
GraphQLDeprecatedDirective, | ||
GraphQLEnumType, | ||
GraphQLError, | ||
GraphQLInputObjectType, | ||
GraphQLInt, | ||
GraphQLInterfaceType, | ||
type GraphQLInterfaceTypeConfig, | ||
GraphQLList, | ||
GraphQLNonNull, | ||
GraphQLObjectType, | ||
type GraphQLObjectTypeConfig, | ||
GraphQLScalarType, | ||
GraphQLSchema, | ||
GraphQLString, | ||
graphqlSync, | ||
GraphQLUnionType, | ||
} from "https://deno.land/x/graphql_deno@v15.0.0/mod.ts"; | ||
|
||
export type { | ||
GraphQLAbstractType, | ||
GraphQLCompositeType, | ||
GraphQLEnumTypeConfig, | ||
GraphQLEnumValue, | ||
GraphQLEnumValueConfig, | ||
GraphQLEnumValueConfigMap, | ||
GraphQLField, | ||
GraphQLFieldConfig, | ||
GraphQLFieldConfigMap, | ||
GraphQLFieldMap, | ||
GraphQLFormattedError, | ||
GraphQLInputObjectTypeConfig, | ||
GraphQLInterfaceTypeConfig, | ||
GraphQLNamedType, | ||
GraphQLNullableType, | ||
GraphQLObjectTypeConfig, | ||
GraphQLSchemaConfig, | ||
GraphQLType, | ||
GraphQLTypeResolver, | ||
GraphQLUnionTypeConfig, | ||
Thunk, | ||
} from "https://deno.land/x/graphql_deno@v15.0.0/mod.ts"; | ||
|
||
export { default as PQueue } from "https://deno.land/x/p_queue@1.0.1/mod.ts"; | ||
|
||
export { | ||
denoDomDisableQuerySelectorCodeGeneration as disableCodeGen, | ||
DOMParser, | ||
Element, | ||
} from "https://deno.land/x/deno_dom@v0.1.31-alpha/deno-dom-wasm.ts"; | ||
export { serve } from "https://deno.land/std@0.145.0/http/server.ts"; | ||
|
||
export type { Element } from "https://deno.land/x/deno_dom@v0.1.31-alpha/deno-dom-wasm.ts"; | ||
|
||
export { | ||
serve, | ||
type ServeInit, | ||
Server, | ||
type ServerInit, | ||
} from "https://deno.land/std@0.145.0/http/server.ts"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,34 @@ | ||
import { Element } from "../deps.ts"; | ||
|
||
export function getAttributeOfElement(element: Element, name: string) { | ||
export function getAttributeOfElement( | ||
element: Element, | ||
name?: string, | ||
trim = false, | ||
): string | null { | ||
if (element == null || name == null) { | ||
return null; | ||
} | ||
const attribute = element.getAttribute(name); | ||
if (attribute == null) return null; | ||
if (attribute == null) { | ||
return null; | ||
} | ||
return trim ? attribute.trim() : attribute; | ||
} | ||
|
||
return attribute; | ||
export function getAttributesOfElement(element: Element, trim = false) { | ||
if (element == null) { | ||
return null; | ||
} | ||
const names = element.getAttributeNames(); | ||
if (names == null || names.length === 0) { | ||
return {}; | ||
} | ||
return Object.fromEntries(names.map( | ||
(attr) => [attr, getAttributeOfElement(element, attr, trim)], | ||
)); | ||
} | ||
|
||
export function resolveURL(base: string, url: string) { | ||
const uri = new URL(url, base); | ||
|
||
return uri.toString(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.