1 2 3 4 5 6 7 |
$ npm i -g typescript # install globally, use $ tsc <typescript file> # or $ npm i -D typescript # install devDependency, use $ npx tsc <typescript file> $ npm ls -g --depth=0 # 확인 $ tsc - v # global $ npx tsc - v # local |
1 |
$ npm i tslint-config-prettier |
1 2 3 4 5 6 7 8 9 |
{ "defaultSeverity" : "error" , "extends" : [ "tslint:latest" , "tslint-config-prettier" ], "jsRules" : {}, "rules" : { "semicolon" : true }, "rulesDirectory" : [] } |
1 |
$ tsc --init |
1 2 3 4 5 6 7 8 9 |
"prettier" : { "printWidth" : 80, "useTabs" : false , "tabWidth" : 2, "bracketSpacing" : true , "semi" : true , "singleQuote" : false } } |
1 2 |
$ npm install -g ts-node # global $ npm install --save-dev ts-node # local |
$ npm init -y # create package.json in node.js project $ npm install typescript --save-dev # add typescript $ npm install @types/node --save-dev # add node.d.ts $ npx tsc --init --rootDir src --outDir lib --esModuleInterop --resolveJsonModule --lib es6,dom --module commonjs # initialize typescript with tsconfig.json $ npm install ts-node --save-dev # to support realtime compile using ts-node $ npm install nodemon --save-dev # monitoring file change using nodemon
$ npm start
npm i -D typescript // devDependency로 설치 npm i -g typescript // global로 설치
Set-ExecutionPolicy Unrestricted
npx tsc myFirstTypescript.ts // devDependency로 설치 시 tsc myFirstTypescript.ts // global 설치 시
tsc --init
1 2 |
"outDir" : "./dist" , "rootDir" : "./src" , |
npm i -g tslint // tslint package module 설치
tslint --init
1 2 3 4 5 6 7 |
{ ... "rules" : { "semicolon" : true }, ... } |
1 2 |
"editor.formatOnSave" : false , "tslint.autoFixOnSave" : true , |
npm i tslint-config-prettier // 패키지 설치 후 아래 진행
1 2 3 4 5 |
{ ... "extends" : [ "tslint:recommended" , "tslint-config-prettier" ], ... } |
1 2 3 |
editor.formatOnSave: true ... "prettier.tslintIntegration" : true |
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 |
1 |
this .listJoinPath[Object.keys( this .listJoinPath).find(key => this .listJoinPath[key].dtlCd === thisjoinPathCd)].joinPathCont |