Skip to content

Latest commit

 

History

27 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sudoo-Symbol

Continuous Integration codecov npm version downloads

Symbol Magic

Install

yarn add @sudoo/symbol
# Or
npm install @sudoo/symbol --save

Example

Symbol should be used as return values (and more!) to express more information from functions.

import { SEmptyReturn, EmptyReturnSymbol } from "@sudoo/symbol";

export const yourFunction = (arg: any): SEmptyReturn | AwesomeObject | null => {

    if (arg === null) {
        return null;
    }

    if (arg.hasNoData) {
        return EmptyReturnSymbol;
    }

    return arg.awesomeObject;
};

Note

Do not use @sudoo/symbol as required dependencies unless the project is not a package. Due to duplicated copy of package would cause type reference issue.

About

🔥 Symbol Magic

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages