@ember-data/legacy-compat 5.4.0-alpha.63 → 5.4.0-alpha.64

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/addon/utils.js CHANGED
@@ -166,6 +166,10 @@ function formattedId(id) {
166
166
  }
167
167
  return id === null ? null : String(id);
168
168
  }
169
+ function expectId(id) {
170
+ AssertFn('expectId: id must not be null', id !== null);
171
+ return formattedId(id);
172
+ }
169
173
 
170
174
  /**
171
175
  * Compares two types for strict equality, converting them to
@@ -243,4 +247,4 @@ function isEquivId(expected, actual) {
243
247
  AssertFn('isEquivId: Actual id must not be 0', actual !== '0' && actual !== 0);
244
248
  return expected === actual || formattedId(expected) === formattedId(actual);
245
249
  }
246
- export { configureAssertFn, configureMismatchReporter, configureTypeNormalization, formattedId, formattedType, isEquivId, isEquivType };
250
+ export { configureAssertFn, configureMismatchReporter, configureTypeNormalization, expectId, formattedId, formattedType, isEquivId, isEquivType };
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sources":["../src/utils.ts"],"sourcesContent":["/**\n Utilities for helping to migrate to stricter\n and more consistent use of IDs and types.\n\n @module @ember-data/legacy-compat/utils\n @main @ember-data/legacy-compat/utils\n @deprecated\n*/\nimport { dasherize } from '@ember/string';\n\nimport { dependencySatisfies, importSync, macroCondition } from '@embroider/macros';\n\nimport { DEBUG } from '@warp-drive/build-config/env';\n\ninterface AssertFunc {\n (desc: string, condition: unknown): asserts condition;\n (desc: string): never;\n}\n\ntype Reporter = (type: 'formatted-id' | 'formatted-type', actual: unknown, expected: unknown) => void;\ntype Normalizer = (type: string) => string;\nlet singularize: (str: string) => string;\nif (macroCondition(dependencySatisfies('ember-inflector', '*'))) {\n singularize = (importSync('ember-inflector') as typeof import('ember-inflector')).singularize;\n}\n\nlet MismatchReporter: Reporter = function () {};\n\n// TODO: @runspired This pattern prevents AssertFn from being removed in production builds\n// but we should enable that if we can.\nlet _AssertFn: (message: string, condition: unknown) => void = function () {};\nconst AssertFn: AssertFunc = ((message: string, condition: unknown) => {\n if (!condition) {\n _AssertFn(message, condition);\n }\n if (DEBUG) {\n if (!condition) {\n throw new Error(`Assertion Failed: ${message}`);\n }\n }\n}) as unknown as AssertFunc;\nlet NormalizedType: Normalizer = (str: string) => {\n return singularize(dasherize(str));\n};\n\n/**\n * Configure a function to be called when an id or type\n * changes during normalization. This is useful for instrumenting\n * to discover places where usage in the app is not consistent.\n *\n * @method configureMismatchReporter\n * @for @ember-data/legacy-compat/utils\n * @param method a function which takes a mismatch-type ('formatted-id' | 'formatted-type'), actual, and expected value\n * @public\n * @static\n */\nexport function configureMismatchReporter(fn: Reporter): void {\n MismatchReporter = fn;\n}\n\n/**\n * Configure a function to be called when an id or type\n * fails validation. This is useful for instrumenting\n * to discover places where usage in the app is not consistent.\n *\n * @method configureAssertFn\n * @for @ember-data/legacy-compat/utils\n * @param method a function which takes a message and a condition\n * @public\n * @static\n */\nexport function configureAssertFn(fn: (message: string, condition: unknown) => void): void {\n _AssertFn = fn;\n}\n\n/**\n * Configure a function to be called to normalize\n * a resource type string. Used by both formattedType\n * and isEquivType to ensure consistent normalization\n * during comparison.\n *\n * If validation fails or the type turns out be unnormalized\n * the configured mismatch reporter and assert functions will\n * be called.\n *\n * @method configureTypeNormalization\n * @for @ember-data/legacy-compat/utils\n * @param method a function which takes a string and returns a string\n * @public\n * @static\n */\nexport function configureTypeNormalization(fn: (type: string) => string): void {\n NormalizedType = fn;\n}\n\nconst NORMALIZED_TYPES = new Map<string, string>();\n\n/**\n * Converts a potentially unnormalized type into the format expected\n * by our EmberData Cache. Currently this is singular-dasherized.\n *\n * you should not rely on this function to give you an exact format\n * for display purposes. Formatting for display should be handled\n * differently if the exact format matters.\n *\n * Asserts invalid types (undefined, null, '') in dev.\n *\n * **Usage**\n *\n * ```js\n * import formattedType from 'soxhub-client/helpers/formatted-type';\n *\n * formattedType('post'); // => 'post'\n * formattedType('posts'); // => 'post'\n * formattedType('Posts'); // => 'post'\n * formattedType('post-comment'); // => 'post-comment'\n * formattedType('post-comments'); // => 'post-comment'\n * formattedType('post_comment'); // => 'post-comment'\n * formattedType('postComment'); // => 'post-comment'\n * formattedType('PostComment'); // => 'post-comment'\n * ```\n *\n * @method formattedType\n * @for @ember-data/legacy-compat/utils\n * @param {string} type the potentially un-normalized type\n * @return {string} the normalized type\n * @public\n * @static\n */\nexport function formattedType<T extends string>(type: T | string): T {\n AssertFn('formattedType: type must not be null', type !== null);\n AssertFn('formattedType: type must not be undefined', type !== undefined);\n AssertFn('formattedType: type must be a string', typeof type === 'string');\n AssertFn('formattedType: type must not be empty', type.length > 0);\n let normalized = NORMALIZED_TYPES.get(type);\n\n if (normalized === undefined) {\n normalized = NormalizedType(type);\n NORMALIZED_TYPES.set(type, normalized);\n }\n\n if (normalized !== type) {\n MismatchReporter('formatted-type', type, normalized);\n }\n\n return normalized as T;\n}\n\n/**\n * Format an id to the format expected by the EmberData Cache.\n * Currently this means that id should be `string | null`.\n *\n * Asserts invalid IDs (undefined, '', 0, '0') in dev.\n *\n * **Usage**\n *\n * ```js\n * import formattedId from 'client/utils/formatted-id';\n *\n * formattedId('1'); // => '1'\n * formattedId(1); // => '1'\n * formattedId(null); // => null\n *\t```\n *\n * @method formattedId\n * @for @ember-data/legacy-compat/utils\n * @param {string | number | null} id the potentially un-normalized id\n * @return {string | null} the normalized id\n * @public\n * @static\n */\nexport function formattedId(id: string | number): string;\nexport function formattedId(id: null): null;\nexport function formattedId(id: string | number | null): string | null;\nexport function formattedId(id: string | number | null): string | null {\n AssertFn('formattedId: id must not be undefined', id !== undefined);\n AssertFn(\n 'formattedId: id must be a number, string or null',\n typeof id === 'number' || typeof id === 'string' || id === null\n );\n AssertFn(\n 'formattedId: id must not be empty',\n typeof id === 'number' || id === null || (typeof id === 'string' && id.length > 0)\n );\n AssertFn('formattedId: id must not be 0', id !== '0' && id !== 0);\n\n const formatted = id === null ? null : String(id);\n if (formatted !== id) {\n MismatchReporter('formatted-id', id, formatted);\n }\n return id === null ? null : String(id);\n}\n\n/**\n * Compares two types for strict equality, converting them to\n * the format expected by the EmberData Cache to ensure\n * differences in format are accounted for in the comparison.\n *\n * Asserts when expected or actual are invalid types in dev.\n * Expected may never be null.\n *\n * ```js\n * isEquivType('posts', 'post'); // true\n * isEquivType('post', 'post'); // true\n * isEquivType('posts', 'posts'); // true\n * isEquivType('post-comment', 'postComment'); // true\n * isEquivType('post-comment', 'PostComment'); // true\n * isEquivType('post-comment', 'post_comment'); // true\n * isEquivType('post-comment', 'post-comment'); // true\n * isEquivType('post-comment', 'post'); // false\n * isEquivType('posts', null); // false\n * ```\n *\n * @method isEquivType\n * @for @ember-data/legacy-compat/utils\n * @param {string} expected a potentially unnormalized type to match against\n * @param {string} actual a potentially unnormalized type to match against\n * @return {boolean} true if the types are equivalent\n * @public\n * @static\n */\nexport function isEquivType(expected: string, actual: string): boolean {\n AssertFn('isEquivType: Expected type must not be null', expected !== null);\n AssertFn('isEquivType: Expected type must not be undefined', expected !== undefined);\n AssertFn('isEquivType: Expected type must be a string', typeof expected === 'string');\n AssertFn('isEquivType: Expected type must not be empty', expected.length > 0);\n\n AssertFn('isEquivType: Actual type must not be null', actual !== null);\n AssertFn('isEquivType: Actual type must not be undefined', actual !== undefined);\n AssertFn('isEquivType: Actual type must be a string', typeof actual === 'string');\n AssertFn('isEquivType: Actual type must not be empty', actual.length > 0);\n\n return expected === actual || formattedType(expected) === formattedType(actual);\n}\n\n/**\n * Compares two IDs for strict equality, converting them to\n * the format expected by the EmberData Cache to ensure\n * differences in format are accounted for in the comparison.\n *\n * Asserts when expected or actual are invalid IDs in dev.\n * Expected may never be null.\n *\n * ```js\n * isEquivId('1', 1); // true\n * isEquivId('2', '2'); // true\n * isEquivId(3, '3'); // true\n * isEquivId(4, '3'); // false\n * isEquivId(1, null); // false\n * ```\n *\n * @method isEquivId\n * @for @ember-data/legacy-compat/utils\n * @param {string | number} expected a potentially un-normalized id to match against\n * @param {string | number} actual a potentially un-normalized id to match against\n * @return {boolean} true if the ids are equivalent\n * @public\n * @static\n */\nexport function isEquivId(expected: string | number, actual: string | number | null): boolean {\n AssertFn('isEquivId: Expected id must not be null', expected !== null);\n AssertFn('isEquivId: Expected id must not be undefined', expected !== undefined);\n AssertFn(\n 'isEquivId: Expected id must be a number or string',\n typeof expected === 'number' || typeof expected === 'string'\n );\n AssertFn(\n 'isEquivId: Expected id must not be empty',\n typeof expected === 'number' || (typeof expected === 'string' && expected.length > 0)\n );\n AssertFn('isEquivId: Expected id must not be 0', expected !== '0' && expected !== 0);\n\n AssertFn('isEquivId: Actual id must not be undefined', actual !== undefined);\n AssertFn(\n 'isEquivId: Actual id must be a number, string or null',\n typeof actual === 'number' || typeof actual === 'string' || actual === null\n );\n AssertFn(\n 'isEquivId: Actual id must not be empty',\n actual === null || typeof actual === 'number' || (typeof actual === 'string' && actual.length > 0)\n );\n AssertFn('isEquivId: Actual id must not be 0', actual !== '0' && actual !== 0);\n\n return expected === actual || formattedId(expected) === formattedId(actual);\n}\n"],"names":["singularize","macroCondition","dependencySatisfies","importSync","MismatchReporter","_AssertFn","AssertFn","message","condition","getOwnConfig","env","DEBUG","Error","NormalizedType","str","dasherize","configureMismatchReporter","fn","configureAssertFn","configureTypeNormalization","NORMALIZED_TYPES","Map","formattedType","type","undefined","length","normalized","get","set","formattedId","id","formatted","String","isEquivType","expected","actual","isEquivId"],"mappings":";;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAcA,IAAIA,WAAoC,CAAA;AACxC,IAAIC,cAAc,CAACC,mBAAmB,CAAC,iBAAiB,EAAE,GAAG,CAAC,CAAC,EAAE;AAC/DF,EAAAA,WAAW,GAAIG,UAAU,CAAC,iBAAiB,CAAC,CAAsCH,WAAW,CAAA;AAC/F,CAAA;AAEA,IAAII,gBAA0B,GAAG,YAAY,EAAE,CAAA;;AAE/C;AACA;AACA,IAAIC,SAAwD,GAAG,YAAY,EAAE,CAAA;AAC7E,MAAMC,QAAoB,GAAIA,CAACC,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AA;EACDnB,QAAQ,CAAC,oCAAoC,EAAE6B,MAAM,KAAK,GAAG,IAAIA,MAAM,KAAK,CAAC,CAAC,CAAA;AAE9E,EAAA,OAAOD,QAAQ,KAAKC,MAAM,IAAIN,WAAW,CAACK,QAAQ,CAAC,KAAKL,WAAW,CAACM,MAAM,CAAC,CAAA;AAC7E;;;;"}
1
+ {"version":3,"file":"utils.js","sources":["../src/utils.ts"],"sourcesContent":["/**\n Utilities for helping to migrate to stricter\n and more consistent use of IDs and types.\n\n @module @ember-data/legacy-compat/utils\n @main @ember-data/legacy-compat/utils\n @deprecated\n*/\nimport { dasherize } from '@ember/string';\n\nimport { dependencySatisfies, importSync, macroCondition } from '@embroider/macros';\n\nimport { DEBUG } from '@warp-drive/build-config/env';\n\ninterface AssertFunc {\n (desc: string, condition: unknown): asserts condition;\n (desc: string): never;\n}\n\ntype Reporter = (type: 'formatted-id' | 'formatted-type', actual: unknown, expected: unknown) => void;\ntype Normalizer = (type: string) => string;\nlet singularize: (str: string) => string;\nif (macroCondition(dependencySatisfies('ember-inflector', '*'))) {\n singularize = (importSync('ember-inflector') as typeof import('ember-inflector')).singularize;\n}\n\nlet MismatchReporter: Reporter = function () {};\n\n// TODO: @runspired This pattern prevents AssertFn from being removed in production builds\n// but we should enable that if we can.\nlet _AssertFn: (message: string, condition: unknown) => void = function () {};\nconst AssertFn: AssertFunc = ((message: string, condition: unknown) => {\n if (!condition) {\n _AssertFn(message, condition);\n }\n if (DEBUG) {\n if (!condition) {\n throw new Error(`Assertion Failed: ${message}`);\n }\n }\n}) as unknown as AssertFunc;\nlet NormalizedType: Normalizer = (str: string) => {\n return singularize(dasherize(str));\n};\n\n/**\n * Configure a function to be called when an id or type\n * changes during normalization. This is useful for instrumenting\n * to discover places where usage in the app is not consistent.\n *\n * @method configureMismatchReporter\n * @for @ember-data/legacy-compat/utils\n * @param method a function which takes a mismatch-type ('formatted-id' | 'formatted-type'), actual, and expected value\n * @public\n * @static\n */\nexport function configureMismatchReporter(fn: Reporter): void {\n MismatchReporter = fn;\n}\n\n/**\n * Configure a function to be called when an id or type\n * fails validation. This is useful for instrumenting\n * to discover places where usage in the app is not consistent.\n *\n * @method configureAssertFn\n * @for @ember-data/legacy-compat/utils\n * @param method a function which takes a message and a condition\n * @public\n * @static\n */\nexport function configureAssertFn(fn: (message: string, condition: unknown) => void): void {\n _AssertFn = fn;\n}\n\n/**\n * Configure a function to be called to normalize\n * a resource type string. Used by both formattedType\n * and isEquivType to ensure consistent normalization\n * during comparison.\n *\n * If validation fails or the type turns out be unnormalized\n * the configured mismatch reporter and assert functions will\n * be called.\n *\n * @method configureTypeNormalization\n * @for @ember-data/legacy-compat/utils\n * @param method a function which takes a string and returns a string\n * @public\n * @static\n */\nexport function configureTypeNormalization(fn: (type: string) => string): void {\n NormalizedType = fn;\n}\n\nconst NORMALIZED_TYPES = new Map<string, string>();\n\n/**\n * Converts a potentially unnormalized type into the format expected\n * by our EmberData Cache. Currently this is singular-dasherized.\n *\n * you should not rely on this function to give you an exact format\n * for display purposes. Formatting for display should be handled\n * differently if the exact format matters.\n *\n * Asserts invalid types (undefined, null, '') in dev.\n *\n * **Usage**\n *\n * ```js\n * import formattedType from 'soxhub-client/helpers/formatted-type';\n *\n * formattedType('post'); // => 'post'\n * formattedType('posts'); // => 'post'\n * formattedType('Posts'); // => 'post'\n * formattedType('post-comment'); // => 'post-comment'\n * formattedType('post-comments'); // => 'post-comment'\n * formattedType('post_comment'); // => 'post-comment'\n * formattedType('postComment'); // => 'post-comment'\n * formattedType('PostComment'); // => 'post-comment'\n * ```\n *\n * @method formattedType\n * @for @ember-data/legacy-compat/utils\n * @param {string} type the potentially un-normalized type\n * @return {string} the normalized type\n * @public\n * @static\n */\nexport function formattedType<T extends string>(type: T | string): T {\n AssertFn('formattedType: type must not be null', type !== null);\n AssertFn('formattedType: type must not be undefined', type !== undefined);\n AssertFn('formattedType: type must be a string', typeof type === 'string');\n AssertFn('formattedType: type must not be empty', type.length > 0);\n let normalized = NORMALIZED_TYPES.get(type);\n\n if (normalized === undefined) {\n normalized = NormalizedType(type);\n NORMALIZED_TYPES.set(type, normalized);\n }\n\n if (normalized !== type) {\n MismatchReporter('formatted-type', type, normalized);\n }\n\n return normalized as T;\n}\n\n/**\n * Format an id to the format expected by the EmberData Cache.\n * Currently this means that id should be `string | null`.\n *\n * Asserts invalid IDs (undefined, '', 0, '0') in dev.\n *\n * **Usage**\n *\n * ```js\n * import formattedId from 'client/utils/formatted-id';\n *\n * formattedId('1'); // => '1'\n * formattedId(1); // => '1'\n * formattedId(null); // => null\n *\t```\n *\n * @method formattedId\n * @for @ember-data/legacy-compat/utils\n * @param {string | number | null} id the potentially un-normalized id\n * @return {string | null} the normalized id\n * @public\n * @static\n */\nexport function formattedId(id: string | number): string;\nexport function formattedId(id: null): null;\nexport function formattedId(id: string | number | null): string | null;\nexport function formattedId(id: string | number | null): string | null {\n AssertFn('formattedId: id must not be undefined', id !== undefined);\n AssertFn(\n 'formattedId: id must be a number, string or null',\n typeof id === 'number' || typeof id === 'string' || id === null\n );\n AssertFn(\n 'formattedId: id must not be empty',\n typeof id === 'number' || id === null || (typeof id === 'string' && id.length > 0)\n );\n AssertFn('formattedId: id must not be 0', id !== '0' && id !== 0);\n\n const formatted = id === null ? null : String(id);\n if (formatted !== id) {\n MismatchReporter('formatted-id', id, formatted);\n }\n return id === null ? null : String(id);\n}\n\nexport function expectId(id: string | number): string;\nexport function expectId(id: null): never;\nexport function expectId(id: string | number | null): string {\n AssertFn('expectId: id must not be null', id !== null);\n\n return formattedId(id);\n}\n\n/**\n * Compares two types for strict equality, converting them to\n * the format expected by the EmberData Cache to ensure\n * differences in format are accounted for in the comparison.\n *\n * Asserts when expected or actual are invalid types in dev.\n * Expected may never be null.\n *\n * ```js\n * isEquivType('posts', 'post'); // true\n * isEquivType('post', 'post'); // true\n * isEquivType('posts', 'posts'); // true\n * isEquivType('post-comment', 'postComment'); // true\n * isEquivType('post-comment', 'PostComment'); // true\n * isEquivType('post-comment', 'post_comment'); // true\n * isEquivType('post-comment', 'post-comment'); // true\n * isEquivType('post-comment', 'post'); // false\n * isEquivType('posts', null); // false\n * ```\n *\n * @method isEquivType\n * @for @ember-data/legacy-compat/utils\n * @param {string} expected a potentially unnormalized type to match against\n * @param {string} actual a potentially unnormalized type to match against\n * @return {boolean} true if the types are equivalent\n * @public\n * @static\n */\nexport function isEquivType(expected: string, actual: string): boolean {\n AssertFn('isEquivType: Expected type must not be null', expected !== null);\n AssertFn('isEquivType: Expected type must not be undefined', expected !== undefined);\n AssertFn('isEquivType: Expected type must be a string', typeof expected === 'string');\n AssertFn('isEquivType: Expected type must not be empty', expected.length > 0);\n\n AssertFn('isEquivType: Actual type must not be null', actual !== null);\n AssertFn('isEquivType: Actual type must not be undefined', actual !== undefined);\n AssertFn('isEquivType: Actual type must be a string', typeof actual === 'string');\n AssertFn('isEquivType: Actual type must not be empty', actual.length > 0);\n\n return expected === actual || formattedType(expected) === formattedType(actual);\n}\n\n/**\n * Compares two IDs for strict equality, converting them to\n * the format expected by the EmberData Cache to ensure\n * differences in format are accounted for in the comparison.\n *\n * Asserts when expected or actual are invalid IDs in dev.\n * Expected may never be null.\n *\n * ```js\n * isEquivId('1', 1); // true\n * isEquivId('2', '2'); // true\n * isEquivId(3, '3'); // true\n * isEquivId(4, '3'); // false\n * isEquivId(1, null); // false\n * ```\n *\n * @method isEquivId\n * @for @ember-data/legacy-compat/utils\n * @param {string | number} expected a potentially un-normalized id to match against\n * @param {string | number} actual a potentially un-normalized id to match against\n * @return {boolean} true if the ids are equivalent\n * @public\n * @static\n */\nexport function isEquivId(expected: string | number, actual: string | number | null): boolean {\n AssertFn('isEquivId: Expected id must not be null', expected !== null);\n AssertFn('isEquivId: Expected id must not be undefined', expected !== undefined);\n AssertFn(\n 'isEquivId: Expected id must be a number or string',\n typeof expected === 'number' || typeof expected === 'string'\n );\n AssertFn(\n 'isEquivId: Expected id must not be empty',\n typeof expected === 'number' || (typeof expected === 'string' && expected.length > 0)\n );\n AssertFn('isEquivId: Expected id must not be 0', expected !== '0' && expected !== 0);\n\n AssertFn('isEquivId: Actual id must not be undefined', actual !== undefined);\n AssertFn(\n 'isEquivId: Actual id must be a number, string or null',\n typeof actual === 'number' || typeof actual === 'string' || actual === null\n );\n AssertFn(\n 'isEquivId: Actual id must not be empty',\n actual === null || typeof actual === 'number' || (typeof actual === 'string' && actual.length > 0)\n );\n AssertFn('isEquivId: Actual id must not be 0', actual !== '0' && actual !== 0);\n\n return expected === actual || formattedId(expected) === formattedId(actual);\n}\n"],"names":["singularize","macroCondition","dependencySatisfies","importSync","MismatchReporter","_AssertFn","AssertFn","message","condition","getOwnConfig","env","DEBUG","Error","NormalizedType","str","dasherize","configureMismatchReporter","fn","configureAssertFn","configureTypeNormalization","NORMALIZED_TYPES","Map","formattedType","type","undefined","length","normalized","get","set","formattedId","id","formatted","String","expectId","isEquivType","expected","actual","isEquivId"],"mappings":";;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAcA,IAAIA,WAAoC,CAAA;AACxC,IAAIC,cAAc,CAACC,mBAAmB,CAAC,iBAAiB,EAAE,GAAG,CAAC,CAAC,EAAE;AAC/DF,EAAAA,WAAW,GAAIG,UAAU,CAAC,iBAAiB,CAAC,CAAsCH,WAAW,CAAA;AAC/F,CAAA;AAEA,IAAII,gBAA0B,GAAG,YAAY,EAAE,CAAA;;AAE/C;AACA;AACA,IAAIC,SAAwD,GAAG,YAAY,EAAE,CAAA;AAC7E,MAAMC,QAAoB,GAAIA,CAACC,OAAe,EAAEC,SAAkB,KAAK;EACrE,IAAI,CAACA,SAAS,EAAE;AACdH,IAAAA,SAAS,CAACE,OAAO,EAAEC,SAAS,CAAC,CAAA;AAC/B,GAAA;AACA,EAAA,IAAAP,cAAA,CAAAQ,YAAA,GAAAC,GAAA,CAAAC,KAAA,CAAW,EAAA;IACT,IAAI,CAACH,SAAS,EAAE;AACd,MAAA,MAAM,IAAII,KAAK,CAAE,CAAoBL,kBAAAA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AAOD,QAAQ,KAAKC,MAAM,IAAIP,WAAW,CAACM,QAAQ,CAAC,KAAKN,WAAW,CAACO,MAAM,CAAC,CAAA;AAC7E;;;;"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ember-data/legacy-compat",
3
3
  "description": "Compatibility Shims for Older EmberData",
4
- "version": "5.4.0-alpha.63",
4
+ "version": "5.4.0-alpha.64",
5
5
  "license": "MIT",
6
6
  "author": "Chris Thoburn <runspired@users.noreply.github.com>",
7
7
  "repository": {
@@ -42,7 +42,7 @@
42
42
  "version": 1
43
43
  },
44
44
  "dependencies": {
45
- "@ember-data/private-build-infra": "5.4.0-alpha.63",
45
+ "@ember-data/private-build-infra": "5.4.0-alpha.64",
46
46
  "@embroider/macros": "^1.15.1",
47
47
  "ember-cli-babel": "^8.2.0"
48
48
  },
@@ -79,13 +79,13 @@
79
79
  }
