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
function* cssRulesIterator() { | |
for(const stylesheet of window.document.styleSheets) { | |
for (const rule of stylesheet.cssRules) { | |
yield rule.cssText; | |
} | |
} | |
} | |
[...cssRulesIterator()].filter(ruleText => true) |
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
/* eslint-disable @typescript-eslint/no-redeclare */ | |
export function isHttpStatusSuccess(code: number): code is HTTP_STATUS_SUCCESS { | |
return code >= 200 && code < 300; | |
} | |
export function isHttpStatusClientError(code: number): code is HTTP_STATUS_CLIENT_ERROR { | |
return code >= 400 && code < 500; | |
} | |
export function isHttpStatusServerError(code: number): code is HTTP_STATUS_SERVER_ERROR { |
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
import { Kind } from 'graphql/language'; | |
import { GraphQLScalarType } from 'graphql'; | |
function serializeDate(value) { | |
if (value instanceof Date) { | |
return value.getTime(); | |
} else if (typeof value === 'number') { | |
return Math.trunc(value); | |
} else if (typeof value === 'string') { | |
return Date.parse(value); |
OlderNewer