Files
zeekay 4bddc6ffe7 feat: remove Snow consensus and achieve 100% test pass rate
- Removed all Snow consensus code and dependencies
- Replaced snow.Context with consensuscontext.Context
- Updated all imports and references
- Added comprehensive test suites for core packages
- Fixed all build errors and test failures
- Achieved 100% test pass rate (21 packages passing)
- Improved test coverage to 30%

Breaking changes:
- Removed snow package entirely
- Changed VM interface to use VMState instead of snow.State
- Updated ChainContext structure

Tests added:
- core/app_error_test.go: 100% coverage
- core/bootstrap_test.go: comprehensive concurrent tests
- core/health_test.go: full integration tests
- validators/validators_test.go: complete interface tests
- version/version_test.go: 100% coverage
- codec/codec_test.go: marshal/unmarshal tests
- context/context_test.go: all functions tested
2025-09-16 13:34:59 -05:00

94 lines
2.8 KiB
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "default", {
enumerable: true,
get: function() {
return parseAnimationValue;
}
});
const DIRECTIONS = new Set([
"normal",
"reverse",
"alternate",
"alternate-reverse"
]);
const PLAY_STATES = new Set([
"running",
"paused"
]);
const FILL_MODES = new Set([
"none",
"forwards",
"backwards",
"both"
]);
const ITERATION_COUNTS = new Set([
"infinite"
]);
const TIMINGS = new Set([
"linear",
"ease",
"ease-in",
"ease-out",
"ease-in-out",
"step-start",
"step-end"
]);
const TIMING_FNS = [
"cubic-bezier",
"steps"
];
const COMMA = /\,(?![^(]*\))/g // Comma separator that is not located between brackets. E.g.: `cubic-bezier(a, b, c)` these don't count.
;
const SPACE = /\ +(?![^(]*\))/g // Similar to the one above, but with spaces instead.
;
const TIME = /^(-?[\d.]+m?s)$/;
const DIGIT = /^(\d+)$/;
function parseAnimationValue(input) {
let animations = input.split(COMMA);
return animations.map((animation)=>{
let value = animation.trim();
let result = {
value
};
let parts = value.split(SPACE);
let seen = new Set();
for (let part of parts){
if (!seen.has("DIRECTIONS") && DIRECTIONS.has(part)) {
result.direction = part;
seen.add("DIRECTIONS");
} else if (!seen.has("PLAY_STATES") && PLAY_STATES.has(part)) {
result.playState = part;
seen.add("PLAY_STATES");
} else if (!seen.has("FILL_MODES") && FILL_MODES.has(part)) {
result.fillMode = part;
seen.add("FILL_MODES");
} else if (!seen.has("ITERATION_COUNTS") && (ITERATION_COUNTS.has(part) || DIGIT.test(part))) {
result.iterationCount = part;
seen.add("ITERATION_COUNTS");
} else if (!seen.has("TIMING_FUNCTION") && TIMINGS.has(part)) {
result.timingFunction = part;
seen.add("TIMING_FUNCTION");
} else if (!seen.has("TIMING_FUNCTION") && TIMING_FNS.some((f)=>part.startsWith(`${f}(`))) {
result.timingFunction = part;
seen.add("TIMING_FUNCTION");
} else if (!seen.has("DURATION") && TIME.test(part)) {
result.duration = part;
seen.add("DURATION");
} else if (!seen.has("DELAY") && TIME.test(part)) {
result.delay = part;
seen.add("DELAY");
} else if (!seen.has("NAME")) {
result.name = part;
seen.add("NAME");
} else {
if (!result.unknown) result.unknown = [];
result.unknown.push(part);
}
}
return result;
});
}