Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

biewangle

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

biewangle - npm Package Compare versions

Comparing version 1.0.9 to 1.0.10

2

lib/cjs/SettingField.d.ts

@@ -12,3 +12,3 @@ import { SettingType } from "./SettingManagerFactory";

export declare function isString<T>(field: SettingField<T>): field is string;
export declare function parseToSettingFieldOption<T>(key: string, defaultValue?: T): SettingFieldOption<T>;
export declare function parseToSettingFieldOption<T>(key: string, referenceObj?: any, defaultValue?: T): SettingFieldOption<T>;
export {};

@@ -26,5 +26,18 @@ "use strict";

exports.isString = isString;
function parseToSettingFieldOption(key, defaultValue) {
function parseToSettingFieldOption(key, referenceObj, defaultValue) {
let type = 'String';
if (referenceObj && referenceObj[key]) {
const referenceValue = referenceObj[key];
if (Array.isArray(referenceValue)) {
type = 'Array';
}
else if (typeof referenceValue == 'boolean') {
type = 'Boolean';
}
else if (Number.isInteger(referenceValue)) {
type = 'Integer';
}
}
return {
type: 'String',
type: type,
key: key,

@@ -31,0 +44,0 @@ defaultValue: defaultValue

@@ -84,3 +84,3 @@ "use strict";

const configObject = settingFields.reduce((obj, f) => {
const field = (0, SettingField_1.isSettingFieldOption)(f) ? f : (0, SettingField_1.parseToSettingFieldOption)(f);
const field = (0, SettingField_1.isSettingFieldOption)(f) ? f : (0, SettingField_1.parseToSettingFieldOption)(f, overrideDefaultObj);
this.typeMap.set(field.key, (0, SettingField_1.getSettingType)(field.type));

@@ -87,0 +87,0 @@ obj[field.key] = getBestValue(field.key, field.defaultValue);

@@ -12,3 +12,3 @@ import { SettingType } from "./SettingManagerFactory";

export declare function isString<T>(field: SettingField<T>): field is string;
export declare function parseToSettingFieldOption<T>(key: string, defaultValue?: T): SettingFieldOption<T>;
export declare function parseToSettingFieldOption<T>(key: string, referenceObj?: any, defaultValue?: T): SettingFieldOption<T>;
export {};

@@ -26,5 +26,18 @@ "use strict";

exports.isString = isString;
function parseToSettingFieldOption(key, defaultValue) {
function parseToSettingFieldOption(key, referenceObj, defaultValue) {
let type = 'String';
if (referenceObj && referenceObj[key]) {
const referenceValue = referenceObj[key];
if (Array.isArray(referenceValue)) {
type = 'Array';
}
else if (typeof referenceValue == 'boolean') {
type = 'Boolean';
}
else if (Number.isInteger(referenceValue)) {
type = 'Integer';
}
}
return {
type: 'String',
type: type,
key: key,

@@ -31,0 +44,0 @@ defaultValue: defaultValue

@@ -84,3 +84,3 @@ "use strict";

const configObject = settingFields.reduce((obj, f) => {
const field = (0, SettingField_1.isSettingFieldOption)(f) ? f : (0, SettingField_1.parseToSettingFieldOption)(f);
const field = (0, SettingField_1.isSettingFieldOption)(f) ? f : (0, SettingField_1.parseToSettingFieldOption)(f, overrideDefaultObj);
this.typeMap.set(field.key, (0, SettingField_1.getSettingType)(field.type));

@@ -87,0 +87,0 @@ obj[field.key] = getBestValue(field.key, field.defaultValue);

{
"name": "biewangle",
"version": "1.0.9",
"version": "1.0.10",
"description": "",

@@ -5,0 +5,0 @@ "main": "./lib/cjs/index.js",

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