Table of Contents

TypeScript

Quick Start

Setup

npm i -D typescript  // devDependency로 설치
npm i -g typescript  // global로 설치
Set-ExecutionPolicy Unrestricted
npx tsc myFirstTypescript.ts  // devDependency로 설치 시
tsc myFirstTypescript.ts  // global 설치 시
tsc --init

tsconfig.json
1
2
"outDir": "./dist",
"rootDir": "./src",

TSLint 설치

npm i -g tslint  // tslint package module 설치
tslint --init

tsconfig.json
1
2
3
4
5
6
7
{
  ...
  "rules": {
    "semicolon": true
  },
  ...
}

.settings
1
2
"editor.formatOnSave": false,
"tslint.autoFixOnSave": true,

Prettier 설치

npm i tslint-config-prettier  // 패키지 설치 후 아래 진행

tslint.json
1
2
3
4
5
{
  ...
  "extends": ["tslint:recommended", "tslint-config-prettier"],
  ...
}

.settings
1
2
3
editor.formatOnSave: true
...
"prettier.tslintIntegration": true

Fundamentals

ramda 패키지가 제공하는 함수 구분
구분 내용
함수(function) R.compose, R.pipe, R.curry 등 52개 함수
리스트(list) 배열을 대상으로 하는 R.map, R.filter, R.reduce 등
로직(logic) R.not, R.or, R.cond 등 불리언 로직 관련
수학(math) R.add, R.subtract, R.multiply, R.divide 등 수 관련
객체(object) R.prop, R.lens 등 객체와 렌즈 관련
관계(relation) R.lt, R.lte, R.gt, R.gte 등 두 값의 관계를 파악
문자열(string) R.match, R.replace, R.split 등 문자열을 대상으로 정규식(regular expression) 등
타입(type) R.is, R.isNil, R.type 등 대상의 타입을 파악

*조합자 combinator

람다가 제공하는 조합자
조합자 이름 의미 람다 함수 이름
I identity R.identity
K constant R.always
T thrush R.applyTo
W duplication R.unnest
C flip R.flip
S substitution R.ap

Examples

value 값으로 key 값 찾기
1
this.listJoinPath[Object.keys(this.listJoinPath).find(key => this.listJoinPath[key].dtlCd === thisjoinPathCd)].joinPathCont

References