good-enough-parser
Advanced tools
Comparing version 1.1.1 to 1.1.2
import { Node } from '../parser/types'; | ||
import { Checkpoint } from './types'; | ||
export { klona as clone } from 'klona/json'; | ||
export declare function freeze<T>(input: T): T; | ||
export declare function freezeCheckpoint<Ctx>(checkpoint: Checkpoint<Ctx>): Checkpoint<Ctx>; | ||
export declare function coerceHandler<Ctx, T extends Node = Node>(handler: ((ctx: Ctx, token: T) => Ctx) | null | undefined): (ctx: Ctx, token: T) => Ctx; | ||
//# sourceMappingURL=util.d.ts.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.coerceHandler = exports.freezeCheckpoint = exports.freeze = exports.clone = void 0; | ||
const deep_freeze_es6_1 = require("deep-freeze-es6"); | ||
var json_1 = require("klona/json"); | ||
Object.defineProperty(exports, "clone", { enumerable: true, get: function () { return json_1.klona; } }); | ||
function freeze(input) { | ||
return (0, deep_freeze_es6_1.default)(input); | ||
} | ||
exports.freeze = freeze; | ||
function freezeCheckpoint(checkpoint) { | ||
return freeze({ | ||
...checkpoint, | ||
context: freeze(checkpoint.context), | ||
}); | ||
} | ||
exports.freezeCheckpoint = freezeCheckpoint; | ||
exports.coerceHandler = exports.clone = void 0; | ||
const json_1 = require("klona/json"); | ||
var json_2 = require("klona/json"); | ||
Object.defineProperty(exports, "clone", { enumerable: true, get: function () { return json_2.klona; } }); | ||
function coerceHandler(handler) { | ||
return handler | ||
? (context, token) => handler(freeze(context), token) | ||
? (context, token) => handler((0, json_1.klona)(context), token) | ||
: (context, _) => context; | ||
@@ -22,0 +11,0 @@ } |
import { Node } from '../parser/types'; | ||
import { Checkpoint } from './types'; | ||
export { klona as clone } from 'klona/json'; | ||
export declare function freeze<T>(input: T): T; | ||
export declare function freezeCheckpoint<Ctx>(checkpoint: Checkpoint<Ctx>): Checkpoint<Ctx>; | ||
export declare function coerceHandler<Ctx, T extends Node = Node>(handler: ((ctx: Ctx, token: T) => Ctx) | null | undefined): (ctx: Ctx, token: T) => Ctx; | ||
//# sourceMappingURL=util.d.ts.map |
@@ -1,17 +0,8 @@ | ||
import deepFreeze from 'deep-freeze-es6'; | ||
import { klona as clone } from 'klona/json'; | ||
export { klona as clone } from 'klona/json'; | ||
export function freeze(input) { | ||
return deepFreeze(input); | ||
} | ||
export function freezeCheckpoint(checkpoint) { | ||
return freeze({ | ||
...checkpoint, | ||
context: freeze(checkpoint.context), | ||
}); | ||
} | ||
export function coerceHandler(handler) { | ||
return handler | ||
? (context, token) => handler(freeze(context), token) | ||
? (context, token) => handler(clone(context), token) | ||
: (context, _) => context; | ||
} | ||
//# sourceMappingURL=util.js.map |
{ | ||
"name": "good-enough-parser", | ||
"description": "Parse and query computer programs source code", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"repository": "git@github.com:zharinov/good-enough-parser.git", | ||
@@ -39,3 +39,2 @@ "author": "Sergei Zharinov", | ||
"@types/moo": "0.5.5", | ||
"deep-freeze-es6": "1.4.1", | ||
"klona": "2.0.5", | ||
@@ -42,0 +41,0 @@ "moo": "0.5.1" |
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
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
4
369229
4921
- Removeddeep-freeze-es6@1.4.1
- Removeddeep-freeze-es6@1.4.1(transitive)