Socket
Socket
Sign inDemoInstall

@xylabs/object

Package Overview
Dependencies
Maintainers
0
Versions
92
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@xylabs/object - npm Package Compare versions

Comparing version 3.6.7 to 3.6.8

12

package.json

@@ -14,9 +14,9 @@ {

"dependencies": {
"@xylabs/assert": "^3.6.7",
"@xylabs/logger": "^3.6.7",
"@xylabs/promise": "^3.6.7"
"@xylabs/assert": "^3.6.8",
"@xylabs/logger": "^3.6.8",
"@xylabs/promise": "^3.6.8"
},
"devDependencies": {
"@xylabs/ts-scripts-yarn3": "^3.15.4",
"@xylabs/tsconfig": "^3.15.4",
"@xylabs/ts-scripts-yarn3": "^3.15.5",
"@xylabs/tsconfig": "^3.15.5",
"typescript": "^5.5.4"

@@ -62,4 +62,4 @@ },

"sideEffects": false,
"version": "3.6.7",
"version": "3.6.8",
"type": "module"
}

@@ -138,4 +138,4 @@ import { assertEx } from '@xylabs/assert'

private static gcClass(className: BaseClassName) {
//remove all the weak refs that are now empty
this.globalInstances[className] = this.globalInstances[className]?.filter((ref) => ref.deref() !== null) ?? []
// remove all the weak refs that are now empty
this.globalInstances[className] = this.globalInstances[className]?.filter(ref => ref.deref() !== null) ?? []
}

@@ -142,0 +142,0 @@

@@ -6,2 +6,3 @@ import { TypedObject } from '@xylabs/promise'

// eslint-disable-next-line @typescript-eslint/no-empty-object-type
export interface ObjectTypeConfig extends TypeCheckConfig {}

@@ -16,3 +17,3 @@

return (
//do primary check
// do primary check
Object.entries(shape ?? {}).filter(([key, type]) => {

@@ -26,5 +27,5 @@ // eslint-disable-next-line @typescript-eslint/no-explicit-any

return !result
}).length === 0 &&
//perform additional checks
(additionalChecks?.reduce((prev, check) => prev && check(obj, { log }), true) ?? true)
}).length === 0
// perform additional checks
&& (additionalChecks?.reduce((prev, check) => prev && check(obj, { log }), true) ?? true)
)

@@ -31,0 +32,0 @@ }

@@ -18,7 +18,7 @@ export type FieldType = 'string' | 'number' | 'object' | 'symbol' | 'symbol' | 'undefined' | 'null' | 'array' | 'function'

case 'object': {
//nulls resolve to objects, so exclude them
// nulls resolve to objects, so exclude them
if (value === null) {
return false
}
//arrays resolve to objects, so exclude them
// arrays resolve to objects, so exclude them
return typeofValue === 'object' && !Array.isArray(value)

@@ -25,0 +25,0 @@ }

@@ -21,3 +21,3 @@ import { isObject } from './isObject.ts'

export const isJsonArray = (value: unknown): value is JsonArray => {
return Array.isArray(value) && !value.some((item) => !isJsonValue(item))
return Array.isArray(value) && !value.some(item => !isJsonValue(item))
}

@@ -31,6 +31,6 @@

return (
isObject(value) &&
//check if all keys are strings
!Object.entries(value).some((item) => !isValidJsonFieldPair(item))
isObject(value)
// check if all keys are strings
&& !Object.entries(value).some(item => !isValidJsonFieldPair(item))
)
}

@@ -9,2 +9,3 @@ import { EmptyObject } from './EmptyObject.ts'

}
protected get stringKeyObj() {

@@ -11,0 +12,0 @@ return this.obj as StringKeyObject

import { JsonArray, JsonObject, JsonValue } from './JsonObject.ts'
const toJsonArray = (value: unknown[], cycleList?: unknown[], maxDepth = 3): JsonArray => {
return value.map((item) => toJsonValue(item, cycleList, maxDepth))
return value.map(item => toJsonValue(item, cycleList, maxDepth))
}

@@ -6,0 +6,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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