Skip to content

Commit

Permalink
fix: typings error, publish on 16
Browse files Browse the repository at this point in the history
  • Loading branch information
purplecabbage committed Aug 18, 2022
1 parent 2b0b329 commit 11816a3
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 73 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/on-push-publish-to-npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 10
node-version: 16
- run: npm install
- run: npm test
- uses: JS-DevTools/npm-publish@v1
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@
"eslint-plugin-node": "^11.0.0",
"eslint-plugin-promise": "^4.0.1",
"eslint-plugin-standard": "^4.0.0",
"jest": "^24.5.0",
"jest": "^24.9.0",
"jest-plugin-fs": "^2.9.0",
"jsdoc-to-markdown": "^5.0.1",
"jsdoc-to-markdown": "^5.0.3",
"mock-stdin": "^1.0.0",
"tsd-jsdoc": "^2.4.0"
}
Expand Down
6 changes: 0 additions & 6 deletions src/dotenv.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,6 @@ const clear = () => {
}
}

/**
* hoists variables in the ./.env file to process.env
*
* @param {Function} debug optional function for debugging
*
*/
module.exports = function(force = false) {
const file = path.join(process.cwd(), '.env')
if (force || global[envFile] !== file) {
Expand Down
3 changes: 0 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,4 @@ class ConfigAPI {
}
}

/**
* @returns {ConfigAPI}
*/
module.exports = new ConfigAPI()
3 changes: 0 additions & 3 deletions src/pipe.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ governing permissions and limitations under the License.

const status = Symbol.for('aio-cli-config.pipe')

/**
* get piped data from stdin
*/
module.exports = () => new Promise((resolve) => {
if (global[status] || process.stdin.isTTY) return resolve(global[status])

Expand Down
76 changes: 18 additions & 58 deletions types.d.ts
Original file line number Diff line number Diff line change
@@ -1,25 +1,23 @@
/**
* read a file and log exceptions to debug
*
* @param {String} file
* @param {Function} debugFn
*/
declare function readFile(file: string, debugFn: (...params: any[]) => any): void;

/**
* parse file for environmental variables
*
* @param {String} file filepath to parse
* @param file - filepath to parse
*/
declare function parse(file: string): void;

/**
* parse file for environmental variables and log debug message for duplicate definitions
* @param file - filepath to parse
*/
declare function checkForDuplicates(file: string): void;

/**
* returns all keys in o1 that arent in o2
*
* @param {Object} o1
* @param {Object} o2
*
* @return {Array} array of keys
* @returns array of keys
*/
declare function diff(o1: any, o2: any): any[];

Expand All @@ -35,24 +33,21 @@ declare class ConfigAPI {
/**
* Gets the value for a key in the Config.
* If no parameters are specified, it will return all keys and values of the consolidated Config.
*
* @param {string} [key=''] the key to get the value from
* @param {string} [source] 'global', 'local', or 'env'. Defaults to searching the consolidated config.
* @param [key = ''] - the key to get the value from
* @param [source] - 'global', 'local', or 'env'. Defaults to searching the consolidated config.
*/
get(key?: string, source?: string): void;
/**
* Set the value for a key in the Config.
*
* @param {string} key the key to set the value to
* @param {string} value the value to save for the key
* @param {boolean} [local=false] Set to true to save the value in the local config. Defaults to false (save to global config).
* @param key - the key to set the value to
* @param value - the value to save for the key
* @param [local = false] - Set to true to save the value in the local config. Defaults to false (save to global config).
*/
set(key: string, value: string, local?: boolean): void;
/**
* Delete a key and its value in the Config.
*
* @param {string} key the key to delete the value from
* @param {boolean} [local=false] Set to true to delete the value in the local config. Defaults to false (save to global config).
* @param key - the key to delete the value from
* @param [local = false] - Set to true to delete the value in the local config. Defaults to false (save to global config).
*/
delete(key: string, local?: boolean): void;
/**
Expand All @@ -61,89 +56,54 @@ declare class ConfigAPI {
reload(): void;
/**
* Pipe data from stdin.
*
* @function
* @return {Promise<string>}
*/
getPipedData(): Promise<string>;
/**
* Hoists variables in the ./.env file to process.env
*
* @function
* @param {Object} the dotenv object
* @param the - dotenv object
*/
dotenv(the: any): void;
}

/**
* Support for mkdir -p.
*
* @param {String} dir the folder to create
* @param dir - the folder to create
*/
declare function mkdirp(dir: string): void;

/**
* Get property from object with case insensitivity.
*
* @param {Object} obj
* @param {String} key
*/
declare function getProp(obj: any, key: string): void;

/**
* Get a value in an object by dot notation.
*
* @param {String} key
* @param {Object} obj
*
* @return {Object}
*/
declare function getValue(key: string, obj: any): any;

/**
* Set a value by dot notation.
*
* @param {String} key
* @param {String} value
* @param {Object} [obj]
*
* @return {Object}
*/
declare function setValue(key: string, value: string, obj?: any): any;

/**
* Deep merge a collection of objs returning a new object.
*
* @param {Array} objs array of objects
*
* @return {Object}
* @param objs - array of objects
*/
declare function merge(...objs: any[][]): any;

/**
* Remove empty leaves from an object.
*
* @param {Object} obj
*
* @return {Object}
*/
declare function shake(obj: any): any;

/**
* Deserialise from a file.
*
* @param {String} file
*
* @return {Object}
*/
declare function loadFile(file: string): any;

/**
* yaml serialise an object to a file.
*
* @param {String} file
* @param {Object} obj
* @param {String} format
*/
declare function saveFile(file: string, obj: any, format: string): void;

0 comments on commit 11816a3

Please sign in to comment.