80
80
  },
81
81
  "peerDependencies": {
82
- "@ember-data/graph": "5.4.0-alpha.63",
83
- "@ember-data/json-api": "5.4.0-alpha.63",
84
- "@ember-data/request": "5.4.0-alpha.63",
85
- "@ember-data/store": "5.4.0-alpha.63",
82
+ "@ember-data/graph": "5.4.0-alpha.64",
83
+ "@ember-data/json-api": "5.4.0-alpha.64",
84
+ "@ember-data/request": "5.4.0-alpha.64",
85
+ "@ember-data/store": "5.4.0-alpha.64",
86
86
  "@ember/string": "^3.1.1",
87
87
  "ember-inflector": "^4.0.2",
88
- "@warp-drive/core-types": "0.0.0-alpha.49"
88
+ "@warp-drive/core-types": "0.0.0-alpha.50"
89
89
  },
90
90
  "peerDependenciesMeta": {
91
91
  "@ember-data/graph": {
@@ -109,19 +109,19 @@
109
109
  "@babel/preset-env": "^7.24.4",
110
110
  "@babel/preset-typescript": "^7.24.1",
111
111
  "@babel/runtime": "^7.24.4",
112
- "@ember-data/graph": "5.4.0-alpha.63",
113
- "@ember-data/json-api": "5.4.0-alpha.63",
114
- "@ember-data/request": "5.4.0-alpha.63",
115
- "@ember-data/request-utils": "5.4.0-alpha.63",
116
- "@ember-data/store": "5.4.0-alpha.63",
117
- "@ember-data/tracking": "5.4.0-alpha.63",
112
+ "@ember-data/graph": "5.4.0-alpha.64",
113
+ "@ember-data/json-api": "5.4.0-alpha.64",
114
+ "@ember-data/request": "5.4.0-alpha.64",
115
+ "@ember-data/request-utils": "5.4.0-alpha.64",
116
+ "@ember-data/store": "5.4.0-alpha.64",
117
+ "@ember-data/tracking": "5.4.0-alpha.64",
118
118
  "@ember/string": "^3.1.1",
119
119
  "@embroider/addon-dev": "^4.3.1",
120
120
  "@glimmer/component": "^1.1.2",
121
121
  "@rollup/plugin-babel": "^6.0.4",
122
122
  "@rollup/plugin-node-resolve": "^15.2.3",
123
- "@warp-drive/core-types": "0.0.0-alpha.49",
124
- "@warp-drive/internal-config": "5.4.0-alpha.63",
123
+ "@warp-drive/core-types": "0.0.0-alpha.50",
124
+ "@warp-drive/internal-config": "5.4.0-alpha.64",
125
125
  "ember-inflector": "^4.0.2",
126
126
  "ember-source": "~5.7.0",
127
127
  "pnpm-sync-dependencies-meta-injected": "0.0.10",
@@ -100,6 +100,8 @@ declare module '@ember-data/legacy-compat/utils' {
100
100
  export function formattedId(id: string | number): string;
101
101
  export function formattedId(id: null): null;
102
102
  export function formattedId(id: string | number | null): string | null;
103
+ export function expectId(id: string | number): string;
104
+ export function expectId(id: null): never;
103
105
  /**
104
106
  * Compares two types for strict equality, converting them to
105
107
  * the format expected by the EmberData Cache to ensure
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAmBA,KAAK,QAAQ,GAAG,CAAC,IAAI,EAAE,cAAc,GAAG,gBAAgB,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;AA0BtG;;;;;;;;;;GAUG;AACH,wBAAgB,yBAAyB,CAAC,EAAE,EAAE,QAAQ,GAAG,IAAI,CAE5D;AAED;;;;;;;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