拿掉 build files

This commit is contained in:
2022-07-18 16:33:23 +08:00
parent 41e2287bcb
commit 3707f158a3
31953 changed files with 0 additions and 4411796 deletions
-39
View File
@@ -1,39 +0,0 @@
# Assert Never [![npm version][npm-image]][npm-url]
Helper function for [exhaustive checks][exhaustive-checks] of discriminated
unions in TypeScript.
## Installation
```
npm install --save assert-never
```
## Usage
```ts
import {assertNever} from "assert-never";
type A = {type: 'a'};
type B = {type: 'b'};
type Union = A | B;
function doSomething(arg: Union) {
if (arg.type === 'a') {
return something;
}
if (arg.type === 'b') {
return somethingElse;
}
// TS will error if there are other types in the union
// Will throw an Error when called at runtime. Use `assertNever(arg, true)`
// instead to fail silently.
return assertNever(arg);
}
```
[npm-image]: https://badge.fury.io/js/assert-never.svg
[npm-url]: https://badge.fury.io/js/assert-never
[exhaustive-checks]: https://basarat.gitbooks.io/typescript/docs/types/discriminated-unions.html#exhaustive-checks
-27
View File
@@ -1,27 +0,0 @@
/**
* Helper function for exhaustive checks of discriminated unions.
* https://basarat.gitbooks.io/typescript/docs/types/discriminated-unions.html
*
* @example
*
* type A = {type: 'a'};
* type B = {type: 'b'};
* type Union = A | B;
*
* function doSomething(arg: Union) {
* if (arg.type === 'a') {
* return something;
* }
*
* if (arg.type === 'b') {
* return somethingElse;
* }
*
* // TS will error if there are other types in the union
* // Will throw an Error when called at runtime.
* // Use `assertNever(arg, true)` instead to fail silently.
* return assertNever(arg);
* }
*/
export declare function assertNever(value: never, noThrow?: boolean): never;
export default assertNever;
-35
View File
@@ -1,35 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/**
* Helper function for exhaustive checks of discriminated unions.
* https://basarat.gitbooks.io/typescript/docs/types/discriminated-unions.html
*
* @example
*
* type A = {type: 'a'};
* type B = {type: 'b'};
* type Union = A | B;
*
* function doSomething(arg: Union) {
* if (arg.type === 'a') {
* return something;
* }
*
* if (arg.type === 'b') {
* return somethingElse;
* }
*
* // TS will error if there are other types in the union
* // Will throw an Error when called at runtime.
* // Use `assertNever(arg, true)` instead to fail silently.
* return assertNever(arg);
* }
*/
function assertNever(value, noThrow) {
if (noThrow) {
return value;
}
throw new Error("Unhandled discriminated union member: " + JSON.stringify(value));
}
exports.assertNever = assertNever;
exports.default = assertNever;
-36
View File
@@ -1,36 +0,0 @@
/**
* Helper function for exhaustive checks of discriminated unions.
* https://basarat.gitbooks.io/typescript/docs/types/discriminated-unions.html
*
* @example
*
* type A = {type: 'a'};
* type B = {type: 'b'};
* type Union = A | B;
*
* function doSomething(arg: Union) {
* if (arg.type === 'a') {
* return something;
* }
*
* if (arg.type === 'b') {
* return somethingElse;
* }
*
* // TS will error if there are other types in the union
* // Will throw an Error when called at runtime.
* // Use `assertNever(arg, true)` instead to fail silently.
* return assertNever(arg);
* }
*/
export function assertNever(value: never, noThrow?: boolean): never {
if (noThrow) {
return value
}
throw new Error(
`Unhandled discriminated union member: ${JSON.stringify(value)}`,
);
}
export default assertNever;
-67
View File
@@ -1,67 +0,0 @@
{
"_args": [
[
"assert-never@1.2.1",
"/mnt/Foxconn/Digitalent/Deverloper/liff-push_2series"
]
],
"_development": true,
"_from": "assert-never@1.2.1",
"_id": "assert-never@1.2.1",
"_inBundle": false,
"_integrity": "sha512-TaTivMB6pYI1kXwrFlEhLeGfOqoDNdTxjCdwRfFFkEA30Eu+k48W34nlok2EYWJfFFzqaEmichdNM7th6M5HNw==",
"_location": "/assert-never",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "assert-never@1.2.1",
"name": "assert-never",
"escapedName": "assert-never",
"rawSpec": "1.2.1",
"saveSpec": null,
"fetchSpec": "1.2.1"
},
"_requiredBy": [
"/with"
],
"_resolved": "https://registry.npmjs.org/assert-never/-/assert-never-1.2.1.tgz",
"_spec": "1.2.1",
"_where": "/mnt/Foxconn/Digitalent/Deverloper/liff-push_2series",
"author": {
"name": "Daniel Lytkin",
"email": "dan.lytkin@gmail.com"
},
"bugs": {
"url": "https://github.com/aikoven/assert-never/issues"
},
"description": "Helper function for exhaustive checks of discriminated unions in TypeScript",
"devDependencies": {
"typescript": "^2.2.1"
},
"files": [
"index.js",
"index.ts",
"index.d.ts"
],
"homepage": "https://github.com/aikoven/assert-never#readme",
"keywords": [
"typescript",
"discriminated unions",
"assert",
"never"
],
"license": "MIT",
"main": "index.js",
"name": "assert-never",
"repository": {
"type": "git",
"url": "git+https://github.com/aikoven/assert-never.git"
},
"scripts": {
"build": "tsc",
"prepublish": "npm run build"
},
"typings": "index.d.ts",
"version": "1.2.1"
}