Changeset e29cc2e for trip-planner-front/node_modules/lilconfig
- Timestamp:
- 11/25/21 22:08:24 (3 years ago)
- Branches:
- master
- Children:
- 8d391a1
- Parents:
- 59329aa
- Location:
- trip-planner-front/node_modules/lilconfig
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trip-planner-front/node_modules/lilconfig/dist/index.js
r59329aa re29cc2e 135 135 async load(filepath) { 136 136 validateFilePath(filepath); 137 const { base, ext } = path.parse(filepath); 137 const absPath = path.resolve(process.cwd(), filepath); 138 const { base, ext } = path.parse(absPath); 138 139 const loaderKey = ext || 'noExt'; 139 140 const loader = loaders[loaderKey]; 140 141 validateLoader(loader, loaderKey); 141 const content = String(await fsReadFileAsync( filepath));142 const content = String(await fsReadFileAsync(absPath)); 142 143 if (base === 'package.json') { 143 const pkg = await loader( filepath, content);144 const pkg = await loader(absPath, content); 144 145 return transform({ 145 146 config: getPackageProp(packageProp, pkg), 146 filepath ,147 }); 148 } 149 const result = { 150 config: null, 151 filepath ,147 filepath: absPath, 148 }); 149 } 150 const result = { 151 config: null, 152 filepath: absPath, 152 153 }; 153 154 const isEmpty = content.trim() === ''; … … 155 156 return transform({ 156 157 config: undefined, 157 filepath ,158 filepath: absPath, 158 159 isEmpty: true, 159 160 }); 160 161 result.config = isEmpty 161 162 ? undefined 162 : await loader( filepath, content);163 : await loader(absPath, content); 163 164 return transform(isEmpty ? { ...result, isEmpty, config: undefined } : result); 164 165 }, … … 215 216 load(filepath) { 216 217 validateFilePath(filepath); 217 const { base, ext } = path.parse(filepath); 218 const absPath = path.resolve(process.cwd(), filepath); 219 const { base, ext } = path.parse(absPath); 218 220 const loaderKey = ext || 'noExt'; 219 221 const loader = loaders[loaderKey]; 220 222 validateLoader(loader, loaderKey); 221 const content = String(fs.readFileSync( filepath));223 const content = String(fs.readFileSync(absPath)); 222 224 if (base === 'package.json') { 223 const pkg = loader( filepath, content);225 const pkg = loader(absPath, content); 224 226 return transform({ 225 227 config: getPackageProp(packageProp, pkg), 226 filepath ,227 }); 228 } 229 const result = { 230 config: null, 231 filepath ,228 filepath: absPath, 229 }); 230 } 231 const result = { 232 config: null, 233 filepath: absPath, 232 234 }; 233 235 const isEmpty = content.trim() === ''; 234 236 if (isEmpty && ignoreEmptySearchPlaces) 235 237 return transform({ 236 filepath ,238 filepath: absPath, 237 239 config: undefined, 238 240 isEmpty: true, 239 241 }); 240 result.config = isEmpty ? undefined : loader( filepath, content);242 result.config = isEmpty ? undefined : loader(absPath, content); 241 243 return transform(isEmpty ? { ...result, isEmpty, config: undefined } : result); 242 244 }, -
trip-planner-front/node_modules/lilconfig/package.json
r59329aa re29cc2e 1 1 { 2 "_args": [ 3 [ 4 "lilconfig@2.0.3", 5 "C:\\Users\\DELL\\Desktop\\bachelor-thesis\\trip-planner-front" 6 ] 7 ], 8 "_development": true, 9 "_from": "lilconfig@2.0.3", 10 "_id": "lilconfig@2.0.3", 2 "_from": "lilconfig@^2.0.3", 3 "_id": "lilconfig@2.0.4", 11 4 "_inBundle": false, 12 "_integrity": "sha512- EHKqr/+ZvdKCifpNrJCKxBTgk5XupZA3y/aCPY9mxfgBzmgh93Mt/WqjjQ38oMxXuvDokaKiM3lAgvSH2sjtHg==",5 "_integrity": "sha512-bfTIN7lEsiooCocSISTWXkiWJkRqtL9wYtYy+8EK3Y41qh3mpwPU0ycTOgjdY9ErwXCc8QyrQp82bdL0Xkm9yA==", 13 6 "_location": "/lilconfig", 14 7 "_phantomChildren": {}, 15 8 "_requested": { 16 "type": " version",9 "type": "range", 17 10 "registry": true, 18 "raw": "lilconfig@ 2.0.3",11 "raw": "lilconfig@^2.0.3", 19 12 "name": "lilconfig", 20 13 "escapedName": "lilconfig", 21 "rawSpec": " 2.0.3",14 "rawSpec": "^2.0.3", 22 15 "saveSpec": null, 23 "fetchSpec": " 2.0.3"16 "fetchSpec": "^2.0.3" 24 17 }, 25 18 "_requiredBy": [ 26 19 "/cssnano" 27 20 ], 28 "_resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-2.0.3.tgz", 29 "_spec": "2.0.3", 30 "_where": "C:\\Users\\DELL\\Desktop\\bachelor-thesis\\trip-planner-front", 21 "_resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-2.0.4.tgz", 22 "_shasum": "f4507d043d7058b380b6a8f5cb7bcd4b34cee082", 23 "_spec": "lilconfig@^2.0.3", 24 "_where": "C:\\Users\\DELL\\Desktop\\bachelor-thesis\\trip-planner-front\\node_modules\\cssnano", 31 25 "author": { 32 26 "name": "antonk52" … … 35 29 "url": "https://github.com/antonk52/lilconfig/issues" 36 30 }, 31 "bundleDependencies": false, 32 "deprecated": false, 37 33 "description": "A zero-dependency alternative to cosmiconfig", 38 34 "devDependencies": { 39 "@types/jest": "^2 6.0.23",35 "@types/jest": "^27.0.2", 40 36 "@types/node": "^14.17.2", 41 "@typescript-eslint/eslint-plugin": "^ 4.26.0",42 "@typescript-eslint/parser": "^ 4.26.0",43 "cosmiconfig": " 7.0.0",44 "eslint": "^ 7.28.0",37 "@typescript-eslint/eslint-plugin": "^5.3.0", 38 "@typescript-eslint/parser": "^5.3.0", 39 "cosmiconfig": "^7.0.1", 40 "eslint": "^8.1.0", 45 41 "eslint-config-prettier": "^8.3.0", 46 "eslint-plugin-prettier": "^ 3.4.0",47 "jest": "^2 6.6.3",48 "prettier": "^2. 3.1",49 "ts-jest": "^2 6.5.6",50 "typescript": "^4. 3.2"42 "eslint-plugin-prettier": "^4.0.0", 43 "jest": "^27.3.1", 44 "prettier": "^2.4.1", 45 "ts-jest": "^27.0.7", 46 "typescript": "^4.4.4" 51 47 }, 52 48 "engines": { … … 79 75 }, 80 76 "types": "dist/index.d.ts", 81 "version": "2.0. 3"77 "version": "2.0.4" 82 78 } -
trip-planner-front/node_modules/lilconfig/readme.md
r59329aa re29cc2e 68 68 import yaml from 'yaml'; 69 69 70 function loadYaml(filepath, content) { 71 return yaml.parse(content); 72 } 73 70 74 const options = { 71 75 loaders: { 72 '.yaml': (filepath, content) => { 73 return yaml.parse(content); 74 }, 76 '.yaml': loadYaml, 77 '.yml': loadYaml, 75 78 // loader for files with no extension 76 noExt: (filepath, content) => { 77 return yaml.parse(content); 78 } 79 noExt: loadYaml 79 80 } 80 81 };
Note:
See TracChangeset
for help on using the changeset viewer.