Socket
Socket
Sign inDemoInstall

@magidoc/plugin-starter-variables

Package Overview
Dependencies
Maintainers
1
Versions
108
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@magidoc/plugin-starter-variables - npm Package Compare versions

Comparing version 0.7.0 to 0.7.1

build/variables/magidoc.d.ts

8

build/index.d.ts

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

import common from './common';
export { common };
import templates from './variables/templates';
import magidoc from './variables/magidoc';
import type { Variable, ViteVariable } from './variables/variable';
export { templates };
export { magidoc };
export type { Variable, ViteVariable };

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

export { default as common } from './common/index.js';
export { default as templates } from './variables/templates.js';
export { default as magidoc } from './variables/magidoc.js';
//# sourceMappingURL=index.js.map

@@ -5,3 +5,3 @@ {

"private": false,
"version": "0.7.0",
"version": "0.7.1",
"type": "module",

@@ -8,0 +8,0 @@ "license": "MIT",

@@ -1,3 +0,7 @@

import common from './common'
import templates from './variables/templates'
import magidoc from './variables/magidoc'
import type { Variable, ViteVariable } from './variables/variable'
export { common }
export { templates }
export { magidoc }
export type { Variable, ViteVariable }
import * as variables from '../src/index'
import type { Variable } from '../src/variable'
import type { Variable } from '../src/variables/variable'
describe('variables', () => {
it('contains the right number of export keys', () => {
expect(Object.keys(variables)).toEqual(['common'])
expect(Object.keys(variables)).toEqual(['templates', 'magidoc'])
})
it('contains the right common variables', () => {
expect(Object.keys(variables.common)).toEqual(['APP_LOGO', 'APP_TITLE'])
it('contains the right templates variables', () => {
expect(Object.keys(variables.templates)).toEqual(['APP_LOGO', 'APP_TITLE'])
testStringVariable(variables.common.APP_TITLE, 'VITE_APP_TITLE')
testStringVariable(variables.common.APP_LOGO, 'VITE_APP_LOGO')
testStringVariable(variables.templates.APP_TITLE, 'VITE_APP_TITLE')
testStringVariable(variables.templates.APP_LOGO, 'VITE_APP_LOGO')
})
it('contains the right magidoc variables', () => {
expect(Object.keys(variables.magidoc)).toEqual(['MAGIDOC_GENERATE'])
testBooleanVariable(
variables.magidoc.MAGIDOC_GENERATE,
'VITE_MAGIDOC_GENERATE',
)
})
})

@@ -32,1 +41,25 @@

}
function testBooleanVariable(target: Variable<boolean>, viteKey: string) {
expect(target.vite.key).toEqual(viteKey)
expect(target.vite.get({ [viteKey]: true })).toBe(true)
expect(target.vite.get({ [viteKey]: 'true' })).toBe(true)
expect(target.vite.get({ [viteKey]: 't' })).toBe(true)
expect(target.vite.get({ [viteKey]: '1' })).toBe(true)
expect(target.vite.get({ [viteKey]: 12 })).toBe(true)
expect(target.vite.get({ [viteKey]: false })).toBe(false)
expect(target.vite.get({ [viteKey]: 'false' })).toBe(false)
expect(target.vite.get({ [viteKey]: 'wow' })).toBe(false)
expect(target.vite.get({ [viteKey]: 0 })).toBe(false)
expect(target.vite.get({ [viteKey]: {} })).toBeNull()
expect(target.vite.get({ [viteKey]: null })).toBeNull()
expect(target.vite.get({ [viteKey]: undefined })).toBeNull()
expect(target.vite.get({})).toBeNull()
expect(target.vite.getOrDefault({ [viteKey]: false }, true)).toBe(false)
expect(target.vite.getOrDefault({ [viteKey]: {} }, true)).toBe(true)
expect(target.vite.getOrDefault({}, true)).toBe(true)
}

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