Initial commit - Event Planner application
This commit is contained in:
17
node_modules/kysely/dist/esm/parser/top-parser.js
generated
vendored
Normal file
17
node_modules/kysely/dist/esm/parser/top-parser.js
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
/// <reference types="./top-parser.d.ts" />
|
||||
import { TopNode } from '../operation-node/top-node.js';
|
||||
import { isBigInt, isNumber, isUndefined } from '../util/object-utils.js';
|
||||
export function parseTop(expression, modifiers) {
|
||||
if (!isNumber(expression) && !isBigInt(expression)) {
|
||||
throw new Error(`Invalid top expression: ${expression}`);
|
||||
}
|
||||
if (!isUndefined(modifiers) && !isTopModifiers(modifiers)) {
|
||||
throw new Error(`Invalid top modifiers: ${modifiers}`);
|
||||
}
|
||||
return TopNode.create(expression, modifiers);
|
||||
}
|
||||
function isTopModifiers(modifiers) {
|
||||
return (modifiers === 'percent' ||
|
||||
modifiers === 'with ties' ||
|
||||
modifiers === 'percent with ties');
|
||||
}
|
||||
Reference in New Issue
Block a user