New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

ts-options-defaults

Package Overview
Dependencies
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ts-options-defaults - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3-0

scripts/build.ts

9

package.json
{
"name": "ts-options-defaults",
"version": "0.0.2",
"version": "0.0.3-0",
"license": "GPL-3.0",

@@ -9,9 +9,12 @@ "author": "Artur Kurowski <radarsu@gmail.com>",

"types": "dist/index.d.ts",
"scripts": {},
"dependencies": {},
"devDependencies": {
"@radrat/cli": "0.0.15",
"@radrat/cli": "0.0.21-0",
"@types/node": "^14.0.22",
"chalk": "^4.1.0",
"find-up": "^4.1.0",
"ts-essentials": "^7.0.0",
"ts-import": "0.0.8",
"typescript": "^3.9.5"
}
}
import { IRadratCli } from '@radrat/cli';
import { packageScripts } from '../../tools/rr/package';
import * as findUpLib from 'find-up';
import * as path from 'path';
import { tsImport } from 'ts-import';
const scripts = async (cli: IRadratCli) => {
const nodeModules = path.resolve(process.cwd(), `node_modules`);
const findUp: typeof findUpLib = await import(`${nodeModules}/find-up`);
const scope = `ts-options-defaults`;
const appRootPackageJson = await findUp(`workspace.json`);
const appRoot = path.dirname(appRootPackageJson);
const absolutePackagePath = path.resolve(appRoot, `./tools/rr/package.ts`);
const packageScripts = (await tsImport.compile(absolutePackagePath)).default;
await packageScripts(cli, scope);

@@ -7,0 +15,0 @@ };

@@ -15,3 +15,3 @@ export const merge = (object: any, ...sources: any[]) => {

// Handle objects.
// Handle empty objects.
if (!object[key]) {

@@ -21,2 +21,3 @@ object[key] = {};

// Handle objects.
merge(object[key], value);

@@ -23,0 +24,0 @@ });

import { defaults } from '../src';
const someDefaults = {
console,
some: {

@@ -28,3 +29,13 @@ nested: {

const options = defaults(someDefaults, someOptionsOne, someOptionsTwo);
console.log(JSON.stringify(options, undefined, 4));
const options = defaults(someDefaults, someOptionsOne, someOptionsTwo, {
console: {
log: () => {
console.log(`TEST`);
},
},
});
options.console.log(`log`);
options.console.debug(`debug`);
console.log(options);
{
"compilerOptions": {
"baseUrl": ".",
"declaration": true,
"downlevelIteration": true,
"module": "commonjs",
"outDir": "./dist",
"resolveJsonModule": true,
"rootDir": "./src"
},
"exclude": ["node_modules", "dist", "scripts", "scripts.ts", "tests"]
"extends": "../tsconfig.json"
}
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