Initialisation
Added the packages and files for the backend server
This commit is contained in:
21
node_modules/@apollo/utils.withrequired/LICENSE
generated
vendored
Normal file
21
node_modules/@apollo/utils.withrequired/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2022 Apollo Graph, Inc. (Formerly Meteor Development Group, Inc.)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
20
node_modules/@apollo/utils.withrequired/README.md
generated
vendored
Normal file
20
node_modules/@apollo/utils.withrequired/README.md
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
# WithRequired type
|
||||
|
||||
This package defines the TypeScript utility type `WithRequired`. It transforms a type that has one or more optional fields into a type where those fields are required.
|
||||
|
||||
For example:
|
||||
|
||||
```
|
||||
import { WithRequired } from '@apollo/utils.withrequired';
|
||||
|
||||
interface HasSomeOptionals {
|
||||
foo: number;
|
||||
bar?: string;
|
||||
baz?: boolean;
|
||||
quux?: string;
|
||||
}
|
||||
|
||||
type MoreRequired = WithRequired<HasSomeOptions, 'bar' | 'baz'>;
|
||||
```
|
||||
|
||||
The `MoreRequired` type is like `HasSomeOptionals`, but `bar` and `baz` are now required rather than optional. `quux` remains optional.
|
||||
2
node_modules/@apollo/utils.withrequired/dist/index.d.ts
generated
vendored
Normal file
2
node_modules/@apollo/utils.withrequired/dist/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
export type WithRequired<T, K extends keyof T> = T & Required<Pick<T, K>>;
|
||||
//# sourceMappingURL=index.d.ts.map
|
||||
1
node_modules/@apollo/utils.withrequired/dist/index.d.ts.map
generated
vendored
Normal file
1
node_modules/@apollo/utils.withrequired/dist/index.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC"}
|
||||
3
node_modules/@apollo/utils.withrequired/dist/index.js
generated
vendored
Normal file
3
node_modules/@apollo/utils.withrequired/dist/index.js
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
//# sourceMappingURL=index.js.map
|
||||
1
node_modules/@apollo/utils.withrequired/dist/index.js.map
generated
vendored
Normal file
1
node_modules/@apollo/utils.withrequired/dist/index.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
|
||||
23
node_modules/@apollo/utils.withrequired/package.json
generated
vendored
Normal file
23
node_modules/@apollo/utils.withrequired/package.json
generated
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"name": "@apollo/utils.withrequired",
|
||||
"version": "2.0.1",
|
||||
"description": "TypeScript utility type WithRequired",
|
||||
"main": "",
|
||||
"types": "dist/index.d.ts",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/apollographql/apollo-utils.git",
|
||||
"directory": "packages/withRequired/"
|
||||
},
|
||||
"keywords": [
|
||||
"apollo",
|
||||
"graphql",
|
||||
"typescript",
|
||||
"node"
|
||||
],
|
||||
"author": "Apollo <packages@apollographql.com>",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=14"
|
||||
}
|
||||
}
|
||||
29
node_modules/@apollo/utils.withrequired/src/__tests__/index.test.ts
generated
vendored
Normal file
29
node_modules/@apollo/utils.withrequired/src/__tests__/index.test.ts
generated
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
import type { WithRequired } from "..";
|
||||
|
||||
// This "test suite" actually does all its work at compile time.
|
||||
function isWRFoo(_: WRFoo) {}
|
||||
|
||||
interface Foo {
|
||||
alwaysOptional?: number;
|
||||
startsOutOptional?: number;
|
||||
alsoStartsOutOptional?: string;
|
||||
alwaysRequired: string;
|
||||
}
|
||||
|
||||
type WRFoo = WithRequired<Foo, "startsOutOptional" | "alsoStartsOutOptional">;
|
||||
|
||||
it("can plug in all now-required fields", () => {
|
||||
isWRFoo({
|
||||
startsOutOptional: 5,
|
||||
alsoStartsOutOptional: "asdf",
|
||||
alwaysRequired: "bla",
|
||||
});
|
||||
});
|
||||
|
||||
it("now-required fields are required", () => {
|
||||
// @ts-expect-error
|
||||
isWRFoo({
|
||||
startsOutOptional: 5,
|
||||
alwaysRequired: "bla",
|
||||
});
|
||||
});
|
||||
5
node_modules/@apollo/utils.withrequired/src/__tests__/tsconfig.json
generated
vendored
Normal file
5
node_modules/@apollo/utils.withrequired/src/__tests__/tsconfig.json
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"extends": "../../../../tsconfig.test.base",
|
||||
"include": ["**/*"],
|
||||
"references": [{ "path": "../../" }]
|
||||
}
|
||||
1
node_modules/@apollo/utils.withrequired/src/index.ts
generated
vendored
Normal file
1
node_modules/@apollo/utils.withrequired/src/index.ts
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export type WithRequired<T, K extends keyof T> = T & Required<Pick<T, K>>;
|
||||
Reference in New Issue
Block a user