Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@glimmer/util

Package Overview
Dependencies
Maintainers
13
Versions
288
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@glimmer/util - npm Package Compare versions

Comparing version 0.85.13 to 0.86.0

3

dist/dev/index.d.ts

@@ -166,3 +166,2 @@ import { Dict, Nullable, Stack, SimpleElement, InsertPosition, Namespace, SimpleNode, Maybe, Present, PresentArray, SimpleDocument, ErrHandle, HandleResult, OkHandle, Template, TemplateOk } from "@glimmer/interfaces";

};
declare function fillNulls<T>(count: number): T[];
declare function values<T>(obj: {

@@ -259,3 +258,3 @@ [s: string]: T;

declare function assertNever(value: never, desc?: string): never;
export { EMPTY_ARRAY, emptyArray, EMPTY_STRING_ARRAY, EMPTY_NUMBER_ARRAY, isEmptyArray, reverse, enumerate, debugAssert as assert, deprecate, dict, isDict, isObject, StackImpl as Stack, beginTestSteps, endTestSteps, logStep, verifySteps, debugToString, clearElement, RAW_NODE, ELEMENT_NODE, TEXT_NODE, COMMENT_NODE, DOCUMENT_NODE, DOCUMENT_TYPE_NODE, DOCUMENT_FRAGMENT_NODE, NS_HTML, NS_MATHML, NS_SVG, NS_XLINK, NS_XML, NS_XMLNS, INSERT_BEFORE_BEGIN, INSERT_AFTER_BEGIN, INSERT_BEFORE_END, INSERT_AFTER_END, ImmediateConstants, isHandle, isNonPrimitiveHandle, constants, isSmallInt, encodeNegative, decodeNegative, encodePositive, decodePositive, encodeHandle, decodeHandle, encodeImmediate, decodeImmediate, intern, isSerializationFirstNode, SERIALIZATION_FIRST_NODE_STRING, assign, entries, fillNulls, values, Factory, keys, unwrap, expect, unreachable, exhausted, Lit, tuple, isPresent, assertPresent, isPresentArray, ifPresent, arrayToOption, assertPresentArray, asPresentArray, getLast, getFirst, mapPresentArray, castToBrowser, castToSimple, checkBrowserNode as checkNode, isElement, isSimpleElement, strip, unwrapHandle, unwrapTemplate, extractHandle, isOkHandle, isErrHandle, buildUntouchableThis, FIXME, LOCAL_LOGGER, LOGGER, assertNever };
export { EMPTY_ARRAY, emptyArray, EMPTY_STRING_ARRAY, EMPTY_NUMBER_ARRAY, isEmptyArray, reverse, enumerate, debugAssert as assert, deprecate, dict, isDict, isObject, StackImpl as Stack, beginTestSteps, endTestSteps, logStep, verifySteps, debugToString, clearElement, RAW_NODE, ELEMENT_NODE, TEXT_NODE, COMMENT_NODE, DOCUMENT_NODE, DOCUMENT_TYPE_NODE, DOCUMENT_FRAGMENT_NODE, NS_HTML, NS_MATHML, NS_SVG, NS_XLINK, NS_XML, NS_XMLNS, INSERT_BEFORE_BEGIN, INSERT_AFTER_BEGIN, INSERT_BEFORE_END, INSERT_AFTER_END, ImmediateConstants, isHandle, isNonPrimitiveHandle, constants, isSmallInt, encodeNegative, decodeNegative, encodePositive, decodePositive, encodeHandle, decodeHandle, encodeImmediate, decodeImmediate, intern, isSerializationFirstNode, SERIALIZATION_FIRST_NODE_STRING, assign, entries, values, Factory, keys, unwrap, expect, unreachable, exhausted, Lit, tuple, isPresent, assertPresent, isPresentArray, ifPresent, arrayToOption, assertPresentArray, asPresentArray, getLast, getFirst, mapPresentArray, castToBrowser, castToSimple, checkBrowserNode as checkNode, isElement, isSimpleElement, strip, unwrapHandle, unwrapTemplate, extractHandle, isOkHandle, isErrHandle, buildUntouchableThis, FIXME, LOCAL_LOGGER, LOGGER, assertNever };
//# sourceMappingURL=index.d.ts.map

@@ -59,4 +59,3 @@ import { DEBUG } from '@glimmer/env';

}
function unreachable() {
let message = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'unreachable';
function unreachable(message = 'unreachable') {
return new Error(message);

@@ -67,8 +66,3 @@ }

}
const tuple = function () {
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return args;
};
const tuple = (...args) => args;

@@ -100,4 +94,3 @@ function isPresent(value) {

}
function assertPresentArray(list) {
let message = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : `unexpected empty list`;
function assertPresentArray(list, message = `unexpected empty list`) {
if (!isPresentArray(list)) {

@@ -107,4 +100,3 @@ throw new Error(message);

}
function asPresentArray(list) {
let message = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : `unexpected empty list`;
function asPresentArray(list, message = `unexpected empty list`) {
assertPresentArray(list, message);

@@ -142,4 +134,3 @@ return list;

current = null;
constructor() {
let values = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
constructor(values = []) {
this.stack = values;

@@ -307,6 +298,3 @@ }

}
function constants() {
for (var _len = arguments.length, values = new Array(_len), _key = 0; _key < _len; _key++) {
values[_key] = arguments[_key];
}
function constants(...values) {
return [false, true, null, undefined, ...values];

@@ -401,9 +389,2 @@ }

let assign = Object.assign;
function fillNulls(count) {
let arr = new Array(count);
for (let i = 0; i < count; i++) {
arr[i] = null;
}
return arr;
}
function values(obj) {

@@ -494,7 +475,4 @@ return Object.values(obj);

function strip(strings) {
function strip(strings, ...args) {
let out = '';
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
args[_key - 1] = arguments[_key];
}
for (const [i, string] of enumerate(strings)) {

@@ -592,4 +570,3 @@ let dynamic = args[i] !== undefined ? String(args[i]) : '';

const LOGGER = console;
function assertNever(value) {
let desc = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'unexpected unreachable branch';
function assertNever(value, desc = 'unexpected unreachable branch') {
LOGGER.log('unreachable', value);

@@ -600,3 +577,3 @@ LOGGER.log(`${desc} :: ${JSON.stringify(value)} (${value})`);

export { COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_TYPE_NODE, ELEMENT_NODE, EMPTY_ARRAY, EMPTY_NUMBER_ARRAY, EMPTY_STRING_ARRAY, INSERT_AFTER_BEGIN, INSERT_AFTER_END, INSERT_BEFORE_BEGIN, INSERT_BEFORE_END, ImmediateConstants, LOCAL_LOGGER, LOGGER, NS_HTML, NS_MATHML, NS_SVG, NS_XLINK, NS_XML, NS_XMLNS, RAW_NODE, SERIALIZATION_FIRST_NODE_STRING, StackImpl as Stack, TEXT_NODE, arrayToOption, asPresentArray, debugAssert as assert, assertNever, assertPresent, assertPresentArray, assign, beginTestSteps, buildUntouchableThis, castToBrowser, castToSimple, checkBrowserNode as checkNode, clearElement, constants, debugToString$1 as debugToString, decodeHandle, decodeImmediate, decodeNegative, decodePositive, deprecate, dict, emptyArray, encodeHandle, encodeImmediate, encodeNegative, encodePositive, endTestSteps, entries, enumerate, exhausted, expect, extractHandle, fillNulls, getFirst, getLast, ifPresent, intern, isDict, isElement, isEmptyArray, isErrHandle, isHandle, isNonPrimitiveHandle, isObject, isOkHandle, isPresent, isPresentArray, isSerializationFirstNode, isSimpleElement, isSmallInt, keys, logStep, mapPresentArray, reverse, strip, tuple, unreachable, unwrap, unwrapHandle, unwrapTemplate, values, verifySteps };
export { COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_TYPE_NODE, ELEMENT_NODE, EMPTY_ARRAY, EMPTY_NUMBER_ARRAY, EMPTY_STRING_ARRAY, INSERT_AFTER_BEGIN, INSERT_AFTER_END, INSERT_BEFORE_BEGIN, INSERT_BEFORE_END, ImmediateConstants, LOCAL_LOGGER, LOGGER, NS_HTML, NS_MATHML, NS_SVG, NS_XLINK, NS_XML, NS_XMLNS, RAW_NODE, SERIALIZATION_FIRST_NODE_STRING, StackImpl as Stack, TEXT_NODE, arrayToOption, asPresentArray, debugAssert as assert, assertNever, assertPresent, assertPresentArray, assign, beginTestSteps, buildUntouchableThis, castToBrowser, castToSimple, checkBrowserNode as checkNode, clearElement, constants, debugToString$1 as debugToString, decodeHandle, decodeImmediate, decodeNegative, decodePositive, deprecate, dict, emptyArray, encodeHandle, encodeImmediate, encodeNegative, encodePositive, endTestSteps, entries, enumerate, exhausted, expect, extractHandle, getFirst, getLast, ifPresent, intern, isDict, isElement, isEmptyArray, isErrHandle, isHandle, isNonPrimitiveHandle, isObject, isOkHandle, isPresent, isPresentArray, isSerializationFirstNode, isSimpleElement, isSmallInt, keys, logStep, mapPresentArray, reverse, strip, tuple, unreachable, unwrap, unwrapHandle, unwrapTemplate, values, verifySteps };
//# sourceMappingURL=index.js.map

@@ -166,3 +166,2 @@ import { Dict, Nullable, Stack, SimpleElement, InsertPosition, Namespace, SimpleNode, Maybe, Present, PresentArray, SimpleDocument, ErrHandle, HandleResult, OkHandle, Template, TemplateOk } from "@glimmer/interfaces";

};
declare function fillNulls<T>(count: number): T[];
declare function values<T>(obj: {

@@ -259,3 +258,3 @@ [s: string]: T;

declare function assertNever(value: never, desc?: string): never;
export { EMPTY_ARRAY, emptyArray, EMPTY_STRING_ARRAY, EMPTY_NUMBER_ARRAY, isEmptyArray, reverse, enumerate, debugAssert as assert, deprecate, dict, isDict, isObject, StackImpl as Stack, beginTestSteps, endTestSteps, logStep, verifySteps, debugToString, clearElement, RAW_NODE, ELEMENT_NODE, TEXT_NODE, COMMENT_NODE, DOCUMENT_NODE, DOCUMENT_TYPE_NODE, DOCUMENT_FRAGMENT_NODE, NS_HTML, NS_MATHML, NS_SVG, NS_XLINK, NS_XML, NS_XMLNS, INSERT_BEFORE_BEGIN, INSERT_AFTER_BEGIN, INSERT_BEFORE_END, INSERT_AFTER_END, ImmediateConstants, isHandle, isNonPrimitiveHandle, constants, isSmallInt, encodeNegative, decodeNegative, encodePositive, decodePositive, encodeHandle, decodeHandle, encodeImmediate, decodeImmediate, intern, isSerializationFirstNode, SERIALIZATION_FIRST_NODE_STRING, assign, entries, fillNulls, values, Factory, keys, unwrap, expect, unreachable, exhausted, Lit, tuple, isPresent, assertPresent, isPresentArray, ifPresent, arrayToOption, assertPresentArray, asPresentArray, getLast, getFirst, mapPresentArray, castToBrowser, castToSimple, checkBrowserNode as checkNode, isElement, isSimpleElement, strip, unwrapHandle, unwrapTemplate, extractHandle, isOkHandle, isErrHandle, buildUntouchableThis, FIXME, LOCAL_LOGGER, LOGGER, assertNever };
export { EMPTY_ARRAY, emptyArray, EMPTY_STRING_ARRAY, EMPTY_NUMBER_ARRAY, isEmptyArray, reverse, enumerate, debugAssert as assert, deprecate, dict, isDict, isObject, StackImpl as Stack, beginTestSteps, endTestSteps, logStep, verifySteps, debugToString, clearElement, RAW_NODE, ELEMENT_NODE, TEXT_NODE, COMMENT_NODE, DOCUMENT_NODE, DOCUMENT_TYPE_NODE, DOCUMENT_FRAGMENT_NODE, NS_HTML, NS_MATHML, NS_SVG, NS_XLINK, NS_XML, NS_XMLNS, INSERT_BEFORE_BEGIN, INSERT_AFTER_BEGIN, INSERT_BEFORE_END, INSERT_AFTER_END, ImmediateConstants, isHandle, isNonPrimitiveHandle, constants, isSmallInt, encodeNegative, decodeNegative, encodePositive, decodePositive, encodeHandle, decodeHandle, encodeImmediate, decodeImmediate, intern, isSerializationFirstNode, SERIALIZATION_FIRST_NODE_STRING, assign, entries, values, Factory, keys, unwrap, expect, unreachable, exhausted, Lit, tuple, isPresent, assertPresent, isPresentArray, ifPresent, arrayToOption, assertPresentArray, asPresentArray, getLast, getFirst, mapPresentArray, castToBrowser, castToSimple, checkBrowserNode as checkNode, isElement, isSimpleElement, strip, unwrapHandle, unwrapTemplate, extractHandle, isOkHandle, isErrHandle, buildUntouchableThis, FIXME, LOCAL_LOGGER, LOGGER, assertNever };
//# sourceMappingURL=index.d.ts.map

@@ -1,2 +0,2 @@

const t=Object.freeze([]);function n(){return t}const e=n(),r=n();function o(n){return n===t}function*u(t){for(let n=t.length-1;n>=0;n--)yield t[n]}function*i(t){let n=0;for(const e of t)yield[n++,e]}function c(t,n){if(!t)throw new Error(n||"assertion failure")}function l(t){Ot.warn(`DEPRECATION: ${t}`)}function s(t){return Object.keys(t)}function f(t){if(null==t)throw new Error("Expected value to be present");return t}function a(t,n){if(null==t)throw new Error(n);return t}function d(){return new Error(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"unreachable")}function h(t){throw new Error(`Exhausted ${String(t)}`)}const E=function(){for(var t=arguments.length,n=new Array(t),e=0;e<t;e++)n[e]=arguments[e];return n};function w(t){return null!=t}function p(t,n){if(!w(t))throw new Error(`Expected present, got ${"string"==typeof t?t:n}`)}function N(t){return t.length>0}function g(t,n,e){return N(t)?n(t):e()}function _(t){return N(t)?t:null}function D(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"unexpected empty list";if(!N(t))throw new Error(n)}function b(t){return D(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:"unexpected empty list"),t}function A(t){return 0===t.length?void 0:t[t.length-1]}function m(t){return 0===t.length?void 0:t[0]}function y(t,n){if(null===t)return null;let e=[];for(let r of t)e.push(n(r));return e}function I(){return Object.create(null)}function L(t){return null!=t}function S(t){return"function"==typeof t||"object"==typeof t&&null!==t}class M{stack;current=null;constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.stack=t}get size(){return this.stack.length}push(t){this.current=t,this.stack.push(t)}pop(){let t=this.stack.pop();return this.current=A(this.stack)??null,void 0===t?null:t}nth(t){let n=this.stack.length;return n<t?null:f(this.stack[n-t])}isEmpty(){return 0===this.stack.length}toArray(){return this.stack}}const $=!("undefined"!=typeof window&&window.location&&/[&?]disable_local_debug/u.test(window.location.search));let T,v,C,H,O;if($){let t=null;T=()=>{c(null===t,"attempted to start steps, but it already began"),t={}},v=()=>{c(t,"attempted to end steps, but they were not started"),t=null},H=(n,e)=>{if(null===t)return;let r=t[n];r||(r=t[n]=[]),r.push(e)},C=(n,e,r)=>{let o=a(t,"attempetd to verify steps, but steps were not started"),u=o[n]||[];o[n]=[],Array.isArray(e)?QUnit.config.current.assert.deepEqual(u,e,r):e(u)}}{let t=t=>{let n=t.name;if(void 0===n){let e=/function (\w+)\s*\(/u.exec(String(t));n=e&&e[1]||""}return n.replace(/^bound /u,"")},n=n=>{let e,r;return n.constructor&&"function"==typeof n.constructor&&(r=t(n.constructor)),"toString"in n&&n.toString!==Object.prototype.toString&&n.toString!==Function.prototype.toString&&(e=n.toString()),e&&/<.*:ember\d+>/u.test(e)&&r&&"_"!==r[0]&&r.length>2&&"Class"!==r?e.replace(/<.*:/u,`<${r}:`):e||r},e=t=>String(t);O=r=>"function"==typeof r?t(r)||"(unknown function)":"object"==typeof r&&null!==r?n(r)||"(unknown object)":e(r)}var k=O;function x(t){let n=t.firstChild;for(;n;){let e=n.nextSibling;t.removeChild(n),n=e}}const U=-1,j=1,X=3,F=8,G=9,B=10,R=11,V="http://www.w3.org/1999/xhtml",z="http://www.w3.org/1998/Math/MathML",P="http://www.w3.org/2000/svg",q="http://www.w3.org/1999/xlink",J="http://www.w3.org/XML/1998/namespace",Q="http://www.w3.org/2000/xmlns/",Y="beforebegin",K="afterbegin",W="beforeend",Z="afterend";let tt=function(t){return t[t.MAX_SMI=1073741823]="MAX_SMI",t[t.MIN_SMI=-1073741824]="MIN_SMI",t[t.SIGN_BIT=-536870913]="SIGN_BIT",t[t.MAX_INT=536870911]="MAX_INT",t[t.MIN_INT=-536870912]="MIN_INT",t[t.FALSE_HANDLE=0]="FALSE_HANDLE",t[t.TRUE_HANDLE=1]="TRUE_HANDLE",t[t.NULL_HANDLE=2]="NULL_HANDLE",t[t.UNDEFINED_HANDLE=3]="UNDEFINED_HANDLE",t[t.ENCODED_FALSE_HANDLE=0]="ENCODED_FALSE_HANDLE",t[t.ENCODED_TRUE_HANDLE=1]="ENCODED_TRUE_HANDLE",t[t.ENCODED_NULL_HANDLE=2]="ENCODED_NULL_HANDLE",t[t.ENCODED_UNDEFINED_HANDLE=3]="ENCODED_UNDEFINED_HANDLE",t}({});function nt(t){return t>=0}function et(t){return t>tt.ENCODED_UNDEFINED_HANDLE}function rt(){for(var t=arguments.length,n=new Array(t),e=0;e<t;e++)n[e]=arguments[e];return[!1,!0,null,void 0,...n]}function ot(t){return t%1==0&&t<=tt.MAX_INT&&t>=tt.MIN_INT}function ut(t){return $&&c(t%1==0&&t>=tt.MIN_INT&&t<0,`Could not encode negative: ${t}`),t&tt.SIGN_BIT}function it(t){return $&&c(t%1==0&&t<~tt.MAX_INT&&t>=tt.MIN_SMI,`Could not decode negative: ${t}`),t|~tt.SIGN_BIT}function ct(t){return $&&c(t%1==0&&t>=0&&t<=tt.MAX_INT,`Could not encode positive: ${t}`),~t}function lt(t){return $&&c(t%1==0&&t<=0&&t>=~tt.MAX_INT,`Could not decode positive: ${t}`),~t}function st(t){return $&&c(t%1==0&&t>=0&&t<=tt.MAX_SMI,`Could not encode handle: ${t}`),t}function ft(t){return $&&c(t%1==0&&t<=tt.MAX_SMI&&t>=0,`Could not decode handle: ${t}`),t}function at(t){return(t|=0)<0?ut(t):ct(t)}function dt(t){return(t|=0)>tt.SIGN_BIT?lt(t):it(t)}function ht(t){let n={};n[t]=1;for(let e in n)if(e===t)return e;return t}[1,2,3].forEach((t=>ft(st(t)))),[1,-1].forEach((t=>dt(at(t))));const Et="%+b:0%";function wt(t){return t.nodeValue===Et}let pt=Object.assign;function Nt(t){let n=new Array(t);for(let e=0;e<t;e++)n[e]=null;return n}function gt(t){return Object.values(t)}function _t(t){return Object.entries(t)}function Dt(t){return At(t)||mt(t),t}function bt(t,n){if(null==t)return null;if(void 0===typeof document)throw new Error("Attempted to cast to a browser node in a non-browser context");if(At(t))return t;if(t.ownerDocument!==document)throw new Error("Attempted to cast to a browser node with a node that was not created from this document");return It(t,n)}function At(t){return t.nodeType===G}function mt(t){return t?.nodeType===j}function yt(t){return t?.nodeType===j&&t instanceof Element}function It(t,n){let e=!1;if(null!==t)if("string"==typeof n)e=Lt(t,n);else{if(!Array.isArray(n))throw d();e=n.some((n=>Lt(t,n)))}if(e&&t instanceof Node)return t;throw function(t,n){return new Error(`cannot cast a ${t} into ${String(n)}`)}(`SimpleElement(${t?.constructor?.name??"null"})`,n)}function Lt(t,n){switch(n){case"NODE":return!0;case"HTML":return t instanceof HTMLElement;case"SVG":return t instanceof SVGElement;case"ELEMENT":return t instanceof Element;default:if(n.toUpperCase()===n)throw new Error("BUG: this code is missing handling for a generic node type");return t instanceof Element&&t.tagName.toLowerCase()===n}}function St(t){let n="";for(var e=arguments.length,r=new Array(e>1?e-1:0),o=1;o<e;o++)r[o-1]=arguments[o];for(const[e,o]of i(t)){n+=`${o}${void 0!==r[e]?String(r[e]):""}`}let u=n.split("\n");for(;N(u)&&/^\s*$/u.test(m(u));)u.shift();for(;N(u)&&/^\s*$/u.test(A(u));)u.pop();let c=1/0;for(let t of u){let n=/^\s*/u.exec(t)[0].length;c=Math.min(c,n)}let l=[];for(let t of u)l.push(t.slice(c));return l.join("\n")}function Mt(t){if("number"==typeof t)return t;{let n=t.errors[0];throw new Error(`Compile Error: ${n.problem} @ ${n.span.start}..${n.span.end}`)}}function $t(t){if("error"===t.result)throw new Error(`Compile Error: ${t.problem} @ ${t.span.start}..${t.span.end}`);return t}function Tt(t){return"number"==typeof t?t:t.handle}function vt(t){return"number"==typeof t}function Ct(t){return"number"==typeof t}function Ht(t){let n=null;{let e=n=>{let e="symbol"==typeof n||"number"==typeof n?`[${String(n)}]`:`.${n}`;throw new Error(`You accessed \`this${e}\` from a function passed to the ${t}, but the function itself was not bound to a valid \`this\` context. Consider updating to use a bound function (for instance, use an arrow function, \`() => {}\`).`)};n=new Proxy({},{get(t,n){e(n)},set:(t,n)=>(e(n),!1),has:(t,n)=>(e(n),!1)})}return n}const Ot=console,kt=console;function xt(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"unexpected unreachable branch";throw kt.log("unreachable",t),kt.log(`${n} :: ${JSON.stringify(t)} (${t})`),new Error("code reached unreachable")}export{F as COMMENT_NODE,R as DOCUMENT_FRAGMENT_NODE,G as DOCUMENT_NODE,B as DOCUMENT_TYPE_NODE,j as ELEMENT_NODE,t as EMPTY_ARRAY,r as EMPTY_NUMBER_ARRAY,e as EMPTY_STRING_ARRAY,K as INSERT_AFTER_BEGIN,Z as INSERT_AFTER_END,Y as INSERT_BEFORE_BEGIN,W as INSERT_BEFORE_END,tt as ImmediateConstants,Ot as LOCAL_LOGGER,kt as LOGGER,V as NS_HTML,z as NS_MATHML,P as NS_SVG,q as NS_XLINK,J as NS_XML,Q as NS_XMLNS,U as RAW_NODE,Et as SERIALIZATION_FIRST_NODE_STRING,M as Stack,X as TEXT_NODE,_ as arrayToOption,b as asPresentArray,c as assert,xt as assertNever,p as assertPresent,D as assertPresentArray,pt as assign,T as beginTestSteps,Ht as buildUntouchableThis,bt as castToBrowser,Dt as castToSimple,It as checkNode,x as clearElement,rt as constants,k as debugToString,ft as decodeHandle,dt as decodeImmediate,it as decodeNegative,lt as decodePositive,l as deprecate,I as dict,n as emptyArray,st as encodeHandle,at as encodeImmediate,ut as encodeNegative,ct as encodePositive,v as endTestSteps,_t as entries,i as enumerate,h as exhausted,a as expect,Tt as extractHandle,Nt as fillNulls,m as getFirst,A as getLast,g as ifPresent,ht as intern,L as isDict,yt as isElement,o as isEmptyArray,Ct as isErrHandle,nt as isHandle,et as isNonPrimitiveHandle,S as isObject,vt as isOkHandle,w as isPresent,N as isPresentArray,wt as isSerializationFirstNode,mt as isSimpleElement,ot as isSmallInt,s as keys,H as logStep,y as mapPresentArray,u as reverse,St as strip,E as tuple,d as unreachable,f as unwrap,Mt as unwrapHandle,$t as unwrapTemplate,gt as values,C as verifySteps};
const t=Object.freeze([]);function n(){return t}const e=n(),r=n();function o(n){return n===t}function*u(t){for(let n=t.length-1;n>=0;n--)yield t[n]}function*i(t){let n=0;for(const e of t)yield[n++,e]}function c(t,n){if(!t)throw new Error(n||"assertion failure")}function s(t){Ot.warn(`DEPRECATION: ${t}`)}function l(t){return Object.keys(t)}function f(t){if(null==t)throw new Error("Expected value to be present");return t}function a(t,n){if(null==t)throw new Error(n);return t}function E(t="unreachable"){return new Error(t)}function d(t){throw new Error(`Exhausted ${String(t)}`)}const h=(...t)=>t;function p(t){return null!=t}function w(t,n){if(!p(t))throw new Error(`Expected present, got ${"string"==typeof t?t:n}`)}function N(t){return t.length>0}function g(t,n,e){return N(t)?n(t):e()}function _(t){return N(t)?t:null}function D(t,n="unexpected empty list"){if(!N(t))throw new Error(n)}function b(t,n="unexpected empty list"){return D(t,n),t}function m(t){return 0===t.length?void 0:t[t.length-1]}function I(t){return 0===t.length?void 0:t[0]}function A(t,n){if(null===t)return null;let e=[];for(let r of t)e.push(n(r));return e}function y(){return Object.create(null)}function L(t){return null!=t}function S(t){return"function"==typeof t||"object"==typeof t&&null!==t}class M{stack;current=null;constructor(t=[]){this.stack=t}get size(){return this.stack.length}push(t){this.current=t,this.stack.push(t)}pop(){let t=this.stack.pop();return this.current=m(this.stack)??null,void 0===t?null:t}nth(t){let n=this.stack.length;return n<t?null:f(this.stack[n-t])}isEmpty(){return 0===this.stack.length}toArray(){return this.stack}}const $=!("undefined"!=typeof window&&window.location&&/[&?]disable_local_debug/u.test(window.location.search));let T,C,H,O,v;if($){let t=null;T=()=>{c(null===t,"attempted to start steps, but it already began"),t={}},C=()=>{c(t,"attempted to end steps, but they were not started"),t=null},O=(n,e)=>{if(null===t)return;let r=t[n];r||(r=t[n]=[]),r.push(e)},H=(n,e,r)=>{let o=a(t,"attempetd to verify steps, but steps were not started"),u=o[n]||[];o[n]=[],Array.isArray(e)?QUnit.config.current.assert.deepEqual(u,e,r):e(u)}}{let t=t=>{let n=t.name;if(void 0===n){let e=/function (\w+)\s*\(/u.exec(String(t));n=e&&e[1]||""}return n.replace(/^bound /u,"")},n=n=>{let e,r;return n.constructor&&"function"==typeof n.constructor&&(r=t(n.constructor)),"toString"in n&&n.toString!==Object.prototype.toString&&n.toString!==Function.prototype.toString&&(e=n.toString()),e&&/<.*:ember\d+>/u.test(e)&&r&&"_"!==r[0]&&r.length>2&&"Class"!==r?e.replace(/<.*:/u,`<${r}:`):e||r},e=t=>String(t);v=r=>"function"==typeof r?t(r)||"(unknown function)":"object"==typeof r&&null!==r?n(r)||"(unknown object)":e(r)}var k=v;function x(t){let n=t.firstChild;for(;n;){let e=n.nextSibling;t.removeChild(n),n=e}}const U=-1,j=1,X=3,F=8,G=9,B=10,R=11,V="http://www.w3.org/1999/xhtml",z="http://www.w3.org/1998/Math/MathML",P="http://www.w3.org/2000/svg",q="http://www.w3.org/1999/xlink",J="http://www.w3.org/XML/1998/namespace",Q="http://www.w3.org/2000/xmlns/",Y="beforebegin",K="afterbegin",W="beforeend",Z="afterend";let tt=function(t){return t[t.MAX_SMI=1073741823]="MAX_SMI",t[t.MIN_SMI=-1073741824]="MIN_SMI",t[t.SIGN_BIT=-536870913]="SIGN_BIT",t[t.MAX_INT=536870911]="MAX_INT",t[t.MIN_INT=-536870912]="MIN_INT",t[t.FALSE_HANDLE=0]="FALSE_HANDLE",t[t.TRUE_HANDLE=1]="TRUE_HANDLE",t[t.NULL_HANDLE=2]="NULL_HANDLE",t[t.UNDEFINED_HANDLE=3]="UNDEFINED_HANDLE",t[t.ENCODED_FALSE_HANDLE=0]="ENCODED_FALSE_HANDLE",t[t.ENCODED_TRUE_HANDLE=1]="ENCODED_TRUE_HANDLE",t[t.ENCODED_NULL_HANDLE=2]="ENCODED_NULL_HANDLE",t[t.ENCODED_UNDEFINED_HANDLE=3]="ENCODED_UNDEFINED_HANDLE",t}({});function nt(t){return t>=0}function et(t){return t>tt.ENCODED_UNDEFINED_HANDLE}function rt(...t){return[!1,!0,null,void 0,...t]}function ot(t){return t%1==0&&t<=tt.MAX_INT&&t>=tt.MIN_INT}function ut(t){return $&&c(t%1==0&&t>=tt.MIN_INT&&t<0,`Could not encode negative: ${t}`),t&tt.SIGN_BIT}function it(t){return $&&c(t%1==0&&t<~tt.MAX_INT&&t>=tt.MIN_SMI,`Could not decode negative: ${t}`),t|~tt.SIGN_BIT}function ct(t){return $&&c(t%1==0&&t>=0&&t<=tt.MAX_INT,`Could not encode positive: ${t}`),~t}function st(t){return $&&c(t%1==0&&t<=0&&t>=~tt.MAX_INT,`Could not decode positive: ${t}`),~t}function lt(t){return $&&c(t%1==0&&t>=0&&t<=tt.MAX_SMI,`Could not encode handle: ${t}`),t}function ft(t){return $&&c(t%1==0&&t<=tt.MAX_SMI&&t>=0,`Could not decode handle: ${t}`),t}function at(t){return(t|=0)<0?ut(t):ct(t)}function Et(t){return(t|=0)>tt.SIGN_BIT?st(t):it(t)}function dt(t){let n={};n[t]=1;for(let e in n)if(e===t)return e;return t}[1,2,3].forEach((t=>ft(lt(t)))),[1,-1].forEach((t=>Et(at(t))));const ht="%+b:0%";function pt(t){return t.nodeValue===ht}let wt=Object.assign;function Nt(t){return Object.values(t)}function gt(t){return Object.entries(t)}function _t(t){return bt(t)||mt(t),t}function Dt(t,n){if(null==t)return null;if(void 0===typeof document)throw new Error("Attempted to cast to a browser node in a non-browser context");if(bt(t))return t;if(t.ownerDocument!==document)throw new Error("Attempted to cast to a browser node with a node that was not created from this document");return At(t,n)}function bt(t){return t.nodeType===G}function mt(t){return t?.nodeType===j}function It(t){return t?.nodeType===j&&t instanceof Element}function At(t,n){let e=!1;if(null!==t)if("string"==typeof n)e=yt(t,n);else{if(!Array.isArray(n))throw E();e=n.some((n=>yt(t,n)))}if(e&&t instanceof Node)return t;throw function(t,n){return new Error(`cannot cast a ${t} into ${String(n)}`)}(`SimpleElement(${t?.constructor?.name??"null"})`,n)}function yt(t,n){switch(n){case"NODE":return!0;case"HTML":return t instanceof HTMLElement;case"SVG":return t instanceof SVGElement;case"ELEMENT":return t instanceof Element;default:if(n.toUpperCase()===n)throw new Error("BUG: this code is missing handling for a generic node type");return t instanceof Element&&t.tagName.toLowerCase()===n}}function Lt(t,...n){let e="";for(const[r,o]of i(t)){e+=`${o}${void 0!==n[r]?String(n[r]):""}`}let r=e.split("\n");for(;N(r)&&/^\s*$/u.test(I(r));)r.shift();for(;N(r)&&/^\s*$/u.test(m(r));)r.pop();let o=1/0;for(let t of r){let n=/^\s*/u.exec(t)[0].length;o=Math.min(o,n)}let u=[];for(let t of r)u.push(t.slice(o));return u.join("\n")}function St(t){if("number"==typeof t)return t;{let n=t.errors[0];throw new Error(`Compile Error: ${n.problem} @ ${n.span.start}..${n.span.end}`)}}function Mt(t){if("error"===t.result)throw new Error(`Compile Error: ${t.problem} @ ${t.span.start}..${t.span.end}`);return t}function $t(t){return"number"==typeof t?t:t.handle}function Tt(t){return"number"==typeof t}function Ct(t){return"number"==typeof t}function Ht(t){let n=null;{let e=n=>{let e="symbol"==typeof n||"number"==typeof n?`[${String(n)}]`:`.${n}`;throw new Error(`You accessed \`this${e}\` from a function passed to the ${t}, but the function itself was not bound to a valid \`this\` context. Consider updating to use a bound function (for instance, use an arrow function, \`() => {}\`).`)};n=new Proxy({},{get(t,n){e(n)},set:(t,n)=>(e(n),!1),has:(t,n)=>(e(n),!1)})}return n}const Ot=console,vt=console;function kt(t,n="unexpected unreachable branch"){throw vt.log("unreachable",t),vt.log(`${n} :: ${JSON.stringify(t)} (${t})`),new Error("code reached unreachable")}export{F as COMMENT_NODE,R as DOCUMENT_FRAGMENT_NODE,G as DOCUMENT_NODE,B as DOCUMENT_TYPE_NODE,j as ELEMENT_NODE,t as EMPTY_ARRAY,r as EMPTY_NUMBER_ARRAY,e as EMPTY_STRING_ARRAY,K as INSERT_AFTER_BEGIN,Z as INSERT_AFTER_END,Y as INSERT_BEFORE_BEGIN,W as INSERT_BEFORE_END,tt as ImmediateConstants,Ot as LOCAL_LOGGER,vt as LOGGER,V as NS_HTML,z as NS_MATHML,P as NS_SVG,q as NS_XLINK,J as NS_XML,Q as NS_XMLNS,U as RAW_NODE,ht as SERIALIZATION_FIRST_NODE_STRING,M as Stack,X as TEXT_NODE,_ as arrayToOption,b as asPresentArray,c as assert,kt as assertNever,w as assertPresent,D as assertPresentArray,wt as assign,T as beginTestSteps,Ht as buildUntouchableThis,Dt as castToBrowser,_t as castToSimple,At as checkNode,x as clearElement,rt as constants,k as debugToString,ft as decodeHandle,Et as decodeImmediate,it as decodeNegative,st as decodePositive,s as deprecate,y as dict,n as emptyArray,lt as encodeHandle,at as encodeImmediate,ut as encodeNegative,ct as encodePositive,C as endTestSteps,gt as entries,i as enumerate,d as exhausted,a as expect,$t as extractHandle,I as getFirst,m as getLast,g as ifPresent,dt as intern,L as isDict,It as isElement,o as isEmptyArray,Ct as isErrHandle,nt as isHandle,et as isNonPrimitiveHandle,S as isObject,Tt as isOkHandle,p as isPresent,N as isPresentArray,pt as isSerializationFirstNode,mt as isSimpleElement,ot as isSmallInt,l as keys,O as logStep,A as mapPresentArray,u as reverse,Lt as strip,h as tuple,E as unreachable,f as unwrap,St as unwrapHandle,Mt as unwrapTemplate,Nt as values,H as verifySteps};
//# sourceMappingURL=index.js.map

@@ -14,3 +14,3 @@ export * from './lib/array-utils';

} from './lib/is-serialization-first-node';
export { assign, entries, fillNulls, values } from './lib/object-utils';
export { assign, entries, values } from './lib/object-utils';
export * from './lib/platform-utils';

@@ -17,0 +17,0 @@ export * from './lib/present';

{
"name": "@glimmer/util",
"version": "0.86.0",
"license": "MIT",
"description": "Common utilities used in Glimmer",
"repository": "https://github.com/tildeio/glimmer/tree/main/packages/@glimmer/util",
"type": "module",
"version": "0.85.13",
"description": "Common utilities used in Glimmer",
"repository": "https://github.com/tildeio/glimmer/tree/master/packages/@glimmer/util",
"license": "MIT",
"dependencies": {
"@glimmer/env": "0.1.7",
"@glimmer/interfaces": "^0.85.13"
"main": null,
"types": "dist/dev/index.d.ts",
"publishConfig": {
"access": "public"
},

@@ -15,21 +16,20 @@ "files": [

],
"dependencies": {
"@glimmer/env": "0.1.7",
"@glimmer/interfaces": "^0.86.0"
},
"devDependencies": {
"@types/qunit": "^2.19.7",
"@types/qunit": "^2.19.9",
"eslint": "^8.52.0",
"publint": "^0.2.5",
"rollup": "^3.21.6",
"rollup": "^4.5.1",
"typescript": "*",
"@glimmer-workspace/build-support": "^1.0.0",
"@glimmer/local-debug-flags": "^0.85.13"
"@glimmer/local-debug-flags": "^0.86.0"
},
"main": null,
"types": "dist/dev/index.d.ts",
"publishConfig": {
"access": "public"
},
"scripts": {
"build": "rollup -c rollup.config.mjs",
"test:lint": "eslint .",
"test:types": "tsc --noEmit -p ../tsconfig.json",
"build": "rollup -c rollup.config.mjs",
"test:publint": "publint"
"test:publint": "publint",
"test:types": "tsc --noEmit -p ../tsconfig.json"
},

@@ -36,0 +36,0 @@ "exports": {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc