Closed mizdra closed 2 weeks ago
originalLocation
Previously, a token returned Locator#load could have multiple OriginalLocation.
Locator#load
OriginalLocation
const filePath = resolve('example/02-import/2.css'); // Convert to absolute path const result = await locator.load(filePath); assert.deepEqual(result, { dependencies: ['/path/to/1.css'], tokens: [ { name: 'a', originalLocations: [ { filePath: '/path/to/1.css', start: { line: 1, column: 1 }, end: { line: 1, column: 2 }, }, { filePath: '/path/to/1.css', start: { line: 2, column: 1 }, end: { line: 2, column: 2 }, }, ], }, ], });
From now on, each token will have one OriginalLocation.
const filePath = resolve('example/02-import/2.css'); // Convert to absolute path const result = await locator.load(filePath); assert.deepEqual(result, { dependencies: ['/path/to/1.css'], tokens: [ { name: 'a', originalLocation: { filePath: '/path/to/1.css', start: { line: 1, column: 1 }, end: { line: 1, column: 2 }, }, }, { name: 'a', originalLocation: { filePath: '/path/to/1.css', start: { line: 2, column: 1 }, end: { line: 2, column: 2 }, }, }, ], });
Locator#load is part of the experimental Programmable API. Therefore, this change is shipped as a minor update.
Breaking Changes
The token has only one
originalLocation
Previously, a token returned
Locator#load
could have multipleOriginalLocation
.From now on, each token will have one
OriginalLocation
.Locator#load
is part of the experimental Programmable API. Therefore, this change is shipped as a minor update.