Rocky_Mountain_Vending/.pnpm-store/v10/files/9d/ab615fdbda55270397dae9b749c83d9ce73dc819640800e8bfc9db2d69c1a5f2dd70cc3002608dc75d65daa1848e12988e8b2637b9b047b43de0abf5635a3b-exec
DMleadgen 46d973904b
Initial commit: Rocky Mountain Vending website
Next.js website for Rocky Mountain Vending company featuring:
- Product catalog with Stripe integration
- Service areas and parts pages
- Admin dashboard with Clerk authentication
- SEO optimized pages with JSON-LD structured data

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 16:22:15 -07:00

102 lines
2.3 KiB
Text
Executable file

'use strict';
const { assert } = require('@hapi/hoek');
const Any = require('./any');
const internals = {};
internals.Map = class extends Map {
slice() {
return new internals.Map(this);
}
};
module.exports = Any.extend({
type: 'symbol',
terms: {
map: { init: new internals.Map() }
},
coerce: {
method(value, { schema, error }) {
const lookup = schema.$_terms.map.get(value);
if (lookup) {
value = lookup;
}
if (!schema._flags.only ||
typeof value === 'symbol') {
return { value };
}
return { value, errors: error('symbol.map', { map: schema.$_terms.map }) };
}
},
validate(value, { error }) {
if (typeof value !== 'symbol') {
return { value, errors: error('symbol.base') };
}
},
rules: {
map: {
method(iterable) {
if (iterable &&
!iterable[Symbol.iterator] &&
typeof iterable === 'object') {
iterable = Object.entries(iterable);
}
assert(iterable && iterable[Symbol.iterator], 'Iterable must be an iterable or object');
const obj = this.clone();
const symbols = [];
for (const entry of iterable) {
assert(entry && entry[Symbol.iterator], 'Entry must be an iterable');
const [key, value] = entry;
assert(typeof key !== 'object' && typeof key !== 'function' && typeof key !== 'symbol', 'Key must not be of type object, function, or Symbol');
assert(typeof value === 'symbol', 'Value must be a Symbol');
obj.$_terms.map.set(key, value);
symbols.push(value);
}
return obj.valid(...symbols);
}
}
},
manifest: {
build(obj, desc) {
if (desc.map) {
obj = obj.map(desc.map);
}
return obj;
}
},
messages: {
'symbol.base': '{{#label}} must be a symbol',
'symbol.map': '{{#label}} must be one of {{#map}}'
}
});