This commit is contained in:
10
node_modules/property-information/lib/util/case-insensitive-transform.d.ts
generated
vendored
Normal file
10
node_modules/property-information/lib/util/case-insensitive-transform.d.ts
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
/**
|
||||
* @param {Record<string, string>} attributes
|
||||
* Attributes.
|
||||
* @param {string} property
|
||||
* Property.
|
||||
* @returns {string}
|
||||
* Transformed property.
|
||||
*/
|
||||
export function caseInsensitiveTransform(attributes: Record<string, string>, property: string): string;
|
||||
//# sourceMappingURL=case-insensitive-transform.d.ts.map
|
1
node_modules/property-information/lib/util/case-insensitive-transform.d.ts.map
generated
vendored
Normal file
1
node_modules/property-information/lib/util/case-insensitive-transform.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"case-insensitive-transform.d.ts","sourceRoot":"","sources":["case-insensitive-transform.js"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,qDAPW,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,YAEtB,MAAM,GAEJ,MAAM,CAKlB"}
|
13
node_modules/property-information/lib/util/case-insensitive-transform.js
generated
vendored
Normal file
13
node_modules/property-information/lib/util/case-insensitive-transform.js
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
import {caseSensitiveTransform} from './case-sensitive-transform.js'
|
||||
|
||||
/**
|
||||
* @param {Record<string, string>} attributes
|
||||
* Attributes.
|
||||
* @param {string} property
|
||||
* Property.
|
||||
* @returns {string}
|
||||
* Transformed property.
|
||||
*/
|
||||
export function caseInsensitiveTransform(attributes, property) {
|
||||
return caseSensitiveTransform(attributes, property.toLowerCase())
|
||||
}
|
10
node_modules/property-information/lib/util/case-sensitive-transform.d.ts
generated
vendored
Normal file
10
node_modules/property-information/lib/util/case-sensitive-transform.d.ts
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
/**
|
||||
* @param {Record<string, string>} attributes
|
||||
* Attributes.
|
||||
* @param {string} attribute
|
||||
* Attribute.
|
||||
* @returns {string}
|
||||
* Transformed attribute.
|
||||
*/
|
||||
export function caseSensitiveTransform(attributes: Record<string, string>, attribute: string): string;
|
||||
//# sourceMappingURL=case-sensitive-transform.d.ts.map
|
1
node_modules/property-information/lib/util/case-sensitive-transform.d.ts.map
generated
vendored
Normal file
1
node_modules/property-information/lib/util/case-sensitive-transform.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"case-sensitive-transform.d.ts","sourceRoot":"","sources":["case-sensitive-transform.js"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,mDAPW,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,aAEtB,MAAM,GAEJ,MAAM,CAKlB"}
|
11
node_modules/property-information/lib/util/case-sensitive-transform.js
generated
vendored
Normal file
11
node_modules/property-information/lib/util/case-sensitive-transform.js
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
/**
|
||||
* @param {Record<string, string>} attributes
|
||||
* Attributes.
|
||||
* @param {string} attribute
|
||||
* Attribute.
|
||||
* @returns {string}
|
||||
* Transformed attribute.
|
||||
*/
|
||||
export function caseSensitiveTransform(attributes, attribute) {
|
||||
return attribute in attributes ? attributes[attribute] : attribute
|
||||
}
|
39
node_modules/property-information/lib/util/create.d.ts
generated
vendored
Normal file
39
node_modules/property-information/lib/util/create.d.ts
generated
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
/**
|
||||
* @param {Definition} definition
|
||||
* Definition.
|
||||
* @returns {Schema}
|
||||
* Schema.
|
||||
*/
|
||||
export function create(definition: Definition): Schema;
|
||||
/**
|
||||
* Definition of a schema.
|
||||
*/
|
||||
export type Definition = {
|
||||
/**
|
||||
* Normalzed names to special attribute case.
|
||||
*/
|
||||
attributes?: Record<string, string> | undefined;
|
||||
/**
|
||||
* Normalized names that must be set as properties.
|
||||
*/
|
||||
mustUseProperty?: ReadonlyArray<string> | undefined;
|
||||
/**
|
||||
* Property names to their types.
|
||||
*/
|
||||
properties: Record<string, number | null>;
|
||||
/**
|
||||
* Space.
|
||||
*/
|
||||
space?: Space | undefined;
|
||||
/**
|
||||
* Transform a property name.
|
||||
*/
|
||||
transform: Transform;
|
||||
};
|
||||
/**
|
||||
* Transform.
|
||||
*/
|
||||
export type Transform = (attributes: Record<string, string>, property: string) => string;
|
||||
import { Schema } from './schema.js';
|
||||
import type { Space } from 'property-information';
|
||||
//# sourceMappingURL=create.d.ts.map
|
1
node_modules/property-information/lib/util/create.d.ts.map
generated
vendored
Normal file
1
node_modules/property-information/lib/util/create.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["create.js"],"names":[],"mappings":"AAkCA;;;;;GAKG;AACH,mCALW,UAAU,GAER,MAAM,CA+BlB;;;;;;;;iBA7Da,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS;;;;sBAElC,aAAa,CAAC,MAAM,CAAC,GAAG,SAAS;;;;gBAEjC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;;;;YAE7B,KAAK,GAAG,SAAS;;;;eAEjB,SAAS;;;;;qCAOZ,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,YAEtB,MAAM,KAEJ,MAAM;uBAME,aAAa;2BA/BJ,sBAAsB"}
|
69
node_modules/property-information/lib/util/create.js
generated
vendored
Normal file
69
node_modules/property-information/lib/util/create.js
generated
vendored
Normal file
@@ -0,0 +1,69 @@
|
||||
/**
|
||||
* @import {Info, Space} from 'property-information'
|
||||
*/
|
||||
|
||||
/**
|
||||
* @typedef Definition
|
||||
* Definition of a schema.
|
||||
* @property {Record<string, string> | undefined} [attributes]
|
||||
* Normalzed names to special attribute case.
|
||||
* @property {ReadonlyArray<string> | undefined} [mustUseProperty]
|
||||
* Normalized names that must be set as properties.
|
||||
* @property {Record<string, number | null>} properties
|
||||
* Property names to their types.
|
||||
* @property {Space | undefined} [space]
|
||||
* Space.
|
||||
* @property {Transform} transform
|
||||
* Transform a property name.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @callback Transform
|
||||
* Transform.
|
||||
* @param {Record<string, string>} attributes
|
||||
* Attributes.
|
||||
* @param {string} property
|
||||
* Property.
|
||||
* @returns {string}
|
||||
* Attribute.
|
||||
*/
|
||||
|
||||
import {normalize} from '../normalize.js'
|
||||
import {DefinedInfo} from './defined-info.js'
|
||||
import {Schema} from './schema.js'
|
||||
|
||||
/**
|
||||
* @param {Definition} definition
|
||||
* Definition.
|
||||
* @returns {Schema}
|
||||
* Schema.
|
||||
*/
|
||||
export function create(definition) {
|
||||
/** @type {Record<string, Info>} */
|
||||
const properties = {}
|
||||
/** @type {Record<string, string>} */
|
||||
const normals = {}
|
||||
|
||||
for (const [property, value] of Object.entries(definition.properties)) {
|
||||
const info = new DefinedInfo(
|
||||
property,
|
||||
definition.transform(definition.attributes || {}, property),
|
||||
value,
|
||||
definition.space
|
||||
)
|
||||
|
||||
if (
|
||||
definition.mustUseProperty &&
|
||||
definition.mustUseProperty.includes(property)
|
||||
) {
|
||||
info.mustUseProperty = true
|
||||
}
|
||||
|
||||
properties[property] = info
|
||||
|
||||
normals[normalize(property)] = property
|
||||
normals[normalize(info.attribute)] = property
|
||||
}
|
||||
|
||||
return new Schema(properties, normals, definition.space)
|
||||
}
|
19
node_modules/property-information/lib/util/defined-info.d.ts
generated
vendored
Normal file
19
node_modules/property-information/lib/util/defined-info.d.ts
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
export class DefinedInfo extends Info {
|
||||
/**
|
||||
* @constructor
|
||||
* @param {string} property
|
||||
* Property.
|
||||
* @param {string} attribute
|
||||
* Attribute.
|
||||
* @param {number | null | undefined} [mask]
|
||||
* Mask.
|
||||
* @param {Space | undefined} [space]
|
||||
* Space.
|
||||
* @returns
|
||||
* Info.
|
||||
*/
|
||||
constructor(property: string, attribute: string, mask?: number | null | undefined, space?: Space | undefined);
|
||||
}
|
||||
import { Info } from './info.js';
|
||||
import type { Space } from 'property-information';
|
||||
//# sourceMappingURL=defined-info.d.ts.map
|
1
node_modules/property-information/lib/util/defined-info.d.ts.map
generated
vendored
Normal file
1
node_modules/property-information/lib/util/defined-info.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"defined-info.d.ts","sourceRoot":"","sources":["defined-info.js"],"names":[],"mappings":"AAWA;IACE;;;;;;;;;;;;OAYG;IACH,sBAXW,MAAM,aAEN,MAAM,SAEN,MAAM,GAAG,IAAI,GAAG,SAAS,UAEzB,KAAK,GAAG,SAAS,EAkB3B;CACF;qBAnCkB,WAAW;2BAHN,sBAAsB"}
|
60
node_modules/property-information/lib/util/defined-info.js
generated
vendored
Normal file
60
node_modules/property-information/lib/util/defined-info.js
generated
vendored
Normal file
@@ -0,0 +1,60 @@
|
||||
/**
|
||||
* @import {Space} from 'property-information'
|
||||
*/
|
||||
|
||||
import {Info} from './info.js'
|
||||
import * as types from './types.js'
|
||||
|
||||
const checks = /** @type {ReadonlyArray<keyof typeof types>} */ (
|
||||
Object.keys(types)
|
||||
)
|
||||
|
||||
export class DefinedInfo extends Info {
|
||||
/**
|
||||
* @constructor
|
||||
* @param {string} property
|
||||
* Property.
|
||||
* @param {string} attribute
|
||||
* Attribute.
|
||||
* @param {number | null | undefined} [mask]
|
||||
* Mask.
|
||||
* @param {Space | undefined} [space]
|
||||
* Space.
|
||||
* @returns
|
||||
* Info.
|
||||
*/
|
||||
constructor(property, attribute, mask, space) {
|
||||
let index = -1
|
||||
|
||||
super(property, attribute)
|
||||
|
||||
mark(this, 'space', space)
|
||||
|
||||
if (typeof mask === 'number') {
|
||||
while (++index < checks.length) {
|
||||
const check = checks[index]
|
||||
mark(this, checks[index], (mask & types[check]) === types[check])
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
DefinedInfo.prototype.defined = true
|
||||
|
||||
/**
|
||||
* @template {keyof DefinedInfo} Key
|
||||
* Key type.
|
||||
* @param {DefinedInfo} values
|
||||
* Info.
|
||||
* @param {Key} key
|
||||
* Key.
|
||||
* @param {DefinedInfo[Key]} value
|
||||
* Value.
|
||||
* @returns {undefined}
|
||||
* Nothing.
|
||||
*/
|
||||
function mark(values, key, value) {
|
||||
if (value) {
|
||||
values[key] = value
|
||||
}
|
||||
}
|
28
node_modules/property-information/lib/util/info.d.ts
generated
vendored
Normal file
28
node_modules/property-information/lib/util/info.d.ts
generated
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
/**
|
||||
* @import {Info as InfoType} from 'property-information'
|
||||
*/
|
||||
/** @type {InfoType} */
|
||||
export class Info {
|
||||
/**
|
||||
* @param {string} property
|
||||
* Property.
|
||||
* @param {string} attribute
|
||||
* Attribute.
|
||||
* @returns
|
||||
* Info.
|
||||
*/
|
||||
constructor(property: string, attribute: string);
|
||||
attribute: string;
|
||||
property: string;
|
||||
booleanish: boolean;
|
||||
boolean: boolean;
|
||||
commaOrSpaceSeparated: boolean;
|
||||
commaSeparated: boolean;
|
||||
defined: boolean;
|
||||
mustUseProperty: boolean;
|
||||
number: boolean;
|
||||
overloadedBoolean: boolean;
|
||||
spaceSeparated: boolean;
|
||||
space: import("property-information").Space | undefined;
|
||||
}
|
||||
//# sourceMappingURL=info.d.ts.map
|
1
node_modules/property-information/lib/util/info.d.ts.map
generated
vendored
Normal file
1
node_modules/property-information/lib/util/info.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"info.d.ts","sourceRoot":"","sources":["info.js"],"names":[],"mappings":"AAAA;;GAEG;AAEH,uBAAuB;AACvB;IACE;;;;;;;OAOG;IACH,sBAPW,MAAM,aAEN,MAAM,EAQhB;IAFC,kBAA0B;IAC1B,iBAAwB;IAK5B,oBAAyB;IACzB,iBAAsB;IACtB,+BAAoC;IACpC,wBAA6B;IAC7B,iBAAsB;IACtB,yBAA8B;IAC9B,gBAAqB;IACrB,2BAAgC;IAEhC,wBAA6B;IAC7B,wDAAoB;CAbnB"}
|
32
node_modules/property-information/lib/util/info.js
generated
vendored
Normal file
32
node_modules/property-information/lib/util/info.js
generated
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
/**
|
||||
* @import {Info as InfoType} from 'property-information'
|
||||
*/
|
||||
|
||||
/** @type {InfoType} */
|
||||
export class Info {
|
||||
/**
|
||||
* @param {string} property
|
||||
* Property.
|
||||
* @param {string} attribute
|
||||
* Attribute.
|
||||
* @returns
|
||||
* Info.
|
||||
*/
|
||||
constructor(property, attribute) {
|
||||
this.attribute = attribute
|
||||
this.property = property
|
||||
}
|
||||
}
|
||||
|
||||
Info.prototype.attribute = ''
|
||||
Info.prototype.booleanish = false
|
||||
Info.prototype.boolean = false
|
||||
Info.prototype.commaOrSpaceSeparated = false
|
||||
Info.prototype.commaSeparated = false
|
||||
Info.prototype.defined = false
|
||||
Info.prototype.mustUseProperty = false
|
||||
Info.prototype.number = false
|
||||
Info.prototype.overloadedBoolean = false
|
||||
Info.prototype.property = ''
|
||||
Info.prototype.spaceSeparated = false
|
||||
Info.prototype.space = undefined
|
12
node_modules/property-information/lib/util/merge.d.ts
generated
vendored
Normal file
12
node_modules/property-information/lib/util/merge.d.ts
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
/**
|
||||
* @param {ReadonlyArray<Schema>} definitions
|
||||
* Definitions.
|
||||
* @param {Space | undefined} [space]
|
||||
* Space.
|
||||
* @returns {Schema}
|
||||
* Schema.
|
||||
*/
|
||||
export function merge(definitions: ReadonlyArray<Schema>, space?: Space | undefined): Schema;
|
||||
import { Schema } from './schema.js';
|
||||
import type { Space } from 'property-information';
|
||||
//# sourceMappingURL=merge.d.ts.map
|
1
node_modules/property-information/lib/util/merge.d.ts.map
generated
vendored
Normal file
1
node_modules/property-information/lib/util/merge.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"merge.d.ts","sourceRoot":"","sources":["merge.js"],"names":[],"mappings":"AAMA;;;;;;;GAOG;AACH,mCAPW,aAAa,CAAC,MAAM,CAAC,UAErB,KAAK,GAAG,SAAS,GAEf,MAAM,CAelB;uBAtBoB,aAAa;2BAHJ,sBAAsB"}
|
27
node_modules/property-information/lib/util/merge.js
generated
vendored
Normal file
27
node_modules/property-information/lib/util/merge.js
generated
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
/**
|
||||
* @import {Info, Space} from 'property-information'
|
||||
*/
|
||||
|
||||
import {Schema} from './schema.js'
|
||||
|
||||
/**
|
||||
* @param {ReadonlyArray<Schema>} definitions
|
||||
* Definitions.
|
||||
* @param {Space | undefined} [space]
|
||||
* Space.
|
||||
* @returns {Schema}
|
||||
* Schema.
|
||||
*/
|
||||
export function merge(definitions, space) {
|
||||
/** @type {Record<string, Info>} */
|
||||
const property = {}
|
||||
/** @type {Record<string, string>} */
|
||||
const normal = {}
|
||||
|
||||
for (const definition of definitions) {
|
||||
Object.assign(property, definition.property)
|
||||
Object.assign(normal, definition.normal)
|
||||
}
|
||||
|
||||
return new Schema(property, normal, space)
|
||||
}
|
23
node_modules/property-information/lib/util/schema.d.ts
generated
vendored
Normal file
23
node_modules/property-information/lib/util/schema.d.ts
generated
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
/**
|
||||
* @import {Schema as SchemaType, Space} from 'property-information'
|
||||
*/
|
||||
/** @type {SchemaType} */
|
||||
export class Schema {
|
||||
/**
|
||||
* @param {SchemaType['property']} property
|
||||
* Property.
|
||||
* @param {SchemaType['normal']} normal
|
||||
* Normal.
|
||||
* @param {Space | undefined} [space]
|
||||
* Space.
|
||||
* @returns
|
||||
* Schema.
|
||||
*/
|
||||
constructor(property: SchemaType["property"], normal: SchemaType["normal"], space?: Space | undefined);
|
||||
normal: Record<string, string>;
|
||||
property: Record<string, import("property-information").Info>;
|
||||
space: Space | undefined;
|
||||
}
|
||||
import type { Space } from 'property-information';
|
||||
import type { Schema as SchemaType } from 'property-information';
|
||||
//# sourceMappingURL=schema.d.ts.map
|
1
node_modules/property-information/lib/util/schema.d.ts.map
generated
vendored
Normal file
1
node_modules/property-information/lib/util/schema.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["schema.js"],"names":[],"mappings":"AAAA;;GAEG;AAEH,yBAAyB;AACzB;IACE;;;;;;;;;OASG;IACH,sBATW,UAAU,CAAC,UAAU,CAAC,UAEtB,UAAU,CAAC,QAAQ,CAAC,UAEpB,KAAK,GAAG,SAAS,EAY3B;IANC,+BAAoB;IACpB,8DAAwB;IAGtB,yBAAkB;CAGvB;2BAvB6C,sBAAsB;0CAAtB,sBAAsB"}
|
29
node_modules/property-information/lib/util/schema.js
generated
vendored
Normal file
29
node_modules/property-information/lib/util/schema.js
generated
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
/**
|
||||
* @import {Schema as SchemaType, Space} from 'property-information'
|
||||
*/
|
||||
|
||||
/** @type {SchemaType} */
|
||||
export class Schema {
|
||||
/**
|
||||
* @param {SchemaType['property']} property
|
||||
* Property.
|
||||
* @param {SchemaType['normal']} normal
|
||||
* Normal.
|
||||
* @param {Space | undefined} [space]
|
||||
* Space.
|
||||
* @returns
|
||||
* Schema.
|
||||
*/
|
||||
constructor(property, normal, space) {
|
||||
this.normal = normal
|
||||
this.property = property
|
||||
|
||||
if (space) {
|
||||
this.space = space
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Schema.prototype.normal = {}
|
||||
Schema.prototype.property = {}
|
||||
Schema.prototype.space = undefined
|
8
node_modules/property-information/lib/util/types.d.ts
generated
vendored
Normal file
8
node_modules/property-information/lib/util/types.d.ts
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
export const boolean: number;
|
||||
export const booleanish: number;
|
||||
export const overloadedBoolean: number;
|
||||
export const number: number;
|
||||
export const spaceSeparated: number;
|
||||
export const commaSeparated: number;
|
||||
export const commaOrSpaceSeparated: number;
|
||||
//# sourceMappingURL=types.d.ts.map
|
1
node_modules/property-information/lib/util/types.d.ts.map
generated
vendored
Normal file
1
node_modules/property-information/lib/util/types.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["types.js"],"names":[],"mappings":"AAEA,6BAAkC;AAClC,gCAAqC;AACrC,uCAA4C;AAC5C,4BAAiC;AACjC,oCAAyC;AACzC,oCAAyC;AACzC,2CAAgD"}
|
13
node_modules/property-information/lib/util/types.js
generated
vendored
Normal file
13
node_modules/property-information/lib/util/types.js
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
let powers = 0
|
||||
|
||||
export const boolean = increment()
|
||||
export const booleanish = increment()
|
||||
export const overloadedBoolean = increment()
|
||||
export const number = increment()
|
||||
export const spaceSeparated = increment()
|
||||
export const commaSeparated = increment()
|
||||
export const commaOrSpaceSeparated = increment()
|
||||
|
||||
function increment() {
|
||||
return 2 ** ++powers
|
||||
}
|
Reference in New Issue
Block a user