@formkit/tempo 1.2.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundle.d.ts +826 -0
- package/dist/bundle.mjs +3 -2
- package/dist/bundle.mjs.map +1 -1
- package/dist/common.mjs +3 -2
- package/dist/common.mjs.map +1 -1
- package/dist/index.cjs +3 -2
- package/dist/index.cjs.map +1 -1
- package/package.json +1 -1
package/dist/bundle.mjs
CHANGED
|
@@ -383,8 +383,9 @@ function isNumeric(part) {
|
|
|
383
383
|
}
|
|
384
384
|
function validate(parts2) {
|
|
385
385
|
let lastPart = void 0;
|
|
386
|
-
|
|
387
|
-
|
|
386
|
+
const knownWidth = (p) => !p || p.partName === "literal" || p.token in fixedLength;
|
|
387
|
+
for (const [i, part] of parts2.entries()) {
|
|
388
|
+
if (part.partName === "literal" && !isNaN(parseFloat(part.partValue)) && !(knownWidth(parts2[i - 1]) && knownWidth(parts2[i + 1]))) {
|
|
388
389
|
throw new Error(`Numbers in format (${part.partValue}).`);
|
|
389
390
|
}
|
|
390
391
|
if (lastPart && lastPart.partName !== "literal" && part.partName !== "literal") {
|