commit 6651f155de0505370439a5ef02fb084da675bca5 Author: kric_jspark Date: Tue Jun 30 12:15:32 2026 +0900 feat: initialize @kri/common package diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9e5d337 --- /dev/null +++ b/.gitignore @@ -0,0 +1,10 @@ +node_modules/ +dist/ +*.tgz + +.idea/ +.vscode/ + +.env +.env.* +!.env.example \ No newline at end of file diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..51e501c --- /dev/null +++ b/package-lock.json @@ -0,0 +1,30 @@ +{ + "name": "@kri/common", + "version": "0.1.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "@kri/common", + "version": "0.1.0", + "license": "UNLICENSED", + "devDependencies": { + "typescript": "^6.0.3" + } + }, + "node_modules/typescript": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-6.0.3.tgz", + "integrity": "sha512-y2TvuxSZPDyQakkFRPZHKFm+KKVqIisdg9/CZwm9ftvKXLP8NRWj38/ODjNbr43SsoXqNuAisEf1GdCxqWcdBw==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..5ddd075 --- /dev/null +++ b/package.json @@ -0,0 +1,41 @@ +{ + "name": "@kri/common", + "version": "0.1.0", + "description": "KRI 프런트엔드 공통 유틸리티", + "type": "module", + + "main": "./dist/index.js", + "types": "./dist/index.d.ts", + + "exports": { + ".": { + "types": "./dist/index.d.ts", + "import": "./dist/index.js", + "default": "./dist/index.js" + } + }, + + "files": [ + "dist" + ], + + "scripts": { + "build": "tsc", + "typecheck": "tsc --noEmit", + "prepack": "npm run build" + }, + + "keywords": [ + "kri", + "common", + "typescript" + ], + + "author": "KRI", + "license": "UNLICENSED", + "private": false, + + "devDependencies": { + "typescript": "^6.0.3" + } +} \ No newline at end of file diff --git a/src/index.ts b/src/index.ts new file mode 100644 index 0000000..8b5ffd7 --- /dev/null +++ b/src/index.ts @@ -0,0 +1,10 @@ +/** + * 문자열이 null, undefined 또는 공백인지 확인한다. + */ +export function isBlank( + value: string | null | undefined, +): boolean { + return value === null + || value === undefined + || value.trim().length === 0; +} \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..0ce3bf9 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,29 @@ +{ + "compilerOptions": { + "target": "ES2022", + "module": "NodeNext", + "moduleResolution": "NodeNext", + + "rootDir": "./src", + "outDir": "./dist", + + "declaration": true, + "declarationMap": true, + "sourceMap": true, + + "strict": true, + "noUncheckedIndexedAccess": true, + "exactOptionalPropertyTypes": true, + + "verbatimModuleSyntax": true, + "skipLibCheck": true, + "forceConsistentCasingInFileNames": true + }, + "include": [ + "src/**/*.ts" + ], + "exclude": [ + "node_modules", + "dist" + ] +} \ No newline at end of file