@journeyapps/evaluator
Advanced tools
Comparing version 0.0.0-dev.c97cb24.aa0a033 to 0.0.0-dev.c9c0be1
@@ -9,5 +9,8 @@ import { TokenExpression } from './token-expressions/TokenExpression'; | ||
export declare class FormatString { | ||
static TYPE: string; | ||
type: string; | ||
expression: string; | ||
tokens: TokenExpression[]; | ||
constructor(expression: string); | ||
static isInstanceOf(val: any): val is FormatString; | ||
toString(): string; | ||
@@ -14,0 +17,0 @@ /** |
export interface TypeInterface { | ||
name: string; | ||
options: object; | ||
isPrimitiveType: boolean; | ||
objectType?: TypeInterface; | ||
getVariable(expression: string): any; | ||
getVariableTypeAndNameWithParent(expression: string): any; | ||
getType(expression: string): TypeInterface | null; | ||
toJSON(): any; | ||
stringify(): string; | ||
format(value: any, format?: string): string; | ||
options: object; | ||
stringify(): string; | ||
} |
@@ -9,3 +9,3 @@ /** | ||
import { TypeInterface } from './TypeInterface'; | ||
export declare type VariableScope = Record<string, any> & { | ||
export type VariableScope = Record<string, any> & { | ||
type: TypeInterface; | ||
@@ -12,0 +12,0 @@ _display?(): Promise<string>; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.FormatString = void 0; | ||
const tools_1 = require("./tools"); | ||
@@ -10,4 +11,8 @@ /** | ||
this.expression = expression || ''; | ||
this.tokens = tools_1.compile(this.expression); | ||
this.tokens = (0, tools_1.compile)(this.expression); | ||
this.type = FormatString.TYPE; | ||
} | ||
static isInstanceOf(val) { | ||
return (val === null || val === void 0 ? void 0 : val.type) === FormatString.TYPE; | ||
} | ||
toString() { | ||
@@ -39,3 +44,3 @@ return this.expression; | ||
var expression = token.expression; | ||
tools_1.extract(type, expression, result, depth); | ||
(0, tools_1.extract)(type, expression, result, depth); | ||
} | ||
@@ -172,3 +177,3 @@ } | ||
const type = scope.getExpressionType(expression); | ||
const text = tools_1.formatValue(value, type, token.format); | ||
const text = (0, tools_1.formatValue)(value, type, token.format); | ||
result += text; | ||
@@ -182,2 +187,3 @@ } | ||
exports.FormatString = FormatString; | ||
FormatString.TYPE = 'format-string'; | ||
//# sourceMappingURL=FormatString.js.map |
"use strict"; | ||
function __export(m) { | ||
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; | ||
} | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
__export(require("./token-expressions/ConstantTokenExpression")); | ||
__export(require("./token-expressions/FormatShorthandTokenExpression")); | ||
__export(require("./token-expressions/FunctionTokenExpression")); | ||
__export(require("./token-expressions/LegacyFunctionTokenExpression")); | ||
__export(require("./token-expressions/PrimitiveConstantTokenExpression")); | ||
__export(require("./token-expressions/ShorthandTokenExpression")); | ||
__export(require("./token-expressions/TokenExpression")); | ||
__export(require("./FormatString")); | ||
__export(require("./tools")); | ||
__export(require("./VariableFormatStringScope")); | ||
__exportStar(require("./token-expressions/ConstantTokenExpression"), exports); | ||
__exportStar(require("./token-expressions/FormatShorthandTokenExpression"), exports); | ||
__exportStar(require("./token-expressions/FunctionTokenExpression"), exports); | ||
__exportStar(require("./token-expressions/LegacyFunctionTokenExpression"), exports); | ||
__exportStar(require("./token-expressions/PrimitiveConstantTokenExpression"), exports); | ||
__exportStar(require("./token-expressions/ShorthandTokenExpression"), exports); | ||
__exportStar(require("./token-expressions/TokenExpression"), exports); | ||
__exportStar(require("./FormatString"), exports); | ||
__exportStar(require("./tools"), exports); | ||
__exportStar(require("./TypeInterface"), exports); | ||
__exportStar(require("./ObjectRefInterface"), exports); | ||
__exportStar(require("./FormatStringScope"), exports); | ||
__exportStar(require("./VariableFormatStringScope"), exports); | ||
//# sourceMappingURL=index.js.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.ConstantTokenExpression = void 0; | ||
/** | ||
@@ -4,0 +5,0 @@ * Constant token expression. |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.FormatShorthandTokenExpression = void 0; | ||
/** | ||
@@ -29,3 +30,3 @@ * Shorthand token expression with format specifier. | ||
const type = scope.getExpressionType(expression); | ||
return tools_1.formatValueAsync(value, type, this.format); | ||
return (0, tools_1.formatValueAsync)(value, type, this.format); | ||
} | ||
@@ -32,0 +33,0 @@ } |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.FunctionTokenExpression = void 0; | ||
/** | ||
@@ -4,0 +5,0 @@ * JavaScript function token expression. |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.LegacyFunctionTokenExpression = void 0; | ||
/** | ||
@@ -4,0 +5,0 @@ * Legacy function token expression. |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.PrimitiveConstantTokenExpression = void 0; | ||
/** | ||
@@ -4,0 +5,0 @@ * Non-String Constant token expression |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.ShorthandTokenExpression = void 0; | ||
/** | ||
@@ -22,3 +23,3 @@ * Shorthand token expression. | ||
const type = scope.getExpressionType(expression); | ||
return tools_1.formatValueAsync(value, type, this.format); | ||
return (0, tools_1.formatValueAsync)(value, type, this.format); | ||
} | ||
@@ -25,0 +26,0 @@ } |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.TokenExpression = void 0; | ||
class TokenExpression { | ||
@@ -4,0 +5,0 @@ constructor(expression, start) { |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports._deepMerge = exports._compile = exports.formatValueAsync = exports.formatValue = exports.actionableTokenExpression = exports.functionTokenExpression = exports.formatString = exports.extract = exports.deepMerge = exports.getObjectType = exports.compile = exports.parseEnclosingBraces = exports.unescape = void 0; | ||
const ConstantTokenExpression_1 = require("./token-expressions/ConstantTokenExpression"); | ||
@@ -4,0 +5,0 @@ const FunctionTokenExpression_1 = require("./token-expressions/FunctionTokenExpression"); |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.VariableFormatStringScope = void 0; | ||
class VariableFormatStringScope { | ||
@@ -4,0 +5,0 @@ constructor(variableScope) { |
{ | ||
"name": "@journeyapps/evaluator", | ||
"version": "0.0.0-dev.c97cb24.aa0a033", | ||
"description": "Journey JS library", | ||
"version": "0.0.0-dev.c9c0be1", | ||
"description": "Journey Evaluator library", | ||
"main": "./dist/src/index.js", | ||
"typings": "./dist/@types/src/index", | ||
"scripts": { | ||
"build": "../node_modules/.bin/tsc --build", | ||
"test": "yarn build && yarn test:node && yarn test:browser", | ||
"test:browser": "karma start karma.conf.js --single-run", | ||
"test:node": "jasmine dist/test/unit/all.js" | ||
}, | ||
"dependencies": { | ||
"@journeyapps/core-xml": "0.0.0-dev.c97cb24.aa0a033" | ||
"@journeyapps/core-xml": "0.0.0-dev.c9c0be1" | ||
}, | ||
@@ -20,3 +14,11 @@ "files": [ | ||
], | ||
"gitHead": "8ae168bc0a165bf87ef94d74456b0498d6201741" | ||
} | ||
"devDependencies": { | ||
"@journeyapps/core-test-helpers": "^0.0.0-dev.c9c0be1" | ||
}, | ||
"scripts": { | ||
"build": "../node_modules/.bin/tsc --build", | ||
"test": "pnpm build && pnpm test:node && pnpm test:browser", | ||
"test:browser": "karma start karma.conf.js --single-run", | ||
"test:node": "jasmine dist/test/unit/all.js" | ||
} | ||
} |
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
125806
47
1190
1
+ Added@journeyapps/core-xml@0.0.0-dev.c9c0be1(transitive)
+ Added@journeyapps/domparser@0.4.1(transitive)
+ Addedxmldom@0.6.0(transitive)
- Removed@journeyapps/core-xml@0.0.0-dev.c97cb24.aa0a033(transitive)
- Removed@journeyapps/domparser@0.3.0(transitive)