Socket
Socket
Sign inDemoInstall

unconfig

Package Overview
Dependencies
Maintainers
1
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

unconfig - npm Package Compare versions

Comparing version 0.0.0 to 0.0.1

47

dist/index.d.ts

@@ -1,6 +0,29 @@

interface LoadConfigSource {
declare const defaultExtensions: string[];
declare type ConfigLoaderType = 'bundle' | 'json';
interface LoadConfigSource<T = any> {
files: string[];
rewrite: (obj: any, filepath: string) => Promise<any> | any;
/**
* @default ['mts', 'cts', 'ts', 'mjs', 'cjs', 'js', 'json', '']
*/
extensions?: string[];
/**
* Loader for loading config,
*
* @default 'auto'
*/
loader?: ConfigLoaderType | 'auto';
/**
* Rewrite the config object
*/
rewrite?: <F = any>(obj: F, filepath: string, loader: ConfigLoaderType) => Promise<T | undefined> | T | undefined;
}
interface LoadConfigOptions {
interface SearchOptions {
/**
* Root directory
*
* @default process.cwd()
*/
cwd?: string;
}
interface LoadConfigOptions extends SearchOptions {
sources: LoadConfigSource[];

@@ -10,8 +33,20 @@ }

config: T;
filename: string;
filepath: string;
dependencies?: string[];
mtime: number;
}
interface LoadVitePluginConfigOptions {
pluginNames: string[];
}
interface LoadObjectFieldOptions {
fields: string[];
}
declare function loadVitePluginConfig(options: LoadVitePluginConfigOptions): LoadConfigSource;
declare function loadViteConfigFields(options: LoadObjectFieldOptions): LoadConfigSource;
declare function loadPackageJsonFields(options: LoadObjectFieldOptions): LoadConfigSource;
declare function loadConfig<T>(options?: LoadConfigOptions): Promise<LoadConfigResult<T> | undefined>;
declare function loadConfigFromSource<T>(source: LoadConfigSource): Promise<LoadConfigResult<T> | undefined>;
declare function loadConfigFromSource<T>(source: LoadConfigSource<T>, search?: SearchOptions): Promise<LoadConfigResult<T> | undefined>;
export { LoadConfigOptions, LoadConfigResult, LoadConfigSource, loadConfig, loadConfigFromSource };
export { ConfigLoaderType, LoadConfigOptions, LoadConfigResult, LoadConfigSource, LoadObjectFieldOptions, LoadVitePluginConfigOptions, SearchOptions, defaultExtensions, loadConfig, loadConfigFromSource, loadPackageJsonFields, loadViteConfigFields, loadVitePluginConfig };

26

package.json
{
"name": "unconfig",
"version": "0.0.0",
"version": "0.0.1",
"description": "Load config universally",

@@ -31,11 +31,2 @@ "keywords": [],

],
"scripts": {
"build": "unbuild",
"dev": "unbuild --stub",
"lint": "eslint \"{src,test}/**/*.ts\"",
"prepublishOnly": "nr build",
"release": "bumpp --commit --push --tag && pnpm publish",
"start": "esno src/index.ts",
"test": "jest"
},
"devDependencies": {

@@ -50,3 +41,2 @@ "@antfu/eslint-config": "^0.11.1",

"esno": "^0.12.1",
"find-up": "^6.2.0",
"jest": "^27.3.1",

@@ -56,3 +46,15 @@ "ts-jest": "^27.0.7",

"unbuild": "^0.5.13"
},
"dependencies": {
"find-up": "^5.0",
"bundle-require": "^2.1.8"
},
"scripts": {
"build": "unbuild",
"dev": "unbuild --stub",
"lint": "eslint \"{src,test}/**/*.ts\"",
"release": "bumpp --commit --push --tag && pnpm publish",
"start": "esno src/index.ts",
"test": "jest"
}
}
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc