@kizahasi/flocon-script
Advanced tools
Comparing version 0.3.1 to 0.4.0
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.ScriptError = exports.FType = exports.FString = exports.FObject = exports.FNumber = exports.FFunction = exports.FBoolean = exports.FArray = exports.toTypeName = exports.toJObject = exports.createFValue = exports.arrayClass = exports.test = exports.exec = void 0; | ||
exports.ScriptError = exports.FType = exports.FString = exports.FObject = exports.FNumber = exports.FFunction = exports.FBoolean = exports.FArray = exports.toTypeName = exports.beginCast = exports.createFValue = exports.arrayClass = exports.test = exports.exec = void 0; | ||
var main_1 = require("./main"); | ||
@@ -11,3 +11,3 @@ Object.defineProperty(exports, "exec", { enumerable: true, get: function () { return main_1.exec; } }); | ||
Object.defineProperty(exports, "createFValue", { enumerable: true, get: function () { return scriptValue_1.createFValue; } }); | ||
Object.defineProperty(exports, "toJObject", { enumerable: true, get: function () { return scriptValue_1.toJObject; } }); | ||
Object.defineProperty(exports, "beginCast", { enumerable: true, get: function () { return scriptValue_1.beginCast; } }); | ||
Object.defineProperty(exports, "toTypeName", { enumerable: true, get: function () { return scriptValue_1.toTypeName; } }); | ||
@@ -23,2 +23,2 @@ Object.defineProperty(exports, "FArray", { enumerable: true, get: function () { return scriptValue_1.FArray; } }); | ||
Object.defineProperty(exports, "ScriptError", { enumerable: true, get: function () { return ScriptError_1.ScriptError; } }); | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUEsK0JBQW9DO0FBQTNCLDRGQUFBLElBQUksT0FBQTtBQUFFLDRGQUFBLElBQUksT0FBQTtBQUNuQix5Q0FBNkM7QUFBcEMsbUdBQUEsVUFBVSxPQUFBO0FBQ25CLDZDQWdCdUI7QUFmbkIsMkdBQUEsWUFBWSxPQU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nJvciB9IGZyb20gJy4vU2NyaXB0RXJyb3InO1xyXG4iXX0= |
export { exec, test } from './main'; | ||
export { arrayClass } from './builtIn/Array'; | ||
export { createFValue, toJObject, toTypeName, FArray, FBoolean, FFunction, FNumber, FObject, FString, FType, } from './scriptValue'; | ||
export { createFValue, beginCast, toTypeName, FArray, FBoolean, FFunction, FNumber, FObject, FString, FType, } from './scriptValue'; | ||
export { ScriptError } from './ScriptError'; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLElBQUksRUFBRSxJQUFJLEVBQUUsTUFBTSxRQUFRLENBQUM7QUFDcEMsT0FBTyxFQUFFLFVBQVUsRUFBRSxNQUFNLGlCQUFpQixDQUFDO0FBQzdDLE9BQU8sRUFDSCxZQUFZLEVBQ1osU0FBUyxFQUNULFVBQVUsRUFDVixNQUFNLEVBQ04sUUFBUSxFQUNSLFNBQVMsRUFDVCxPQUFPLEVBQ1AsT0FBTyxFQUNQLE9BQU8sRUFFUCxLQUFLLEdBS1IsTUFBTSxlQUFlLENBQUM7QUFDdkIsT0FBTyxFQUFFLFdBQVcsRUFBRSxNQUFNLGVBQWUsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCB7IGV4ZWMsIHRlc3QgfSBmcm9tICcuL21haW4nO1xyXG5leHBvcnQgeyBhcnJheUNsYXNzIH0gZnJvbSAnLi9idWlsdEluL0FycmF5JztcclxuZXhwb3J0IHtcclxuICAgIGNyZWF0ZUZWYWx1ZSxcclxuICAgIHRvSk9iamVjdCxcclxuICAgIHRvVHlwZU5hbWUsXHJcbiAgICBGQXJyYXksXHJcbiAgICBGQm9vbGVhbixcclxuICAgIEZGdW5jdGlvbixcclxuICAgIEZOdW1iZXIsXHJ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iAgICBGQm9vbGVhbixcclxuICAgIEZGdW5jdGlvbixcclxuICAgIEZOdW1iZXIsXHJcbiAgICBGT2JqZWN0LFxyXG4gICAgRlN0cmluZyxcclxuICAgIEZWYWx1ZSxcclxuICAgIEZUeXBlLFxyXG4gICAgR2V0UGFyYW1zLFxyXG4gICAgU2V0UGFyYW1zLFxyXG4gICAgT25HZXR0aW5nUGFyYW1zLFxyXG4gICAgT25TZXR0aW5nUGFyYW1zLFxyXG59IGZyb20gJy4vc2NyaXB0VmFsdWUnO1xyXG5leHBvcnQgeyBTY3JpcHRFcnJvciB9IGZyb20gJy4vU2NyaXB0RXJyb3InO1xyXG4iXX0= |
export { exec, test } from './main'; | ||
export { arrayClass } from './builtIn/Array'; | ||
export { createFValue, toJObject, toTypeName, FArray, FBoolean, FFunction, FNumber, FObject, FString, FValue, FType, GetParams, SetParams, OnGettingParams, OnSettingParams, } from './scriptValue'; | ||
export { createFValue, beginCast, toTypeName, FArray, FBoolean, FFunction, FNumber, FObject, FString, FValue, FType, GetParams, SetParams, OnGettingParams, OnSettingParams, } from './scriptValue'; | ||
export { ScriptError } from './ScriptError'; |
@@ -40,37 +40,19 @@ import { Option } from '@kizahasi/option'; | ||
export declare const toTypeName: (value: FValue) => "Boolean" | "Number" | "String" | "Array" | "Record" | "Function" | "null" | "undefined"; | ||
declare type ArrayOption = { | ||
array: true; | ||
}; | ||
declare type BooleanOption = { | ||
boolean: true; | ||
}; | ||
declare type FunctionOption = { | ||
function: true; | ||
}; | ||
declare type NullOption = { | ||
null: true; | ||
}; | ||
declare type NumberOption = { | ||
number: true; | ||
}; | ||
declare type ObjectOption = { | ||
object: true; | ||
}; | ||
declare type StringOption = { | ||
string: true; | ||
}; | ||
declare type UndefinedOption = { | ||
undefined: true; | ||
}; | ||
declare type TypesOption = { | ||
array?: true; | ||
boolean?: true; | ||
function?: true; | ||
null?: true; | ||
number?: true; | ||
object?: true; | ||
string?: true; | ||
undefined?: true; | ||
}; | ||
export declare const toJObject: <T extends TypesOption>(value: FValue, option: T) => (T extends ArrayOption ? FValue[] : never) | (T extends BooleanOption ? boolean : never) | (T extends FunctionOption ? (isNew: boolean) => (args: FValue[]) => FValue : never) | (T extends NullOption ? null : never) | (T extends NumberOption ? number : never) | (T extends ObjectOption ? FObject : never) | (T extends StringOption ? string : never) | (T extends UndefinedOption ? undefined : never); | ||
declare class JObjectCaster<T = never> { | ||
private readonly source; | ||
private readonly addedTypes; | ||
private readonly successfullyCastedValue; | ||
private constructor(); | ||
static begin(source: FValue): JObjectCaster<never>; | ||
cast(errorRange?: Range): T; | ||
addArray(): JObjectCaster<T | FValue[]>; | ||
addBoolean(): JObjectCaster<T | boolean>; | ||
addFunction(): JObjectCaster<T | ((isNew: boolean) => (args: FValue[]) => FValue)>; | ||
addNull(): JObjectCaster<T | null>; | ||
addNumber(): JObjectCaster<T | number>; | ||
addObject(): JObjectCaster<T | FObject>; | ||
addString(): JObjectCaster<T | string>; | ||
addUndefined(): JObjectCaster<T | undefined>; | ||
} | ||
export declare const beginCast: (source: FValue) => JObjectCaster<never>; | ||
export declare class FBoolean implements FObjectBase { | ||
@@ -77,0 +59,0 @@ readonly raw: boolean; |
{ | ||
"version": "0.3.1", | ||
"version": "0.4.0", | ||
"license": "MIT", | ||
@@ -49,6 +49,6 @@ "main": "dist/cjs/index.js", | ||
"dependencies": { | ||
"@kizahasi/option": "^0.1.2", | ||
"@kizahasi/util": "^0.2.2", | ||
"@kizahasi/option": "^0.1.3", | ||
"@kizahasi/util": "^0.2.3", | ||
"acorn": "^8.4.1" | ||
} | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
447404
3311
Updated@kizahasi/option@^0.1.3
Updated@kizahasi/util@^0.2.3