Build NapCat Artifacts / Windows Loader Test (push) Canceled after 0s
Build NapCat Artifacts / Type Check & Test (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Framework (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Shell (push) Canceled after 0s
23 lines
875 B
Plaintext
23 lines
875 B
Plaintext
import { CreateType } from '../create/type.mjs';
|
|
import { Kind } from '../symbols/index.mjs';
|
|
// ------------------------------------------------------------------
|
|
// TypeGuard
|
|
// ------------------------------------------------------------------
|
|
import { IsOptional } from '../guard/kind.mjs';
|
|
function RequiredKeys(properties) {
|
|
const keys = [];
|
|
for (let key in properties) {
|
|
if (!IsOptional(properties[key]))
|
|
keys.push(key);
|
|
}
|
|
return keys;
|
|
}
|
|
/** `[Json]` Creates an Object type */
|
|
function _Object(properties, options) {
|
|
const required = RequiredKeys(properties);
|
|
const schematic = required.length > 0 ? { [Kind]: 'Object', type: 'object', properties, required } : { [Kind]: 'Object', type: 'object', properties };
|
|
return CreateType(schematic, options);
|
|
}
|
|
/** `[Json]` Creates an Object type */
|
|
export var Object = _Object;
|