@nepdatejs/datepicker 0.1.0 → 0.1.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nepdatejs/datepicker",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Framework-free BS/AD date picker behaviour: typed input, validation, BS/AD switch, single and range values.",
5
5
  "keywords": [
6
6
  "nepali",
@@ -55,7 +55,7 @@
55
55
  "node": ">=18"
56
56
  },
57
57
  "dependencies": {
58
- "@nepdatejs/core": "^0.1.0",
58
+ "@nepdatejs/core": "^0.1.1",
59
59
  "@nepdatejs/calendar": "^0.1.0"
60
60
  },
61
61
  "publishConfig": {
package/src/base.ts CHANGED
@@ -106,12 +106,17 @@ export function createEmitter(rebuild: () => void): {
106
106
  try {
107
107
  change();
108
108
  } finally {
109
+ // Even after a throw: part of the change may have happened.
109
110
  depth--;
110
- }
111
- if (depth === 0) {
112
- notify();
113
- for (const callback of queued.splice(0)) {
114
- callback();
111
+ if (depth === 0) {
112
+ const callbacks = queued.splice(0);
113
+ try {
114
+ notify();
115
+ } finally {
116
+ for (const callback of callbacks) {
117
+ callback();
118
+ }
119
+ }
115
120
  }
116
121
  }
117
122
  },
package/src/presets.ts CHANGED
@@ -137,7 +137,10 @@ export function describePreset<R, Id extends string>(
137
137
 
138
138
  return {
139
139
  id: preset,
140
- label: labels[preset] ?? preset,
140
+ // Unknown ids show as themselves, even ones like "constructor" that objects inherit.
141
+ label: Object.prototype.hasOwnProperty.call(labels, preset)
142
+ ? (labels[preset] ?? preset)
143
+ : preset,
141
144
  resolve: (context) => resolveBuiltIn(preset, context),
142
145
  };
143
146
  }