mirror of
https://github.com/MetaFam/TheGame.git
synced 2026-04-02 03:00:32 -04:00
Update TS, setup SourceCred SDK, and add helpers to utils (#107)
* Update TS version and setup SourceCred API in backend * Fix typeError in Player.tsx * Update yarn.lock * Update yarn.lock and fix type errors
This commit is contained in:
@@ -73,6 +73,6 @@
|
||||
"react": "^16.13.1",
|
||||
"react-dom": "^16.13.1",
|
||||
"tsdx": "^0.13.2",
|
||||
"typescript": "^3.9.6"
|
||||
"typescript": "4.0.2"
|
||||
}
|
||||
}
|
||||
|
||||
18
packages/@types/3box/index.d.ts
vendored
18
packages/@types/3box/index.d.ts
vendored
@@ -43,7 +43,25 @@ declare module '3box' {
|
||||
username: string;
|
||||
};
|
||||
}
|
||||
|
||||
export async function getVerifiedAccounts(
|
||||
boxProfile: BoxProfile,
|
||||
): Promise<VerifiedAccounts>;
|
||||
|
||||
interface BoxSpace {
|
||||
public: {
|
||||
get<T = string>(key: string): Promise<T>;
|
||||
set<T = string>(key: string, data: string): Promise<T>;
|
||||
};
|
||||
}
|
||||
|
||||
interface Box {
|
||||
syncDone: Promise<boolean>;
|
||||
openSpace: (url: string) => Promise<BoxSpace>;
|
||||
twitter?: {
|
||||
proof: string;
|
||||
username: string;
|
||||
};
|
||||
}
|
||||
export async function openBox(ethAddress: string, web3: any): Promise<Box>;
|
||||
}
|
||||
|
||||
686
packages/@types/sourcecred/index.d.ts
vendored
Normal file
686
packages/@types/sourcecred/index.d.ts
vendored
Normal file
@@ -0,0 +1,686 @@
|
||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||
/** Declaration file generated by dts-gen */
|
||||
declare module 'sourcecred' {
|
||||
export = sourcecred;
|
||||
|
||||
declare const sourcecred: {
|
||||
analysis: {
|
||||
credData: {
|
||||
compressByThreshold: any;
|
||||
compressDownToMatchingIndices: any;
|
||||
computeCredData: any;
|
||||
};
|
||||
credResult: {
|
||||
compressByThreshold: any;
|
||||
compute: any;
|
||||
fromJSON: any;
|
||||
stripOverTimeDataForNonUsers: any;
|
||||
toJSON: any;
|
||||
};
|
||||
credView: {
|
||||
CredView: any;
|
||||
};
|
||||
};
|
||||
core: {
|
||||
address: {
|
||||
makeAddressModule: any;
|
||||
};
|
||||
algorithm: {
|
||||
graphToMarkovChain: {
|
||||
adjacencySource: any;
|
||||
createConnections: any;
|
||||
createOrderedSparseMarkovChain: any;
|
||||
distributionToNodeDistribution: any;
|
||||
normalize: any;
|
||||
normalizeNeighbors: any;
|
||||
permute: any;
|
||||
};
|
||||
markovChain: {
|
||||
findStationaryDistribution: any;
|
||||
sparseMarkovChainAction: any;
|
||||
sparseMarkovChainFromTransitionMatrix: any;
|
||||
};
|
||||
};
|
||||
graph: {
|
||||
Direction: {
|
||||
ANY: any;
|
||||
IN: any;
|
||||
OUT: any;
|
||||
};
|
||||
EdgeAddress: {
|
||||
append: any;
|
||||
assertValid: any;
|
||||
assertValidParts: any;
|
||||
empty: string;
|
||||
fromParts: any;
|
||||
fromRaw: any;
|
||||
hasPrefix: any;
|
||||
parser: {
|
||||
parse: any;
|
||||
parseOrThrow: any;
|
||||
};
|
||||
toParts: any;
|
||||
toString: any;
|
||||
};
|
||||
Graph: any;
|
||||
NodeAddress: {
|
||||
append: any;
|
||||
assertValid: any;
|
||||
assertValidParts: any;
|
||||
empty: string;
|
||||
fromParts: any;
|
||||
fromRaw: any;
|
||||
hasPrefix: any;
|
||||
parser: {
|
||||
parse: any;
|
||||
parseOrThrow: any;
|
||||
};
|
||||
toParts: any;
|
||||
toString: any;
|
||||
};
|
||||
edgeToParts: any;
|
||||
edgeToString: any;
|
||||
edgeToStrings: any;
|
||||
nodeToString: any;
|
||||
};
|
||||
weightedGraph: {
|
||||
empty: any;
|
||||
fromJSON: any;
|
||||
merge: any;
|
||||
overrideWeights: any;
|
||||
toJSON: any;
|
||||
};
|
||||
weights: {
|
||||
copy: any;
|
||||
empty: any;
|
||||
fromJSON: any;
|
||||
merge: any;
|
||||
parser: {
|
||||
parse: any;
|
||||
parseOrThrow: any;
|
||||
};
|
||||
toJSON: any;
|
||||
};
|
||||
};
|
||||
ledger: {
|
||||
grain: {
|
||||
DECIMAL_PRECISION: number;
|
||||
DEFAULT_SUFFIX: string;
|
||||
ONE: string;
|
||||
ZERO: string;
|
||||
add: any;
|
||||
div: any;
|
||||
eq: any;
|
||||
format: any;
|
||||
fromApproximateFloat: any;
|
||||
fromFloatString: any;
|
||||
fromInteger: any;
|
||||
fromString: any;
|
||||
gt: any;
|
||||
gte: any;
|
||||
lt: any;
|
||||
lte: any;
|
||||
mul: any;
|
||||
multiplyFloat: any;
|
||||
parser: {
|
||||
parse: any;
|
||||
parseOrThrow: any;
|
||||
};
|
||||
splitBudget: any;
|
||||
sub: any;
|
||||
sum: any;
|
||||
toFloatRatio: any;
|
||||
};
|
||||
identity: {
|
||||
IDENTITY_PREFIX: string;
|
||||
aliasParser: {
|
||||
parse: any;
|
||||
parseOrThrow: any;
|
||||
};
|
||||
contractions: any;
|
||||
declaration: {
|
||||
edgePrefix: string;
|
||||
edgeTypes: any[];
|
||||
name: string;
|
||||
nodePrefix: string;
|
||||
nodeTypes: {
|
||||
defaultWeight: number;
|
||||
description: string;
|
||||
name: string;
|
||||
pluralName: string;
|
||||
prefix: string;
|
||||
}[];
|
||||
userTypes: {
|
||||
defaultWeight: number;
|
||||
description: string;
|
||||
name: string;
|
||||
pluralName: string;
|
||||
prefix: string;
|
||||
}[];
|
||||
};
|
||||
graphNode: any;
|
||||
identityParser: {
|
||||
parse: any;
|
||||
parseOrThrow: any;
|
||||
};
|
||||
identityTypeParser: {
|
||||
parse: any;
|
||||
parseOrThrow: any;
|
||||
};
|
||||
nameFromString: any;
|
||||
nameParser: {
|
||||
parse: any;
|
||||
parseOrThrow: any;
|
||||
};
|
||||
newIdentity: any;
|
||||
};
|
||||
ledger: {
|
||||
Ledger: any;
|
||||
};
|
||||
};
|
||||
plugins: {
|
||||
discord: {
|
||||
declaration: {
|
||||
addsReactionEdgeType: {
|
||||
backwardName: string;
|
||||
defaultWeight: {
|
||||
backwards: number;
|
||||
forwards: number;
|
||||
};
|
||||
description: string;
|
||||
forwardName: string;
|
||||
prefix: string;
|
||||
};
|
||||
authorsMessageEdgeType: {
|
||||
backwardName: string;
|
||||
defaultWeight: {
|
||||
backwards: number;
|
||||
forwards: number;
|
||||
};
|
||||
description: string;
|
||||
forwardName: string;
|
||||
prefix: string;
|
||||
};
|
||||
declaration: {
|
||||
edgePrefix: string;
|
||||
edgeTypes: {
|
||||
backwardName: string;
|
||||
defaultWeight: {
|
||||
backwards: number;
|
||||
forwards: number;
|
||||
};
|
||||
description: string;
|
||||
forwardName: string;
|
||||
prefix: string;
|
||||
}[];
|
||||
name: string;
|
||||
nodePrefix: string;
|
||||
nodeTypes: {
|
||||
defaultWeight: number;
|
||||
description: string;
|
||||
name: string;
|
||||
pluralName: string;
|
||||
prefix: string;
|
||||
}[];
|
||||
userTypes: {
|
||||
defaultWeight: number;
|
||||
description: string;
|
||||
name: string;
|
||||
pluralName: string;
|
||||
prefix: string;
|
||||
}[];
|
||||
};
|
||||
edgePrefix: string;
|
||||
memberNodeType: {
|
||||
defaultWeight: number;
|
||||
description: string;
|
||||
name: string;
|
||||
pluralName: string;
|
||||
prefix: string;
|
||||
};
|
||||
mentionsEdgeType: {
|
||||
backwardName: string;
|
||||
defaultWeight: {
|
||||
backwards: number;
|
||||
forwards: number;
|
||||
};
|
||||
description: string;
|
||||
forwardName: string;
|
||||
prefix: string;
|
||||
};
|
||||
messageNodeType: {
|
||||
defaultWeight: number;
|
||||
description: string;
|
||||
name: string;
|
||||
pluralName: string;
|
||||
prefix: string;
|
||||
};
|
||||
nodePrefix: string;
|
||||
reactionNodeType: {
|
||||
defaultWeight: number;
|
||||
description: string;
|
||||
name: string;
|
||||
pluralName: string;
|
||||
prefix: string;
|
||||
};
|
||||
reactsToEdgeType: {
|
||||
backwardName: string;
|
||||
defaultWeight: {
|
||||
backwards: number;
|
||||
forwards: number;
|
||||
};
|
||||
description: string;
|
||||
forwardName: string;
|
||||
prefix: string;
|
||||
};
|
||||
};
|
||||
};
|
||||
discourse: {
|
||||
address: {
|
||||
likeAddress: any;
|
||||
postAddress: any;
|
||||
topicAddress: any;
|
||||
userAddress: any;
|
||||
};
|
||||
declaration: {
|
||||
authorsPostEdgeType: {
|
||||
backwardName: string;
|
||||
defaultWeight: {
|
||||
backwards: number;
|
||||
forwards: number;
|
||||
};
|
||||
description: string;
|
||||
forwardName: string;
|
||||
prefix: string;
|
||||
};
|
||||
authorsTopicEdgeType: {
|
||||
backwardName: string;
|
||||
defaultWeight: {
|
||||
backwards: number;
|
||||
forwards: number;
|
||||
};
|
||||
description: string;
|
||||
forwardName: string;
|
||||
prefix: string;
|
||||
};
|
||||
createsLikeEdgeType: {
|
||||
backwardName: string;
|
||||
defaultWeight: {
|
||||
backwards: number;
|
||||
forwards: number;
|
||||
};
|
||||
description: string;
|
||||
forwardName: string;
|
||||
prefix: string;
|
||||
};
|
||||
declaration: {
|
||||
edgePrefix: string;
|
||||
edgeTypes: {
|
||||
backwardName: string;
|
||||
defaultWeight: {
|
||||
backwards: number;
|
||||
forwards: number;
|
||||
};
|
||||
description: string;
|
||||
forwardName: string;
|
||||
prefix: string;
|
||||
}[];
|
||||
name: string;
|
||||
nodePrefix: string;
|
||||
nodeTypes: {
|
||||
defaultWeight: number;
|
||||
description: string;
|
||||
name: string;
|
||||
pluralName: string;
|
||||
prefix: string;
|
||||
}[];
|
||||
userTypes: {
|
||||
defaultWeight: number;
|
||||
description: string;
|
||||
name: string;
|
||||
pluralName: string;
|
||||
prefix: string;
|
||||
}[];
|
||||
};
|
||||
edgePrefix: string;
|
||||
likeNodeType: {
|
||||
defaultWeight: number;
|
||||
description: string;
|
||||
name: string;
|
||||
pluralName: string;
|
||||
prefix: string;
|
||||
};
|
||||
likesEdgeType: {
|
||||
backwardName: string;
|
||||
defaultWeight: {
|
||||
backwards: number;
|
||||
forwards: number;
|
||||
};
|
||||
description: string;
|
||||
forwardName: string;
|
||||
prefix: string;
|
||||
};
|
||||
nodePrefix: string;
|
||||
postNodeType: {
|
||||
defaultWeight: number;
|
||||
description: string;
|
||||
name: string;
|
||||
pluralName: string;
|
||||
prefix: string;
|
||||
};
|
||||
postRepliesEdgeType: {
|
||||
backwardName: string;
|
||||
defaultWeight: {
|
||||
backwards: number;
|
||||
forwards: number;
|
||||
};
|
||||
description: string;
|
||||
forwardName: string;
|
||||
prefix: string;
|
||||
};
|
||||
referencesPostEdgeType: {
|
||||
backwardName: string;
|
||||
defaultWeight: {
|
||||
backwards: number;
|
||||
forwards: number;
|
||||
};
|
||||
description: string;
|
||||
forwardName: string;
|
||||
prefix: string;
|
||||
};
|
||||
referencesTopicEdgeType: {
|
||||
backwardName: string;
|
||||
defaultWeight: {
|
||||
backwards: number;
|
||||
forwards: number;
|
||||
};
|
||||
description: string;
|
||||
forwardName: string;
|
||||
prefix: string;
|
||||
};
|
||||
referencesUserEdgeType: {
|
||||
backwardName: string;
|
||||
defaultWeight: {
|
||||
backwards: number;
|
||||
forwards: number;
|
||||
};
|
||||
description: string;
|
||||
forwardName: string;
|
||||
prefix: string;
|
||||
};
|
||||
topicContainsPostEdgeType: {
|
||||
backwardName: string;
|
||||
defaultWeight: {
|
||||
backwards: number;
|
||||
forwards: number;
|
||||
};
|
||||
description: string;
|
||||
forwardName: string;
|
||||
prefix: string;
|
||||
};
|
||||
topicHasLikedPostEdgeType: {
|
||||
backwardName: string;
|
||||
defaultWeight: {
|
||||
backwards: number;
|
||||
forwards: number;
|
||||
};
|
||||
description: string;
|
||||
forwardName: string;
|
||||
prefix: string;
|
||||
};
|
||||
topicNodeType: {
|
||||
defaultWeight: number;
|
||||
description: string;
|
||||
name: string;
|
||||
pluralName: string;
|
||||
prefix: string;
|
||||
};
|
||||
userNodeType: {
|
||||
defaultWeight: number;
|
||||
description: string;
|
||||
name: string;
|
||||
pluralName: string;
|
||||
prefix: string;
|
||||
};
|
||||
};
|
||||
};
|
||||
github: {
|
||||
declaration: {
|
||||
declaration: {
|
||||
edgePrefix: string;
|
||||
edgeTypes: {
|
||||
backwardName: string;
|
||||
defaultWeight: {
|
||||
backwards: number;
|
||||
forwards: number;
|
||||
};
|
||||
description: string;
|
||||
forwardName: string;
|
||||
prefix: string;
|
||||
}[];
|
||||
name: string;
|
||||
nodePrefix: string;
|
||||
nodeTypes: {
|
||||
defaultWeight: number;
|
||||
description: string;
|
||||
name: string;
|
||||
pluralName: string;
|
||||
prefix: string;
|
||||
}[];
|
||||
userTypes: {
|
||||
defaultWeight: number;
|
||||
description: string;
|
||||
name: string;
|
||||
pluralName: string;
|
||||
prefix: string;
|
||||
}[];
|
||||
};
|
||||
repoNodeType: {
|
||||
defaultWeight: number;
|
||||
description: string;
|
||||
name: string;
|
||||
pluralName: string;
|
||||
prefix: string;
|
||||
};
|
||||
userNodeType: {
|
||||
defaultWeight: number;
|
||||
description: string;
|
||||
name: string;
|
||||
pluralName: string;
|
||||
prefix: string;
|
||||
};
|
||||
};
|
||||
edges: {
|
||||
AUTHORS_TYPE: string;
|
||||
CORRESPONDS_TO_COMMIT_TYPE: string;
|
||||
HAS_PARENT_TYPE: string;
|
||||
MERGED_AS_TYPE: string;
|
||||
Prefix: {
|
||||
authors: string;
|
||||
base: string;
|
||||
correspondsToCommit: string;
|
||||
hasParent: string;
|
||||
mergedAs: string;
|
||||
reacts: string;
|
||||
reactsHeart: string;
|
||||
reactsHooray: string;
|
||||
reactsRocket: string;
|
||||
reactsThumbsUp: string;
|
||||
references: string;
|
||||
};
|
||||
REACTS_TYPE: string;
|
||||
REFERENCES_TYPE: string;
|
||||
createEdge: {
|
||||
authors: any;
|
||||
correspondsToCommit: any;
|
||||
hasParent: any;
|
||||
mergedAs: any;
|
||||
reacts: any;
|
||||
references: any;
|
||||
};
|
||||
fromRaw: any;
|
||||
toRaw: any;
|
||||
};
|
||||
nodes: {
|
||||
BOT_SUBTYPE: string;
|
||||
COMMENT_TYPE: string;
|
||||
COMMIT_TYPE: string;
|
||||
ISSUE_TYPE: string;
|
||||
PULL_TYPE: string;
|
||||
Prefix: {
|
||||
base: string;
|
||||
bot: string;
|
||||
comment: string;
|
||||
commit: string;
|
||||
issue: string;
|
||||
issueComment: string;
|
||||
pull: string;
|
||||
pullComment: string;
|
||||
repo: string;
|
||||
review: string;
|
||||
reviewComment: string;
|
||||
user: string;
|
||||
userlike: string;
|
||||
};
|
||||
REPO_TYPE: string;
|
||||
REVIEW_TYPE: string;
|
||||
USERLIKE_TYPE: string;
|
||||
USER_SUBTYPE: string;
|
||||
fromRaw: any;
|
||||
loginAddress: any;
|
||||
toRaw: any;
|
||||
};
|
||||
};
|
||||
initiatives: {
|
||||
declaration: {
|
||||
championsEdgeType: {
|
||||
backwardName: string;
|
||||
defaultWeight: {
|
||||
backwards: number;
|
||||
forwards: number;
|
||||
};
|
||||
description: string;
|
||||
forwardName: string;
|
||||
prefix: string;
|
||||
};
|
||||
contributesToEdgeType: {
|
||||
backwardName: string;
|
||||
defaultWeight: {
|
||||
backwards: number;
|
||||
forwards: number;
|
||||
};
|
||||
description: string;
|
||||
forwardName: string;
|
||||
prefix: string;
|
||||
};
|
||||
contributesToEntryEdgeType: {
|
||||
backwardName: string;
|
||||
defaultWeight: {
|
||||
backwards: number;
|
||||
forwards: number;
|
||||
};
|
||||
description: string;
|
||||
forwardName: string;
|
||||
prefix: string;
|
||||
};
|
||||
contributionEntryType: {
|
||||
defaultWeight: number;
|
||||
description: string;
|
||||
name: string;
|
||||
pluralName: string;
|
||||
prefix: string;
|
||||
};
|
||||
declaration: {
|
||||
edgePrefix: string;
|
||||
edgeTypes: {
|
||||
backwardName: string;
|
||||
defaultWeight: {
|
||||
backwards: number;
|
||||
forwards: number;
|
||||
};
|
||||
description: string;
|
||||
forwardName: string;
|
||||
prefix: string;
|
||||
}[];
|
||||
name: string;
|
||||
nodePrefix: string;
|
||||
nodeTypes: {
|
||||
defaultWeight: number;
|
||||
description: string;
|
||||
name: string;
|
||||
pluralName: string;
|
||||
prefix: string;
|
||||
}[];
|
||||
userTypes: any[];
|
||||
};
|
||||
dependencyEntryType: {
|
||||
defaultWeight: number;
|
||||
description: string;
|
||||
name: string;
|
||||
pluralName: string;
|
||||
prefix: string;
|
||||
};
|
||||
dependsOnEdgeType: {
|
||||
backwardName: string;
|
||||
defaultWeight: {
|
||||
backwards: number;
|
||||
forwards: number;
|
||||
};
|
||||
description: string;
|
||||
forwardName: string;
|
||||
prefix: string;
|
||||
};
|
||||
edgePrefix: string;
|
||||
initiativeNodeType: {
|
||||
defaultWeight: number;
|
||||
description: string;
|
||||
name: string;
|
||||
pluralName: string;
|
||||
prefix: string;
|
||||
};
|
||||
nodeEntryTypes: {
|
||||
CONTRIBUTION: {
|
||||
defaultWeight: number;
|
||||
description: string;
|
||||
name: string;
|
||||
pluralName: string;
|
||||
prefix: string;
|
||||
};
|
||||
DEPENDENCY: {
|
||||
defaultWeight: number;
|
||||
description: string;
|
||||
name: string;
|
||||
pluralName: string;
|
||||
prefix: string;
|
||||
};
|
||||
REFERENCE: {
|
||||
defaultWeight: number;
|
||||
description: string;
|
||||
name: string;
|
||||
pluralName: string;
|
||||
prefix: string;
|
||||
};
|
||||
};
|
||||
nodePrefix: string;
|
||||
referenceEntryType: {
|
||||
defaultWeight: number;
|
||||
description: string;
|
||||
name: string;
|
||||
pluralName: string;
|
||||
prefix: string;
|
||||
};
|
||||
referencesEdgeType: {
|
||||
backwardName: string;
|
||||
defaultWeight: {
|
||||
backwards: number;
|
||||
forwards: number;
|
||||
};
|
||||
description: string;
|
||||
forwardName: string;
|
||||
prefix: string;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -7,7 +7,7 @@ import { PlayerDetails } from '../components/PlayerDetails';
|
||||
import { GetPlayerFromId } from '../graphql/queries';
|
||||
|
||||
export const Player: React.FC = () => {
|
||||
const { playerId } = useParams();
|
||||
const { playerId } = useParams<{ playerId: string }>();
|
||||
const { data, loading, error } = useQuery(GetPlayerFromId, {
|
||||
variables: {
|
||||
player_id: playerId,
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
"start": "node ./dist/index.js",
|
||||
"build": "yarn generate && tsc -b",
|
||||
"dev": "concurrently \"yarn dev-ts\" \"yarn generate --watch\"",
|
||||
"dev-ts": "ts-node-dev --exit-child --respawn --transpile-only -- src/index.ts",
|
||||
"dev-ts": "ts-node-dev --exit-child --respawn -- src/index.ts",
|
||||
"typecheck": "yarn build",
|
||||
"precommit": "yarn lint-staged",
|
||||
"generate": "graphql-codegen --config=codegen.yml",
|
||||
@@ -27,12 +27,13 @@
|
||||
"graphql-tag": "^2.10.4",
|
||||
"graphql-tools": "^6.0.15",
|
||||
"node-fetch": "^2.6.0",
|
||||
"graphql-request": "^3.0.0-next.4"
|
||||
"graphql-request": "^3.0.0-next.4",
|
||||
"sourcecred": "0.7.0-beta-14"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/express": "^4.17.6",
|
||||
"@types/node-fetch": "^2.5.6",
|
||||
"concurrently": "^5.2.0",
|
||||
"ts-node-dev": "^1.0.0-pre.56"
|
||||
"ts-node-dev": "1.0.0-pre.62"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,8 +4,7 @@
|
||||
"module": "commonjs",
|
||||
"rootDir": "src",
|
||||
"outDir": "dist",
|
||||
"tsBuildInfoFile": "dist/.tsbuildinfo",
|
||||
"incremental": true
|
||||
"tsBuildInfoFile": "dist/.tsbuildinfo"
|
||||
},
|
||||
"references": [
|
||||
{
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
"compilerOptions": {
|
||||
"lib": ["dom", "dom.iterable", "esnext"],
|
||||
"allowJs": true,
|
||||
"noEmit": true
|
||||
"noEmit": true,
|
||||
"tsBuildInfoFile": "./dist/.tsbuildinfo"
|
||||
},
|
||||
"include": ["./src", "./stories", "./test"]
|
||||
}
|
||||
|
||||
@@ -14,9 +14,6 @@
|
||||
"@chakra-ui/core": "^0.8.0",
|
||||
"@emotion/core": "^10.0.28",
|
||||
"@emotion/styled": "^10.0.27",
|
||||
"@types/node": "^14.0.23",
|
||||
"@types/react": "^16.9.43",
|
||||
"@types/react-dom": "^16.9.8",
|
||||
"@types/styled-components": "^5.1.1",
|
||||
"babel-plugin-styled-components": "^1.10.7",
|
||||
"emotion-theming": "^10.0.27",
|
||||
|
||||
@@ -1,29 +1,17 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"target": "es5",
|
||||
"lib": [
|
||||
"dom",
|
||||
"dom.iterable",
|
||||
"esnext"
|
||||
],
|
||||
"lib": ["dom", "es2017"],
|
||||
"allowJs": true,
|
||||
"skipLibCheck": true,
|
||||
"strict": false,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"noEmit": true,
|
||||
"esModuleInterop": true,
|
||||
"module": "esnext",
|
||||
"moduleResolution": "node",
|
||||
"resolveJsonModule": true,
|
||||
"isolatedModules": true,
|
||||
"noUnusedLocals": false,
|
||||
"noUnusedParameters": false,
|
||||
"tsBuildInfoFile": "out/.tsbuildinfo",
|
||||
"jsx": "preserve"
|
||||
},
|
||||
"exclude": [
|
||||
"node_modules"
|
||||
],
|
||||
"include": [
|
||||
"next-env.d.ts",
|
||||
"**/*.ts",
|
||||
"**/*.tsx"
|
||||
]
|
||||
"exclude": ["node_modules"],
|
||||
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"]
|
||||
}
|
||||
|
||||
3
packages/utils/src/arrayHelpers.ts
Normal file
3
packages/utils/src/arrayHelpers.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
export function isNotNullOrUndefined<T>(x: T | undefined | null): x is T {
|
||||
return x !== undefined && x !== null;
|
||||
}
|
||||
@@ -1,3 +1,5 @@
|
||||
import * as did from './did';
|
||||
|
||||
export { did };
|
||||
export * from './arrayHelpers';
|
||||
export * from './promiseHelpers';
|
||||
|
||||
11
packages/utils/src/promiseHelpers.ts
Normal file
11
packages/utils/src/promiseHelpers.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
export function isFulfilled<T>(
|
||||
item: PromiseSettledResult<T>,
|
||||
): item is PromiseFulfilledResult<T> {
|
||||
return item.status === 'fulfilled';
|
||||
}
|
||||
|
||||
export function isRejected<T>(
|
||||
item: PromiseSettledResult<T>,
|
||||
): item is PromiseRejectedResult {
|
||||
return item.status === 'rejected';
|
||||
}
|
||||
@@ -5,6 +5,7 @@
|
||||
"module": "esnext",
|
||||
"allowJs": true,
|
||||
"isolatedModules": true,
|
||||
"tsBuildInfoFile": "out/.tsbuildinfo",
|
||||
"jsx": "preserve",
|
||||
"lib": ["dom", "es2017"],
|
||||
"baseUrl": ".",
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
"compilerOptions": {
|
||||
"module": "esnext",
|
||||
"target": "es6",
|
||||
"lib": ["esnext"],
|
||||
"moduleResolution": "node",
|
||||
"jsx": "react",
|
||||
"outDir": "./dist",
|
||||
@@ -10,6 +11,7 @@
|
||||
"declaration": true,
|
||||
"declarationMap": true,
|
||||
"sourceMap": true,
|
||||
"incremental": true,
|
||||
"noUnusedLocals": true,
|
||||
"noUnusedParameters": true,
|
||||
"noImplicitReturns": true,
|
||||
|
||||
Reference in New Issue
Block a user